#ifndef GrGradientShader_DEFINE
#define GrGradientShader_DEFINE
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include "src/shaders/gradients/SkLinearGradient.h"
#include <memory>
class GrFragmentProcessor;
class SkGradientBaseShader;
class SkMatrix;
class SkRandom;
enum class SkTileMode;
struct GrFPArgs;
namespace SkShaders {
class MatrixRec;
}
namespace GrGradientShader {
std::unique_ptr<GrFragmentProcessor> MakeGradientFP(const SkGradientBaseShader& shader,
const GrFPArgs& args,
const SkShaders::MatrixRec&,
std::unique_ptr<GrFragmentProcessor> layout,
const SkMatrix* overrideMatrix = nullptr);
std::unique_ptr<GrFragmentProcessor> MakeLinear(const SkLinearGradient& shader,
const GrFPArgs& args,
const SkShaders::MatrixRec&);
#if defined(GPU_TEST_UTILS)
struct RandomParams {
inline static constexpr int kMaxRandomGradientColors = 5;
inline static constexpr SkScalar kGradientScale = 256.0f;
RandomParams(SkRandom* r);
bool fUseColors4f;
SkColor fColors[kMaxRandomGradientColors];
SkColor4f fColors4f[kMaxRandomGradientColors];
sk_sp<SkColorSpace> fColorSpace;
SkScalar fStopStorage[kMaxRandomGradientColors];
SkTileMode fTileMode;
int fColorCount;
SkScalar* fStops;
};
#endif
}
#endif