OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 #include "Sk2DPathEffect.h" | 10 #include "Sk2DPathEffect.h" |
11 #include "SkBlurMask.h" | 11 #include "SkBlurMask.h" |
12 #include "SkBlurMaskFilter.h" | 12 #include "SkBlurMaskFilter.h" |
13 #include "SkColorFilter.h" | 13 #include "SkColorMatrixFilter.h" |
14 #include "SkCanvas.h" | 14 #include "SkCanvas.h" |
15 #include "SkGradientShader.h" | 15 #include "SkGradientShader.h" |
16 #include "SkGraphics.h" | 16 #include "SkGraphics.h" |
17 #include "SkLayerDrawLooper.h" | 17 #include "SkLayerDrawLooper.h" |
18 #include "SkRandom.h" | 18 #include "SkRandom.h" |
19 #include "SkTextBlob.h" | 19 #include "SkTextBlob.h" |
20 | 20 |
21 namespace skiagm { | 21 namespace skiagm { |
22 | 22 |
23 static const int kWidth = 1250; | 23 static const int kWidth = 1250; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 }; | 91 }; |
92 return SkGradientShader::CreateLinear(pts, | 92 return SkGradientShader::CreateLinear(pts, |
93 colors, nullptr, SK_ARRAY_COUNT(colors
), | 93 colors, nullptr, SK_ARRAY_COUNT(colors
), |
94 SkShader::kClamp_TileMode); | 94 SkShader::kClamp_TileMode); |
95 } | 95 } |
96 | 96 |
97 static void color_filter(SkPaint* paint) { | 97 static void color_filter(SkPaint* paint) { |
98 SkRect r; | 98 SkRect r; |
99 r.setWH(SkIntToScalar(kWidth), 50); | 99 r.setWH(SkIntToScalar(kWidth), 50); |
100 paint->setShader(make_shader(r))->unref(); | 100 paint->setShader(make_shader(r))->unref(); |
101 paint->setColorFilter(SkColorFilter::CreateLightingFilter(0xF0F0F0, 0))->unr
ef(); | 101 paint->setColorFilter(SkColorMatrixFilter::CreateLightingFilter(0xF0F0F0, 0)
)->unref(); |
102 } | 102 } |
103 | 103 |
104 static void kitchen_sink(SkPaint* paint) { | 104 static void kitchen_sink(SkPaint* paint) { |
105 color_filter(paint); | 105 color_filter(paint); |
106 path_effect(paint); | 106 path_effect(paint); |
107 mask_filter(paint); | 107 mask_filter(paint); |
108 | 108 |
109 } | 109 } |
110 | 110 |
111 static SkLayerDrawLooper* setupLooper(SkLayerDrawLooper::BitFlags bits, | 111 static SkLayerDrawLooper* setupLooper(SkLayerDrawLooper::BitFlags bits, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 SkAutoTUnref<const SkTextBlob> fBlob; | 250 SkAutoTUnref<const SkTextBlob> fBlob; |
251 SkTArray<SkAutoTUnref<SkLayerDrawLooper>, true> fLoopers; | 251 SkTArray<SkAutoTUnref<SkLayerDrawLooper>, true> fLoopers; |
252 | 252 |
253 typedef GM INHERITED; | 253 typedef GM INHERITED; |
254 }; | 254 }; |
255 | 255 |
256 ////////////////////////////////////////////////////////////////////////////// | 256 ////////////////////////////////////////////////////////////////////////////// |
257 | 257 |
258 DEF_GM(return new TextBlobLooperGM;) | 258 DEF_GM(return new TextBlobLooperGM;) |
259 } | 259 } |
OLD | NEW |