OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 | 190 |
191 if (!this->makeMask(&mask, r)) { | 191 if (!this->makeMask(&mask, r)) { |
192 SkPaint paint; | 192 SkPaint paint; |
193 r.offset( SkIntToScalar(center_x), SkIntToScalar(center_y) ); | 193 r.offset( SkIntToScalar(center_x), SkIntToScalar(center_y) ); |
194 canvas->drawRect(r,paint); | 194 canvas->drawRect(r,paint); |
195 return; | 195 return; |
196 } | 196 } |
197 SkAutoMaskFreeImage amfi(mask.fImage); | 197 SkAutoMaskFreeImage amfi(mask.fImage); |
198 | 198 |
199 SkBitmap bm; | 199 SkBitmap bm; |
200 bm.setConfig(SkBitmap::kA8_Config, mask.fBounds.width(), mask.fBounds.he ight()); | 200 bm.installMaskPixels(mask); |
201 bm.setPixels(mask.fImage); | |
202 | 201 |
203 center_x = (canvas_size.fWidth - mask.fBounds.width())/2; | 202 center_x = (canvas_size.fWidth - mask.fBounds.width())/2; |
204 center_y = (canvas_size.fHeight - mask.fBounds.height())/2; | 203 center_y = (canvas_size.fHeight - mask.fBounds.height())/2; |
205 | 204 |
206 canvas->drawBitmap(bm, SkIntToScalar(center_x), SkIntToScalar(center_y), NULL); | 205 canvas->drawBitmap(bm, SkIntToScalar(center_x), SkIntToScalar(center_y), NULL); |
hal.canary
2014/02/17 20:11:31
if that's a SkPicture-backed canvas, it will copty
reed1
2014/02/17 20:33:32
Hmmm, if true, it was this way before this CL, yes
| |
207 } | 206 } |
208 | 207 |
209 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; } | 208 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag; } |
210 | 209 |
211 private: | 210 private: |
212 typedef GM INHERITED; | 211 typedef GM INHERITED; |
213 }; | 212 }; |
214 | 213 |
215 class BlurRectFastGM: public BlurRectCompareGM { | 214 class BlurRectFastGM: public BlurRectCompareGM { |
216 public: | 215 public: |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
376 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_11_simple", 25, 100, 11 );) | 375 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_11_simple", 25, 100, 11 );) |
377 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_12_simple", 25, 100, 12 );) | 376 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_12_simple", 25, 100, 12 );) |
378 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_13_simple", 25, 100, 13 );) | 377 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_13_simple", 25, 100, 13 );) |
379 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_14_simple", 25, 100, 14 );) | 378 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_14_simple", 25, 100, 14 );) |
380 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_15_simple", 25, 100, 15 );) | 379 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_15_simple", 25, 100, 15 );) |
381 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_16_simple", 25, 100, 16 );) | 380 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_16_simple", 25, 100, 16 );) |
382 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_17_simple", 25, 100, 17 );) | 381 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_17_simple", 25, 100, 17 );) |
383 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_18_simple", 25, 100, 18 );) | 382 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_18_simple", 25, 100, 18 );) |
384 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_19_simple", 25, 100, 19 );) | 383 DEF_GM(return new BlurRectGroundTruthGM("blurrect_25_100_19_simple", 25, 100, 19 );) |
385 #endif | 384 #endif |
OLD | NEW |