OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SkBlurDrawLooper.h" | 9 #include "SkBlurDrawLooper.h" |
10 #include "SkBlurMask.h" | 10 #include "SkBlurMask.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 SkPaint p; | 43 SkPaint p; |
44 canvas.drawRect(SkRect::MakeXYWH(10, 0, 10, 10), p); | 44 canvas.drawRect(SkRect::MakeXYWH(10, 0, 10, 10), p); |
45 canvas.drawRect(SkRect::MakeXYWH(0, 10, 10, 10), p); | 45 canvas.drawRect(SkRect::MakeXYWH(0, 10, 10, 10), p); |
46 } | 46 } |
47 | 47 |
48 SkString onShortName() override { | 48 SkString onShortName() override { |
49 return SkString("shadows"); | 49 return SkString("shadows"); |
50 } | 50 } |
51 | 51 |
52 SkISize onISize() override { | 52 SkISize onISize() override { |
53 return SkISize::Make(200, 120); | 53 return SkISize::Make(200, 200); |
54 } | 54 } |
55 | 55 |
56 void onDraw(SkCanvas* canvas) override { | 56 void onDraw(SkCanvas* canvas) override { |
57 SkBlurDrawLooper* shadowLoopers[5]; | 57 SkBlurDrawLooper* shadowLoopers[5]; |
58 shadowLoopers[0] = | 58 shadowLoopers[0] = |
59 SkBlurDrawLooper::Create(SK_ColorBLUE, | 59 SkBlurDrawLooper::Create(SK_ColorBLUE, |
60 SkBlurMask::ConvertRadiusToSigma(SkIntToSca
lar(10)), | 60 SkBlurMask::ConvertRadiusToSigma(SkIntToSca
lar(10)), |
61 SkIntToScalar(5), SkIntToScalar(10), | 61 SkIntToScalar(5), SkIntToScalar(10), |
62 SkBlurDrawLooper::kIgnoreTransform_BlurFlag
| | 62 SkBlurDrawLooper::kIgnoreTransform_BlurFlag
| |
63 SkBlurDrawLooper::kOverrideColor_BlurFlag | | 63 SkBlurDrawLooper::kOverrideColor_BlurFlag | |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 private: | 143 private: |
144 typedef GM INHERITED; | 144 typedef GM INHERITED; |
145 }; | 145 }; |
146 | 146 |
147 /////////////////////////////////////////////////////////////////////////////// | 147 /////////////////////////////////////////////////////////////////////////////// |
148 | 148 |
149 static GM* MyFactory(void*) { return new ShadowsGM; } | 149 static GM* MyFactory(void*) { return new ShadowsGM; } |
150 static GMRegistry reg(MyFactory); | 150 static GMRegistry reg(MyFactory); |
151 | 151 |
152 } | 152 } |
OLD | NEW |