8 #ifndef SkGradientShader_DEFINED
9 #define SkGradientShader_DEFINED
26 kInterpolateColorsInPremul_Flag = 1 << 0,
46 const SkColor colors[],
const SkScalar pos[],
int count,
48 uint32_t flags,
const SkMatrix* localMatrix);
50 const SkColor colors[],
const SkScalar pos[],
int count,
52 return MakeLinear(pts, colors, pos, count, mode, 0, NULL);
72 const SkColor colors[],
const SkScalar pos[],
int count,
74 uint32_t flags,
const SkMatrix* localMatrix);
76 const SkColor colors[],
const SkScalar pos[],
int count,
78 return MakeRadial(center, radius, colors, pos, count, mode, 0, NULL);
88 const SkPoint& end, SkScalar endRadius,
89 const SkColor colors[],
const SkScalar pos[],
91 uint32_t flags,
const SkMatrix* localMatrix);
93 const SkPoint& end, SkScalar endRadius,
94 const SkColor colors[],
const SkScalar pos[],
96 return MakeTwoPointConical(start, startRadius, end, endRadius, colors, pos, count, mode,
116 const SkColor colors[],
const SkScalar pos[],
int count,
117 uint32_t flags,
const SkMatrix* localMatrix);
119 const SkColor colors[],
const SkScalar pos[],
int count) {
120 return MakeSweep(cx, cy, colors, pos, count, 0, NULL);
123 #ifdef SK_SUPPORT_LEGACY_CREATESHADER_PTR
125 const SkColor colors[],
const SkScalar pos[],
int count,
127 uint32_t flags,
const SkMatrix* localMatrix) {
128 return MakeLinear(pts, colors, pos, count, mode, flags, localMatrix).release();
131 const SkColor colors[],
const SkScalar pos[],
int count,
133 return CreateLinear(pts, colors, pos, count, mode, 0, NULL);
137 const SkColor colors[],
const SkScalar pos[],
int count,
139 uint32_t flags,
const SkMatrix* localMatrix) {
140 return MakeRadial(center, radius, colors, pos, count, mode, flags, localMatrix).release();
144 const SkColor colors[],
const SkScalar pos[],
int count,
146 return CreateRadial(center, radius, colors, pos, count, mode, 0, NULL);
149 static SkShader* CreateTwoPointConical(
const SkPoint& start, SkScalar startRadius,
150 const SkPoint& end, SkScalar endRadius,
151 const SkColor colors[],
const SkScalar pos[],
int count,
153 uint32_t flags,
const SkMatrix* localMatrix) {
154 return MakeTwoPointConical(start, startRadius, end, endRadius, colors, pos, count, mode,
155 flags, localMatrix).release();
157 static SkShader* CreateTwoPointConical(
const SkPoint& start, SkScalar startRadius,
158 const SkPoint& end, SkScalar endRadius,
159 const SkColor colors[],
const SkScalar pos[],
int count,
161 return CreateTwoPointConical(start, startRadius, end, endRadius, colors, pos, count, mode,
165 static SkShader* CreateSweep(SkScalar cx, SkScalar cy,
166 const SkColor colors[],
const SkScalar pos[],
int count,
167 uint32_t flags,
const SkMatrix* localMatrix) {
168 return MakeSweep(cx, cy, colors, pos, count, flags, localMatrix).release();
170 static SkShader* CreateSweep(SkScalar cx, SkScalar cy,
171 const SkColor colors[],
const SkScalar pos[],
int count) {
172 return CreateSweep(cx, cy, colors, pos, count, 0, NULL);
177 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
Shaders specify the source color(s) for what is being drawn.
Definition: SkShader.h:38
Definition: SkPoint.h:156
The SkMatrix class holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:26
Flags
Definition: SkGradientShader.h:20
SkGradientShader hosts factories for creating subclasses of SkShader that render linear and radial gr...
Definition: SkGradientShader.h:18
uint32_t SkColor
32 bit ARGB color value, not premultiplied.
Definition: SkColor.h:28
TileMode
Definition: SkShader.h:51