blob: 8208d622406993768eaeacf7c17415dfe5fc9450 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
reed@android.com42309d42009-06-22 02:06:35 +00008#include "gm.h"
9#include "SkGradientShader.h"
10
11namespace skiagm {
12
13struct GradData {
14 int fCount;
15 const SkColor* fColors;
16 const SkScalar* fPos;
17};
18
19static const SkColor gColors[] = {
20 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK
21};
22static const SkScalar gPos0[] = { 0, SK_Scalar1 };
23static const SkScalar gPos1[] = { SK_Scalar1/4, SK_Scalar1*3/4 };
24static const SkScalar gPos2[] = {
25 0, SK_Scalar1/8, SK_Scalar1/2, SK_Scalar1*7/8, SK_Scalar1
26};
27
commit-bot@chromium.org8ba1ad32013-08-07 15:22:13 +000028static const SkScalar gPosClamp[] = {0.0f, 0.0f, 1.0f, 1.0f};
29static const SkColor gColorClamp[] = {
30 SK_ColorRED, SK_ColorGREEN, SK_ColorGREEN, SK_ColorBLUE
31};
32
reed@android.com42309d42009-06-22 02:06:35 +000033static const GradData gGradData[] = {
34 { 2, gColors, NULL },
35 { 2, gColors, gPos0 },
36 { 2, gColors, gPos1 },
37 { 5, gColors, NULL },
commit-bot@chromium.org8ba1ad32013-08-07 15:22:13 +000038 { 5, gColors, gPos2 },
39 { 4, gColorClamp, gPosClamp }
reed@android.com42309d42009-06-22 02:06:35 +000040};
41
42static SkShader* MakeLinear(const SkPoint pts[2], const GradData& data,
43 SkShader::TileMode tm, SkUnitMapper* mapper) {
44 return SkGradientShader::CreateLinear(pts, data.fColors, data.fPos,
45 data.fCount, tm, mapper);
46}
reed@google.comf3c1cc92010-12-23 16:45:33 +000047
reed@android.com42309d42009-06-22 02:06:35 +000048static SkShader* MakeRadial(const SkPoint pts[2], const GradData& data,
49 SkShader::TileMode tm, SkUnitMapper* mapper) {
50 SkPoint center;
51 center.set(SkScalarAve(pts[0].fX, pts[1].fX),
52 SkScalarAve(pts[0].fY, pts[1].fY));
53 return SkGradientShader::CreateRadial(center, center.fX, data.fColors,
54 data.fPos, data.fCount, tm, mapper);
55}
56
57static SkShader* MakeSweep(const SkPoint pts[2], const GradData& data,
sugoi@google.com0f0d9b72013-02-27 15:41:12 +000058 SkShader::TileMode, SkUnitMapper* mapper) {
reed@android.com42309d42009-06-22 02:06:35 +000059 SkPoint center;
60 center.set(SkScalarAve(pts[0].fX, pts[1].fX),
61 SkScalarAve(pts[0].fY, pts[1].fY));
62 return SkGradientShader::CreateSweep(center.fX, center.fY, data.fColors,
63 data.fPos, data.fCount, mapper);
64}
65
reed@google.comf3c1cc92010-12-23 16:45:33 +000066static SkShader* Make2Radial(const SkPoint pts[2], const GradData& data,
67 SkShader::TileMode tm, SkUnitMapper* mapper) {
68 SkPoint center0, center1;
69 center0.set(SkScalarAve(pts[0].fX, pts[1].fX),
70 SkScalarAve(pts[0].fY, pts[1].fY));
71 center1.set(SkScalarInterp(pts[0].fX, pts[1].fX, SkIntToScalar(3)/5),
72 SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4));
73 return SkGradientShader::CreateTwoPointRadial(
74 center1, (pts[1].fX - pts[0].fX) / 7,
75 center0, (pts[1].fX - pts[0].fX) / 2,
76 data.fColors, data.fPos, data.fCount, tm, mapper);
77}
78
rileya@google.com5cf2c282012-07-09 14:42:16 +000079static SkShader* Make2Conical(const SkPoint pts[2], const GradData& data,
80 SkShader::TileMode tm, SkUnitMapper* mapper) {
81 SkPoint center0, center1;
82 SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 10);
83 SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3);
84 center0.set(pts[0].fX + radius0, pts[0].fY + radius0);
85 center1.set(pts[1].fX - radius1, pts[1].fY - radius1);
rmistry@google.comd6176b02012-08-23 18:14:13 +000086 return SkGradientShader::CreateTwoPointConical(center1, radius1,
87 center0, radius0,
88 data.fColors, data.fPos,
rileya@google.com5cf2c282012-07-09 14:42:16 +000089 data.fCount, tm, mapper);
90}
91
reed@android.com42309d42009-06-22 02:06:35 +000092typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data,
reed@google.comf3c1cc92010-12-23 16:45:33 +000093 SkShader::TileMode tm, SkUnitMapper* mapper);
reed@android.com42309d42009-06-22 02:06:35 +000094static const GradMaker gGradMakers[] = {
rileya@google.com5cf2c282012-07-09 14:42:16 +000095 MakeLinear, MakeRadial, MakeSweep, Make2Radial, Make2Conical
reed@android.com42309d42009-06-22 02:06:35 +000096};
97
98///////////////////////////////////////////////////////////////////////////////
99
100class GradientsGM : public GM {
101public:
rmistry@google.comd6176b02012-08-23 18:14:13 +0000102 GradientsGM() {
bsalomon@google.com48dd1a22011-10-31 14:18:20 +0000103 this->setBGColor(0xFFDDDDDD);
104 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000105
reed@android.com42309d42009-06-22 02:06:35 +0000106protected:
107 SkString onShortName() {
108 return SkString("gradients");
109 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000110
edisonn@google.com1da3a802013-09-19 17:55:49 +0000111 virtual SkISize onISize() { return SkISize::Make(840, 815); }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000112
reed@android.com42309d42009-06-22 02:06:35 +0000113 virtual void onDraw(SkCanvas* canvas) {
rmistry@google.comd6176b02012-08-23 18:14:13 +0000114
reed@android.com42309d42009-06-22 02:06:35 +0000115 SkPoint pts[2] = {
116 { 0, 0 },
117 { SkIntToScalar(100), SkIntToScalar(100) }
118 };
119 SkShader::TileMode tm = SkShader::kClamp_TileMode;
120 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(100) };
121 SkPaint paint;
122 paint.setAntiAlias(true);
rmistry@google.comd6176b02012-08-23 18:14:13 +0000123
reed@android.com42309d42009-06-22 02:06:35 +0000124 canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
125 for (size_t i = 0; i < SK_ARRAY_COUNT(gGradData); i++) {
126 canvas->save();
127 for (size_t j = 0; j < SK_ARRAY_COUNT(gGradMakers); j++) {
128 SkShader* shader = gGradMakers[j](pts, gGradData[i], tm, NULL);
commit-bot@chromium.org8ba1ad32013-08-07 15:22:13 +0000129
130 if (i == 5) { // if the clamp case
131 SkMatrix scale;
132 scale.setScale(0.5f, 0.5f);
133 scale.postTranslate(25.f, 25.f);
134 shader->setLocalMatrix(scale);
135 }
skia.committer@gmail.comd55e3572013-08-08 07:01:20 +0000136
reed@android.com42309d42009-06-22 02:06:35 +0000137 paint.setShader(shader);
138 canvas->drawRect(r, paint);
139 shader->unref();
140 canvas->translate(0, SkIntToScalar(120));
141 }
142 canvas->restore();
143 canvas->translate(SkIntToScalar(120), 0);
144 }
145 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000146
reed@android.com42309d42009-06-22 02:06:35 +0000147private:
148 typedef GM INHERITED;
149};
150
rileya@google.com5cf2c282012-07-09 14:42:16 +0000151// Based on the original gradient slide, but with perspective applied to the
152// gradient shaders' local matrices
153class GradientsLocalPerspectiveGM : public GM {
154public:
rmistry@google.comd6176b02012-08-23 18:14:13 +0000155 GradientsLocalPerspectiveGM() {
rileya@google.com5cf2c282012-07-09 14:42:16 +0000156 this->setBGColor(0xFFDDDDDD);
157 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000158
rileya@google.com5cf2c282012-07-09 14:42:16 +0000159protected:
160 SkString onShortName() {
161 return SkString("gradients_local_perspective");
162 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000163
edisonn@google.com1da3a802013-09-19 17:55:49 +0000164 virtual SkISize onISize() { return SkISize::Make(840, 815); }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000165
rileya@google.com5cf2c282012-07-09 14:42:16 +0000166 virtual void onDraw(SkCanvas* canvas) {
rmistry@google.comd6176b02012-08-23 18:14:13 +0000167
rileya@google.com5cf2c282012-07-09 14:42:16 +0000168 SkPoint pts[2] = {
169 { 0, 0 },
170 { SkIntToScalar(100), SkIntToScalar(100) }
171 };
172 SkShader::TileMode tm = SkShader::kClamp_TileMode;
173 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(100) };
174 SkPaint paint;
175 paint.setAntiAlias(true);
rmistry@google.comd6176b02012-08-23 18:14:13 +0000176
rileya@google.com5cf2c282012-07-09 14:42:16 +0000177 canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
178 for (size_t i = 0; i < SK_ARRAY_COUNT(gGradData); i++) {
179 canvas->save();
180 for (size_t j = 0; j < SK_ARRAY_COUNT(gGradMakers); j++) {
181 SkShader* shader = gGradMakers[j](pts, gGradData[i], tm, NULL);
rmistry@google.comd6176b02012-08-23 18:14:13 +0000182
rileya@google.com5cf2c282012-07-09 14:42:16 +0000183 // apply an increasing y perspective as we move to the right
184 SkMatrix perspective;
185 perspective.setIdentity();
borenet@google.comb7961192012-08-20 18:58:26 +0000186 perspective.setPerspY(SkScalarDiv(SkIntToScalar((unsigned) i+1),
rileya@google.com5cf2c282012-07-09 14:42:16 +0000187 SkIntToScalar(500)));
borenet@google.comb7961192012-08-20 18:58:26 +0000188 perspective.setSkewX(SkScalarDiv(SkIntToScalar((unsigned) i+1),
rileya@google.com5cf2c282012-07-09 14:42:16 +0000189 SkIntToScalar(10)));
commit-bot@chromium.org8ba1ad32013-08-07 15:22:13 +0000190
rileya@google.com5cf2c282012-07-09 14:42:16 +0000191 shader->setLocalMatrix(perspective);
192
193 paint.setShader(shader);
194 canvas->drawRect(r, paint);
195 shader->unref();
196 canvas->translate(0, SkIntToScalar(120));
197 }
198 canvas->restore();
199 canvas->translate(SkIntToScalar(120), 0);
200 }
201 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000202
rileya@google.com5cf2c282012-07-09 14:42:16 +0000203private:
204 typedef GM INHERITED;
205};
206
207// Based on the original gradient slide, but with perspective applied to
208// the view matrix
209class GradientsViewPerspectiveGM : public GradientsGM {
210protected:
211 SkString onShortName() {
212 return SkString("gradients_view_perspective");
213 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000214
edisonn@google.com1da3a802013-09-19 17:55:49 +0000215 virtual SkISize onISize() { return SkISize::Make(840, 500); }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000216
rileya@google.com5cf2c282012-07-09 14:42:16 +0000217 virtual void onDraw(SkCanvas* canvas) {
218 SkMatrix perspective;
219 perspective.setIdentity();
220 perspective.setPerspY(SkScalarDiv(SK_Scalar1, SkIntToScalar(1000)));
221 perspective.setSkewX(SkScalarDiv(SkIntToScalar(8), SkIntToScalar(25)));
scroggo@google.com837d31a2012-08-15 18:42:45 +0000222 canvas->concat(perspective);
rileya@google.com5cf2c282012-07-09 14:42:16 +0000223 INHERITED::onDraw(canvas);
224 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000225
rileya@google.com5cf2c282012-07-09 14:42:16 +0000226private:
227 typedef GradientsGM INHERITED;
228};
229
reed@google.comac864a92011-06-27 18:11:17 +0000230/*
231 Inspired by this <canvas> javascript, where we need to detect that we are not
232 solving a quadratic equation, but must instead solve a linear (since our X^2
233 coefficient is 0)
234
235 ctx.fillStyle = '#f00';
236 ctx.fillRect(0, 0, 100, 50);
rmistry@google.comd6176b02012-08-23 18:14:13 +0000237
reed@google.comac864a92011-06-27 18:11:17 +0000238 var g = ctx.createRadialGradient(-80, 25, 70, 0, 25, 150);
239 g.addColorStop(0, '#f00');
240 g.addColorStop(0.01, '#0f0');
241 g.addColorStop(0.99, '#0f0');
242 g.addColorStop(1, '#f00');
243 ctx.fillStyle = g;
244 ctx.fillRect(0, 0, 100, 50);
245 */
246class GradientsDegenrate2PointGM : public GM {
247public:
248 GradientsDegenrate2PointGM() {}
rmistry@google.comd6176b02012-08-23 18:14:13 +0000249
reed@google.comac864a92011-06-27 18:11:17 +0000250protected:
251 SkString onShortName() {
252 return SkString("gradients_degenerate_2pt");
253 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000254
edisonn@google.com1da3a802013-09-19 17:55:49 +0000255 virtual SkISize onISize() { return SkISize::Make(320, 320); }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000256
reed@google.comac864a92011-06-27 18:11:17 +0000257 void drawBG(SkCanvas* canvas) {
258 canvas->drawColor(SK_ColorBLUE);
259 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000260
reed@google.comac864a92011-06-27 18:11:17 +0000261 virtual void onDraw(SkCanvas* canvas) {
262 this->drawBG(canvas);
rmistry@google.comd6176b02012-08-23 18:14:13 +0000263
reed@google.comac864a92011-06-27 18:11:17 +0000264 SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorGREEN, SK_ColorRED };
265 SkScalar pos[] = { 0, SkFloatToScalar(0.01f), SkFloatToScalar(0.99f), SK_Scalar1 };
epoger@google.com59f3abf2011-07-21 15:50:33 +0000266 SkPoint c0;
267 c0.iset(-80, 25);
268 SkScalar r0 = SkIntToScalar(70);
269 SkPoint c1;
270 c1.iset(0, 25);
271 SkScalar r1 = SkIntToScalar(150);
reed@google.comac864a92011-06-27 18:11:17 +0000272 SkShader* s = SkGradientShader::CreateTwoPointRadial(c0, r0, c1, r1, colors,
273 pos, SK_ARRAY_COUNT(pos),
274 SkShader::kClamp_TileMode);
275 SkPaint paint;
276 paint.setShader(s)->unref();
277 canvas->drawPaint(paint);
278 }
rmistry@google.comd6176b02012-08-23 18:14:13 +0000279
reed@google.comac864a92011-06-27 18:11:17 +0000280private:
281 typedef GM INHERITED;
282};
283
tomhudson@google.com5ea050f2011-09-26 15:03:55 +0000284/// Tests correctness of *optimized* codepaths in gradients.
285
286class ClampedGradientsGM : public GM {
287public:
288 ClampedGradientsGM() {}
289
290protected:
291 SkString onShortName() { return SkString("clamped_gradients"); }
292
edisonn@google.com1da3a802013-09-19 17:55:49 +0000293 virtual SkISize onISize() { return SkISize::Make(640, 510); }
tomhudson@google.com5ea050f2011-09-26 15:03:55 +0000294
295 void drawBG(SkCanvas* canvas) {
296 canvas->drawColor(0xFFDDDDDD);
297 }
298
299 virtual void onDraw(SkCanvas* canvas) {
300 this->drawBG(canvas);
301
302 SkRect r = { 0, 0, SkIntToScalar(100), SkIntToScalar(300) };
303 SkPaint paint;
304 paint.setAntiAlias(true);
305
306 SkPoint center;
307 center.iset(0, 300);
308 canvas->translate(SkIntToScalar(20), SkIntToScalar(20));
309 SkShader* shader = SkGradientShader::CreateRadial(
310 SkPoint(center),
bungeman@google.com01744a42011-10-06 19:37:39 +0000311 SkIntToScalar(200), gColors, NULL, 5,
tomhudson@google.com5ea050f2011-09-26 15:03:55 +0000312 SkShader::kClamp_TileMode, NULL);
313 paint.setShader(shader);
314 canvas->drawRect(r, paint);
315 shader->unref();
316 }
317
318private:
319 typedef GM INHERITED;
320};
321
tomhudson@google.comb18e58c2012-01-30 20:00:13 +0000322/// Checks quality of large radial gradients, which may display
323/// some banding.
324
325class RadialGradientGM : public GM {
326public:
327 RadialGradientGM() {}
328
329protected:
330 SkString onShortName() { return SkString("radial_gradient"); }
edisonn@google.com1da3a802013-09-19 17:55:49 +0000331 virtual SkISize onISize() { return SkISize::Make(1280, 1280); }
tomhudson@google.comb18e58c2012-01-30 20:00:13 +0000332 void drawBG(SkCanvas* canvas) {
333 canvas->drawColor(0xFF000000);
334 }
335 virtual void onDraw(SkCanvas* canvas) {
reed@google.combb0948f2012-01-31 14:44:13 +0000336 const SkISize dim = this->getISize();
337
tomhudson@google.comb18e58c2012-01-30 20:00:13 +0000338 this->drawBG(canvas);
rmistry@google.comd6176b02012-08-23 18:14:13 +0000339
tomhudson@google.comb18e58c2012-01-30 20:00:13 +0000340 SkPaint paint;
341 paint.setDither(true);
342 SkPoint center;
reed@google.combb0948f2012-01-31 14:44:13 +0000343 center.set(SkIntToScalar(dim.width())/2, SkIntToScalar(dim.height())/2);
344 SkScalar radius = SkIntToScalar(dim.width())/2;
345 const SkColor colors[] = { 0x7f7f7f7f, 0x7f7f7f7f, 0xb2000000 };
robertphillips@google.com09042b82012-04-06 20:01:46 +0000346 const SkScalar pos[] = { SkFloatToScalar(0.0f),
347 SkFloatToScalar(0.35f),
348 SkFloatToScalar(1.0f) };
tomhudson@google.comb18e58c2012-01-30 20:00:13 +0000349 SkShader* shader =
350 SkGradientShader::CreateRadial(center, radius, colors,
reed@google.combb0948f2012-01-31 14:44:13 +0000351 pos, SK_ARRAY_COUNT(pos),
352 SkShader::kClamp_TileMode);
tomhudson@google.comb18e58c2012-01-30 20:00:13 +0000353 paint.setShader(shader)->unref();
reed@google.combb0948f2012-01-31 14:44:13 +0000354 SkRect r = {
355 0, 0, SkIntToScalar(dim.width()), SkIntToScalar(dim.height())
356 };
tomhudson@google.comb18e58c2012-01-30 20:00:13 +0000357 canvas->drawRect(r, paint);
358 }
359private:
360 typedef GM INHERITED;
361};
362
363
mtklein@google.com361a72f2013-08-19 18:43:34 +0000364class RadialGradient2GM : public GM {
365public:
366 RadialGradient2GM() {}
367
368protected:
369 SkString onShortName() { return SkString("radial_gradient2"); }
edisonn@google.com1da3a802013-09-19 17:55:49 +0000370 virtual SkISize onISize() { return SkISize::Make(800, 400); }
mtklein@google.com361a72f2013-08-19 18:43:34 +0000371 void drawBG(SkCanvas* canvas) {
372 canvas->drawColor(0xFF000000);
373 }
374
375 // Reproduces the example given in bug 7671058.
376 virtual void onDraw(SkCanvas* canvas) {
377 SkPaint paint1, paint2, paint3;
378 paint1.setStyle(SkPaint::kFill_Style);
379 paint2.setStyle(SkPaint::kFill_Style);
380 paint3.setStyle(SkPaint::kFill_Style);
381
382 const SkColor sweep_colors[] =
383 { 0xFFFF0000, 0xFFFFFF00, 0xFF00FF00, 0xFF00FFFF, 0xFF0000FF, 0xFFFF00FF, 0xFFFF0000 };
384 const SkColor colors1[] = { 0xFFFFFFFF, 0x00000000 };
385 const SkColor colors2[] = { 0xFF000000, 0x00000000 };
386
387 const SkScalar cx = 200, cy = 200, radius = 150;
388 SkPoint center;
389 center.set(cx, cy);
390
mtklein@google.com3ef7eea2013-09-16 13:02:52 +0000391 // We can either interpolate endpoints and premultiply each point (default, more precision),
392 // or premultiply the endpoints first, avoiding the need to premultiply each point (cheap).
393 const uint32_t flags[] = { 0, SkGradientShader::kInterpolateColorsInPremul_Flag };
mtklein@google.com361a72f2013-08-19 18:43:34 +0000394
mtklein@google.com3ef7eea2013-09-16 13:02:52 +0000395 for (size_t i = 0; i < SK_ARRAY_COUNT(flags); i++) {
396 SkAutoTUnref<SkShader> sweep(
397 SkGradientShader::CreateSweep(cx, cy, sweep_colors,
398 NULL, SK_ARRAY_COUNT(sweep_colors),
399 NULL, flags[i]));
400 SkAutoTUnref<SkShader> radial1(
401 SkGradientShader::CreateRadial(center, radius, colors1,
402 NULL, SK_ARRAY_COUNT(colors1),
403 SkShader::kClamp_TileMode,
404 NULL, flags[i]));
405 SkAutoTUnref<SkShader> radial2(
406 SkGradientShader::CreateRadial(center, radius, colors2,
407 NULL, SK_ARRAY_COUNT(colors2),
408 SkShader::kClamp_TileMode,
409 NULL, flags[i]));
410 paint1.setShader(sweep);
411 paint2.setShader(radial1);
412 paint3.setShader(radial2);
413
414 canvas->drawCircle(cx, cy, radius, paint1);
415 canvas->drawCircle(cx, cy, radius, paint3);
416 canvas->drawCircle(cx, cy, radius, paint2);
417
418 canvas->translate(400, 0);
419 }
mtklein@google.com361a72f2013-08-19 18:43:34 +0000420 }
421
422private:
423 typedef GM INHERITED;
424};
tomhudson@google.com5ea050f2011-09-26 15:03:55 +0000425
reed@android.com42309d42009-06-22 02:06:35 +0000426///////////////////////////////////////////////////////////////////////////////
427
428static GM* MyFactory(void*) { return new GradientsGM; }
429static GMRegistry reg(MyFactory);
430
reed@google.comac864a92011-06-27 18:11:17 +0000431static GM* MyFactory2(void*) { return new GradientsDegenrate2PointGM; }
432static GMRegistry reg2(MyFactory2);
433
tomhudson@google.com5ea050f2011-09-26 15:03:55 +0000434static GM* MyFactory3(void*) { return new ClampedGradientsGM; }
435static GMRegistry reg3(MyFactory3);
436
tomhudson@google.comb18e58c2012-01-30 20:00:13 +0000437static GM* MyFactory4(void*) { return new RadialGradientGM; }
438static GMRegistry reg4(MyFactory4);
rileya@google.com5cf2c282012-07-09 14:42:16 +0000439
440static GM* MyFactory5(void*) { return new GradientsLocalPerspectiveGM; }
441static GMRegistry reg5(MyFactory5);
442
443static GM* MyFactory6(void*) { return new GradientsViewPerspectiveGM; }
444static GMRegistry reg6(MyFactory6);
mtklein@google.com361a72f2013-08-19 18:43:34 +0000445
446static GM* MyFactory7(void*) { return new RadialGradient2GM; }
447static GMRegistry reg7(MyFactory7);
reed@android.com42309d42009-06-22 02:06:35 +0000448}