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