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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 protected: | 104 protected: |
105 virtual SkString onShortName() SK_OVERRIDE { | 105 virtual SkString onShortName() SK_OVERRIDE { |
106 return fName; | 106 return fName; |
107 } | 107 } |
108 | 108 |
109 virtual SkISize onISize() SK_OVERRIDE { | 109 virtual SkISize onISize() SK_OVERRIDE { |
110 return SkISize::Make(750, 750); | 110 return SkISize::Make(750, 750); |
111 } | 111 } |
112 | 112 |
113 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { | 113 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
114 canvas->scale(SkFloatToScalar(1.5f), SkFloatToScalar(1.5f)); | 114 canvas->scale(1.5f, 1.5f); |
115 | 115 |
116 const int blurRadii[] = { 1, 3, 6, 10 }; | 116 const int blurRadii[] = { 1, 3, 6, 10 }; |
117 const int cornerRadii[] = { 1, 3, 6, 10 }; | 117 const int cornerRadii[] = { 1, 3, 6, 10 }; |
118 const SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100)); | 118 const SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100)); |
119 for (size_t i = 0; i < SK_ARRAY_COUNT(blurRadii); ++i) { | 119 for (size_t i = 0; i < SK_ARRAY_COUNT(blurRadii); ++i) { |
120 SkAutoCanvasRestore autoRestore(canvas, true); | 120 SkAutoCanvasRestore autoRestore(canvas, true); |
121 canvas->translate(0, (r.height() + SkIntToScalar(20)) * i); | 121 canvas->translate(0, (r.height() + SkIntToScalar(20)) * i); |
122 for (size_t j = 0; j < SK_ARRAY_COUNT(cornerRadii); ++j) { | 122 for (size_t j = 0; j < SK_ARRAY_COUNT(cornerRadii); ++j) { |
123 SkMaskFilter* filter = SkBlurMaskFilter::Create( | 123 SkMaskFilter* filter = SkBlurMaskFilter::Create( |
124 SkBlurMaskFilter::kNormal_BlurStyle, | 124 SkBlurMaskFilter::kNormal_BlurStyle, |
(...skipping 20 matching lines...) Expand all Loading... |
145 // TODO(scroggo): Disabled in an attempt to rememdy | 145 // TODO(scroggo): Disabled in an attempt to rememdy |
146 // 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: |
147 // ran wrong number of tests') | 147 // ran wrong number of tests') |
148 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) | 148 //DEF_GM(return new BlurRoundRectGM(600, 5514, 6);) |
149 | 149 |
150 // 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 |
151 // small. | 151 // small. |
152 DEF_GM(return new BlurRoundRectGM(100, 100);) | 152 DEF_GM(return new BlurRoundRectGM(100, 100);) |
153 | 153 |
154 DEF_GM(return new SimpleBlurRoundRectGM();) | 154 DEF_GM(return new SimpleBlurRoundRectGM();) |
OLD | NEW |