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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 SkPaint paint; | 40 SkPaint paint; |
41 SkRect rect = SkRect::MakeWH(wScalar, hScalar); | 41 SkRect rect = SkRect::MakeWH(wScalar, hScalar); |
42 SkMatrix mat = SkMatrix::I(); | 42 SkMatrix mat = SkMatrix::I(); |
43 for (int i = 0; i < 4; ++i) { | 43 for (int i = 0; i < 4; ++i) { |
44 paint.setShader(SkGradientShader::CreateRadial( | 44 paint.setShader(SkGradientShader::CreateRadial( |
45 pt, radius, | 45 pt, radius, |
46 colors, pos, | 46 colors, pos, |
47 SK_ARRAY_COUNT(colors), | 47 SK_ARRAY_COUNT(colors), |
48 SkShader::kRepeat_TileMode, | 48 SkShader::kRepeat_TileMode, |
49 NULL, 0, &mat))->unref(); | 49 0, &mat))->unref(); |
50 canvas.drawRect(rect, paint); | 50 canvas.drawRect(rect, paint); |
51 rect.inset(wScalar / 8, hScalar / 8); | 51 rect.inset(wScalar / 8, hScalar / 8); |
52 mat.preTranslate(6 * wScalar, 6 * hScalar); | 52 mat.preTranslate(6 * wScalar, 6 * hScalar); |
53 mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3); | 53 mat.postScale(SK_Scalar1 / 3, SK_Scalar1 / 3); |
54 } | 54 } |
55 | 55 |
56 paint.setAntiAlias(true); | 56 paint.setAntiAlias(true); |
57 paint.setTextSize(wScalar / 2.2f); | 57 paint.setTextSize(wScalar / 2.2f); |
58 paint.setShader(0); | 58 paint.setShader(0); |
59 paint.setColor(SK_ColorLTGRAY); | 59 paint.setColor(SK_ColorLTGRAY); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 SkTLList<Clip> fClips; | 293 SkTLList<Clip> fClips; |
294 SkBitmap fBmp; | 294 SkBitmap fBmp; |
295 | 295 |
296 typedef GM INHERITED; | 296 typedef GM INHERITED; |
297 }; | 297 }; |
298 | 298 |
299 DEF_GM( return SkNEW(ConvexPolyClip); ) | 299 DEF_GM( return SkNEW(ConvexPolyClip); ) |
300 | 300 |
301 } | 301 } |
OLD | NEW |