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

Side by Side Diff: gm/simpleaaclip.cpp

Issue 167683006: Offer single-param version of deepCopyTo -- much easier to migrate to colortypes (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/bitmapcopy.cpp ('k') | include/core/SkBitmap.h » ('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 8
9 #include "gm.h" 9 #include "gm.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkAAClip.h" 11 #include "SkAAClip.h"
12 12
13 namespace skiagm { 13 namespace skiagm {
14 14
15 static void paint_rgn(SkCanvas* canvas, const SkAAClip& clip, 15 static void paint_rgn(SkCanvas* canvas, const SkAAClip& clip,
16 const SkPaint& paint) { 16 const SkPaint& paint) {
17 SkMask mask; 17 SkMask mask;
18 SkBitmap bm; 18 SkBitmap bm;
19 19
20 clip.copyToMask(&mask); 20 clip.copyToMask(&mask);
21 21
22 SkAutoMaskFreeImage amfi(mask.fImage); 22 SkAutoMaskFreeImage amfi(mask.fImage);
23 23
24 bm.installMaskPixels(mask); 24 bm.installMaskPixels(mask);
25 25
26 // need to copy for deferred drawing test to work 26 // need to copy for deferred drawing test to work
27 SkBitmap bm2; 27 SkBitmap bm2;
28 28
29 bm.deepCopyTo(&bm2, SkBitmap::kA8_Config); 29 bm.deepCopyTo(&bm2);
30 30
31 canvas->drawBitmap(bm2, 31 canvas->drawBitmap(bm2,
32 SK_Scalar1 * mask.fBounds.fLeft, 32 SK_Scalar1 * mask.fBounds.fLeft,
33 SK_Scalar1 * mask.fBounds.fTop, 33 SK_Scalar1 * mask.fBounds.fTop,
34 &paint); 34 &paint);
35 } 35 }
36 36
37 ////////////////////////////////////////////////////////////////////////////// 37 //////////////////////////////////////////////////////////////////////////////
38 /* 38 /*
39 * This GM tests anti aliased single operation booleans with SkAAClips, 39 * This GM tests anti aliased single operation booleans with SkAAClips,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 }; 191 };
192 192
193 ////////////////////////////////////////////////////////////////////////////// 193 //////////////////////////////////////////////////////////////////////////////
194 194
195 // rects 195 // rects
196 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); ) 196 DEF_GM( return new SimpleClipGM(SimpleClipGM::kRect_GeomType); )
197 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); ) 197 DEF_GM( return new SimpleClipGM(SimpleClipGM::kPath_GeomType); )
198 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); ) 198 DEF_GM( return new SimpleClipGM(SimpleClipGM::kAAClip_GeomType); )
199 199
200 } 200 }
OLDNEW
« no previous file with comments | « gm/bitmapcopy.cpp ('k') | include/core/SkBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698