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 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 width, height); | 36 width, height); |
37 SkVector radii[4]; | 37 SkVector radii[4]; |
38 radii[0].set(SkIntToScalar(30), SkIntToScalar(30)); | 38 radii[0].set(SkIntToScalar(30), SkIntToScalar(30)); |
39 radii[1].set(SkIntToScalar(10), SkIntToScalar(10)); | 39 radii[1].set(SkIntToScalar(10), SkIntToScalar(10)); |
40 radii[2].set(SkIntToScalar(30), SkIntToScalar(30)); | 40 radii[2].set(SkIntToScalar(30), SkIntToScalar(30)); |
41 radii[3].set(SkIntToScalar(10), SkIntToScalar(10)); | 41 radii[3].set(SkIntToScalar(10), SkIntToScalar(10)); |
42 SkRect r = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height)); | 42 SkRect r = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height)); |
43 fRRect.setRectRadii(r, radii); | 43 fRRect.setRectRadii(r, radii); |
44 } | 44 } |
45 | 45 |
| 46 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 47 return kSkipTiled_Flag; |
| 48 } |
| 49 |
46 virtual SkString onShortName() SK_OVERRIDE { | 50 virtual SkString onShortName() SK_OVERRIDE { |
47 return fName; | 51 return fName; |
48 } | 52 } |
49 | 53 |
50 virtual SkISize onISize() SK_OVERRIDE { | 54 virtual SkISize onISize() SK_OVERRIDE { |
51 return SkISize::Make(SkScalarCeilToInt(fRRect.rect().width()), | 55 return SkISize::Make(SkScalarCeilToInt(fRRect.rect().width()), |
52 SkScalarCeilToInt(fRRect.rect().height())); | 56 SkScalarCeilToInt(fRRect.rect().height())); |
53 } | 57 } |
54 | 58 |
55 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 59 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 }; | 98 }; |
95 | 99 |
96 // Simpler blurred RR test cases where all the radii are the same. | 100 // Simpler blurred RR test cases where all the radii are the same. |
97 class SimpleBlurRoundRectGM : public skiagm::GM { | 101 class SimpleBlurRoundRectGM : public skiagm::GM { |
98 public: | 102 public: |
99 SimpleBlurRoundRectGM() | 103 SimpleBlurRoundRectGM() |
100 : fName("simpleblurroundrect") { | 104 : fName("simpleblurroundrect") { |
101 } | 105 } |
102 | 106 |
103 protected: | 107 protected: |
| 108 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
| 109 return kSkipTiled_Flag; |
| 110 } |
| 111 |
104 virtual SkString onShortName() SK_OVERRIDE { | 112 virtual SkString onShortName() SK_OVERRIDE { |
105 return fName; | 113 return fName; |
106 } | 114 } |
107 | 115 |
108 virtual SkISize onISize() SK_OVERRIDE { | 116 virtual SkISize onISize() SK_OVERRIDE { |
109 return SkISize::Make(950, 950); | 117 return SkISize::Make(950, 950); |
110 } | 118 } |
111 | 119 |
112 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 120 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
113 canvas->scale(1.5f, 1.5f); | 121 canvas->scale(1.5f, 1.5f); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // TODO(scroggo): Disabled in an attempt to rememdy | 154 // TODO(scroggo): Disabled in an attempt to rememdy |
147 // https://code.google.com/p/skia/issues/detail?id=1801 ('Win7 Test bots all fai
ling GenerateGMs: | 155 // https://code.google.com/p/skia/issues/detail?id=1801 ('Win7 Test bots all fai
ling GenerateGMs: |
148 // ran wrong number of tests') | 156 // ran wrong number of tests') |
149 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) | 157 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) |
150 | 158 |
151 // Rounded rect with two opposite corners with large radii, the other two | 159 // Rounded rect with two opposite corners with large radii, the other two |
152 // small. | 160 // small. |
153 DEF_GM(return new BlurRoundRectGM(100, 100);) | 161 DEF_GM(return new BlurRoundRectGM(100, 100);) |
154 | 162 |
155 DEF_GM(return new SimpleBlurRoundRectGM();) | 163 DEF_GM(return new SimpleBlurRoundRectGM();) |
OLD | NEW |