| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |