Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Side by Side Diff: gm/blurrect.cpp

Issue 169913003: replace SkBitmap::Config with SkColorType in gms (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gm/bitmapshader.cpp ('k') | gm/drawbitmaprect.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gm/bitmapshader.cpp ('k') | gm/drawbitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698