OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkColorShader.h" | 10 #include "SkColorShader.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 SkBitmap bm; | 27 SkBitmap bm; |
28 bm.allocN32Pixels(2000, 1); | 28 bm.allocN32Pixels(2000, 1); |
29 SkCanvas c(bm); | 29 SkCanvas c(bm); |
30 | 30 |
31 const SkScalar affine[] = { | 31 const SkScalar affine[] = { |
32 1.06608627e-06f, 4.26434525e-07f, 6.2855f, 2.6611f, 273.4393f, 244.0046f | 32 1.06608627e-06f, 4.26434525e-07f, 6.2855f, 2.6611f, 273.4393f, 244.0046f |
33 }; | 33 }; |
34 SkMatrix matrix; | 34 SkMatrix matrix; |
35 matrix.setAffine(affine); | 35 matrix.setAffine(affine); |
36 c.concat(matrix); | 36 c.concat(matrix); |
37 | 37 |
38 c.drawPaint(paint); | 38 c.drawPaint(paint); |
39 } | 39 } |
40 | 40 |
41 struct GradRec { | 41 struct GradRec { |
42 int fColorCount; | 42 int fColorCount; |
43 const SkColor* fColors; | 43 const SkColor* fColors; |
44 const SkScalar* fPos; | 44 const SkScalar* fPos; |
45 const SkPoint* fPoint; // 2 | 45 const SkPoint* fPoint; // 2 |
46 const SkScalar* fRadius; // 2 | 46 const SkScalar* fRadius; // 2 |
47 SkShader::TileMode fTileMode; | 47 SkShader::TileMode fTileMode; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 | 236 |
237 DEF_TEST(Gradient, reporter) { | 237 DEF_TEST(Gradient, reporter) { |
238 TestGradientShaders(reporter); | 238 TestGradientShaders(reporter); |
239 TestConstantGradient(reporter); | 239 TestConstantGradient(reporter); |
240 test_big_grad(reporter); | 240 test_big_grad(reporter); |
241 test_nearly_vertical(reporter); | 241 test_nearly_vertical(reporter); |
242 test_linear_fuzz(reporter); | 242 test_linear_fuzz(reporter); |
243 test_two_point_conical_zero_radius(reporter); | 243 test_two_point_conical_zero_radius(reporter); |
244 } | 244 } |
OLD | NEW |