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 "sk_tool_utils.h" | 10 #include "sk_tool_utils.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 | 77 |
78 void onDrawBackground(SkCanvas* canvas) override { | 78 void onDrawBackground(SkCanvas* canvas) override { |
79 sk_tool_utils::draw_checkerboard(canvas, 0xFFCCCCCC, 0xFFFFFFFF, 12); | 79 sk_tool_utils::draw_checkerboard(canvas, 0xFFCCCCCC, 0xFFFFFFFF, 12); |
80 } | 80 } |
81 | 81 |
82 void onDrawContent(SkCanvas* canvas) override { | 82 void onDrawContent(SkCanvas* canvas) override { |
83 SkPaint paint; | 83 SkPaint paint; |
84 paint.setAntiAlias(true); | 84 paint.setAntiAlias(true); |
85 paint.setTextSize(SkIntToScalar(24)); | 85 paint.setTextSize(SkIntToScalar(24)); |
86 SkAutoTUnref<SkBlurDrawLooper> looper( | 86 SkAutoTUnref<SkDrawLooper> looper( |
87 SkBlurDrawLooper::Create(SK_ColorBLUE, | 87 SkBlurDrawLooper::Create(SK_ColorBLUE, |
88 SkBlurMask::ConvertRadiusToSigma(SkIntToSca
lar(2)), | 88 SkBlurMask::ConvertRadiusToSigma(SkIntToSca
lar(2)), |
89 0, 0)); | 89 0, 0)); |
90 paint.setLooper(looper); | 90 paint.setLooper(looper); |
91 SkScalar height = paint.getFontMetrics(nullptr); | 91 SkScalar height = paint.getFontMetrics(nullptr); |
92 if (!fDecodeSucceeded) { | 92 if (!fDecodeSucceeded) { |
93 SkString failure; | 93 SkString failure; |
94 if (fResPath.size() == 0) { | 94 if (fResPath.size() == 0) { |
95 failure.printf("resource path is required!"); | 95 failure.printf("resource path is required!"); |
96 } else { | 96 } else { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 typedef SampleView INHERITED; | 189 typedef SampleView INHERITED; |
190 }; | 190 }; |
191 | 191 |
192 ////////////////////////////////////////////////////////////////////////////// | 192 ////////////////////////////////////////////////////////////////////////////// |
193 | 193 |
194 static SkView* MyFactory() { | 194 static SkView* MyFactory() { |
195 return new UnpremulView(GetResourcePath()); | 195 return new UnpremulView(GetResourcePath()); |
196 } | 196 } |
197 static SkViewRegister reg(MyFactory); | 197 static SkViewRegister reg(MyFactory); |
OLD | NEW |