70 paint.setShader(shader);
81 const int X_OFFSET = 30;
113 SkScalar row3[] = {0.00f, 0.25f, 1.00f};
114 SkScalar row4[] = {0.00f, 0.25f, 0.50f, 0.50f, 1.00f};
115 SkScalar row5[] = {0.00f, 0.50f, 0.50f, 1.00f};
116 SkScalar row6[] = {0.00f, 0.00f, 1.00f};
117 SkScalar row7[] = {0.00f, 1.00f, 1.00f};
118 SkScalar row8[] = {0.00f, 0.30f, 0.30f, 1.00f};
148 for (
int cellRow = 0; cellRow <
NUM_ROWS; cellRow++) {
149 for (
int cellCol = 0; cellCol <
NUM_COLS; cellCol++) {
156 numGradientColors[cellRow],
static const int points[]
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
SkISize getISize() override
HardstopGradientShaderGM()
SkString getName() const override
void onDraw(SkCanvas *canvas) override
void drawRect(const SkRect &rect, const SkPaint &paint)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static void shade_rect(SkCanvas *canvas, sk_sp< SkShader > shader, int cellRow, int cellCol)
static void create_gradient_points(int cellRow, int cellCol, SkPoint points[2])
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
static constexpr SkISize Make(int32_t w, int32_t h)
static constexpr SkPoint Make(float x, float y)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)