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); |
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: |
(...skipping 164 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 |