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" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 SK_ColorCYAN, SK_ColorMAGENTA, SK_ColorYELLOW, | 90 SK_ColorCYAN, SK_ColorMAGENTA, SK_ColorYELLOW, |
91 }; | 91 }; |
92 return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(col
ors), | 92 return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(col
ors), |
93 SkShader::kClamp_TileMode); | 93 SkShader::kClamp_TileMode); |
94 } | 94 } |
95 | 95 |
96 static void color_filter(SkPaint* paint) { | 96 static void color_filter(SkPaint* paint) { |
97 SkRect r; | 97 SkRect r; |
98 r.setWH(SkIntToScalar(kWidth), 50); | 98 r.setWH(SkIntToScalar(kWidth), 50); |
99 paint->setShader(make_shader(r)); | 99 paint->setShader(make_shader(r)); |
100 paint->setColorFilter(SkColorMatrixFilter::CreateLightingFilter(0xF0F0F0, 0)
)->unref(); | 100 paint->setColorFilter(SkColorMatrixFilter::MakeLightingFilter(0xF0F0F0, 0)); |
101 } | 101 } |
102 | 102 |
103 static void kitchen_sink(SkPaint* paint) { | 103 static void kitchen_sink(SkPaint* paint) { |
104 color_filter(paint); | 104 color_filter(paint); |
105 path_effect(paint); | 105 path_effect(paint); |
106 mask_filter(paint); | 106 mask_filter(paint); |
107 | 107 |
108 } | 108 } |
109 | 109 |
110 static sk_sp<SkDrawLooper> setupLooper(SkLayerDrawLooper::BitFlags bits, | 110 static sk_sp<SkDrawLooper> setupLooper(SkLayerDrawLooper::BitFlags bits, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 SkAutoTUnref<const SkTextBlob> fBlob; | 249 SkAutoTUnref<const SkTextBlob> fBlob; |
250 SkTArray<sk_sp<SkDrawLooper>, true> fLoopers; | 250 SkTArray<sk_sp<SkDrawLooper>, true> fLoopers; |
251 | 251 |
252 typedef GM INHERITED; | 252 typedef GM INHERITED; |
253 }; | 253 }; |
254 | 254 |
255 ////////////////////////////////////////////////////////////////////////////// | 255 ////////////////////////////////////////////////////////////////////////////// |
256 | 256 |
257 DEF_GM(return new TextBlobLooperGM;) | 257 DEF_GM(return new TextBlobLooperGM;) |
258 } | 258 } |
OLD | NEW |