OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 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 | 8 |
9 #include "gm.h" | 9 #include "gm.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 2 * SK_Scalar1 / 6, | 37 2 * SK_Scalar1 / 6, |
38 3 * SK_Scalar1 / 6, | 38 3 * SK_Scalar1 / 6, |
39 4 * SK_Scalar1 / 6, | 39 4 * SK_Scalar1 / 6, |
40 5 * SK_Scalar1 / 6, | 40 5 * SK_Scalar1 / 6, |
41 SK_Scalar1}; | 41 SK_Scalar1}; |
42 | 42 |
43 SkPaint paint; | 43 SkPaint paint; |
44 SkRect rect = SkRect::MakeWH(wScalar, hScalar); | 44 SkRect rect = SkRect::MakeWH(wScalar, hScalar); |
45 SkMatrix mat = SkMatrix::I(); | 45 SkMatrix mat = SkMatrix::I(); |
46 for (int i = 0; i < 4; ++i) { | 46 for (int i = 0; i < 4; ++i) { |
47 paint.setShader(SkGradientShader::CreateRadial( | 47 paint.setShader(SkGradientShader::MakeRadial( |
48 pt, radius, | 48 pt, radius, |
49 colors, pos, | 49 colors, pos, |
50 SK_ARRAY_COUNT(colors), | 50 SK_ARRAY_COUNT(colors), |
51 SkShader::kRepeat_TileMode, | 51 SkShader::kRepeat_TileMode, |
52 0, &mat))->unref(); | 52 0, &mat)); |
53 canvas.drawRect(rect, paint); | 53 canvas.drawRect(rect, paint); |
54 rect.inset(wScalar / 8, hScalar / 8); | 54 rect.inset(wScalar / 8, hScalar / 8); |
55 mat.preTranslate(6 * wScalar, 6 * hScalar); | 55 mat.preTranslate(6 * wScalar, 6 * hScalar); |
56 mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3); | 56 mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3); |
57 } | 57 } |
58 | 58 |
59 paint.setAntiAlias(true); | 59 paint.setAntiAlias(true); |
60 sk_tool_utils::set_portable_typeface(&paint); | 60 sk_tool_utils::set_portable_typeface(&paint); |
61 paint.setTextSize(wScalar / 2.2f); | 61 paint.setTextSize(wScalar / 2.2f); |
62 paint.setShader(0); | 62 paint.setShader(0); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 293 |
294 typedef SkTLList<Clip, 1> ClipList; | 294 typedef SkTLList<Clip, 1> ClipList; |
295 ClipList fClips; | 295 ClipList fClips; |
296 SkBitmap fBmp; | 296 SkBitmap fBmp; |
297 | 297 |
298 typedef GM INHERITED; | 298 typedef GM INHERITED; |
299 }; | 299 }; |
300 | 300 |
301 DEF_GM(return new ConvexPolyClip;) | 301 DEF_GM(return new ConvexPolyClip;) |
302 } | 302 } |
OLD | NEW |