Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: gm/gradients.cpp

Issue 18552005: Animated the PathUtils Sample to show path contours (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Added function pointers to sample to reduce code in OnDrawContent method. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | gm/nate_gradients.cpp » ('j') | gm/nate_gradients.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkGradientShader.h" 9 #include "SkGradientShader.h"
10 10
11 namespace skiagm { 11 namespace skiagm {
12 12
13 struct GradData { 13 struct GradData {
14 int fCount; 14 int fCount;
15 const SkColor* fColors; 15 const SkColor* fColors;
16 const SkScalar* fPos; 16 const SkScalar* fPos;
17 }; 17 };
18 18
19 static const SkColor gColors[] = { 19 static const SkColor gColors[] = {
20 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK 20 SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorWHITE, SK_ColorBLACK,
21 }; 21 };
22 static const SkScalar gPos0[] = { 0, SK_Scalar1 }; 22 static const SkScalar gPos0[] = { 0, SK_Scalar1 };
23 static const SkScalar gPos1[] = { SK_Scalar1/4, SK_Scalar1*3/4 }; 23 static const SkScalar gPos1[] = { SK_Scalar1/4, SK_Scalar1*3/4 };
24 static const SkScalar gPos2[] = { 24 static const SkScalar gPos2[] = {
25 0, SK_Scalar1/8, SK_Scalar1/2, SK_Scalar1*7/8, SK_Scalar1 25 0, SK_Scalar1/8, SK_Scalar1/2, SK_Scalar1*7/8, SK_Scalar1
26 }; 26 };
27 27
28 static const GradData gGradData[] = { 28 static const GradData gGradData[] = {
29 { 2, gColors, NULL }, 29 { 2, gColors, NULL },
30 { 2, gColors, gPos0 }, 30 { 2, gColors, gPos0 },
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 360
361 static GM* MyFactory4(void*) { return new RadialGradientGM; } 361 static GM* MyFactory4(void*) { return new RadialGradientGM; }
362 static GMRegistry reg4(MyFactory4); 362 static GMRegistry reg4(MyFactory4);
363 363
364 static GM* MyFactory5(void*) { return new GradientsLocalPerspectiveGM; } 364 static GM* MyFactory5(void*) { return new GradientsLocalPerspectiveGM; }
365 static GMRegistry reg5(MyFactory5); 365 static GMRegistry reg5(MyFactory5);
366 366
367 static GM* MyFactory6(void*) { return new GradientsViewPerspectiveGM; } 367 static GM* MyFactory6(void*) { return new GradientsViewPerspectiveGM; }
368 static GMRegistry reg6(MyFactory6); 368 static GMRegistry reg6(MyFactory6);
369 } 369 }
OLDNEW
« no previous file with comments | « no previous file | gm/nate_gradients.cpp » ('j') | gm/nate_gradients.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698