45 {
49 };
50
51 std::vector<SkColor>
colors;
52 std::vector<SkScalar> positions;
53
54 for (
int row = 1; row <=
kNumRows; ++row) {
55
58
59 positions = {0.0f};
62 positions.push_back(place);
63 positions.push_back(place);
64 }
65 positions.push_back(1.0f);
67
68
71 positions.data(),
74 0,
75 nullptr);
77 paint.setShader(shader);
79
81 }
82 }
static const int points[]
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorWHITE
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
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)
PODArray< SkColor > colors
static constexpr SkPoint Make(float x, float y)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)