51 {
52 std::vector<SkColor>
colors;
53 std::vector<SkScalar> positions;
54 colors.reserve(stops.size());
55 positions.reserve(stops.size());
56
57 for (const GradientStop& stop : stops) {
58 colors.push_back(stop.color);
59 positions.push_back(stop.pos);
60 }
61
65 };
66
67
70 positions.data(),
74 paint.setShader(shader);
76
79
80
84 positions.data(),
87 paint.setShader(shader);
89
92 }
static const int points[]
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
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)