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

Side by Side Diff: gm/spritebitmap.cpp

Issue 140593005: add legacy/helper allocN32Pixels, and convert gm to use it (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/shadertext3.cpp ('k') | gm/tablecolorfilter.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 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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkBlurImageFilter.h" 10 #include "SkBlurImageFilter.h"
11 11
12 static void make_bm(SkBitmap* bm) { 12 static void make_bm(SkBitmap* bm) {
13 bm->setConfig(SkBitmap::kARGB_8888_Config, 100, 100); 13 bm->allocN32Pixels(100, 100);
14 bm->allocPixels();
15 bm->eraseColor(SK_ColorBLUE); 14 bm->eraseColor(SK_ColorBLUE);
16 15
17 SkCanvas canvas(*bm); 16 SkCanvas canvas(*bm);
18 SkPaint paint; 17 SkPaint paint;
19 paint.setAntiAlias(true); 18 paint.setAntiAlias(true);
20 paint.setColor(SK_ColorRED); 19 paint.setColor(SK_ColorRED);
21 canvas.drawCircle(50, 50, 50, paint); 20 canvas.drawCircle(50, 50, 50, paint);
22 } 21 }
23 22
24 static void draw_2_bitmaps(SkCanvas* canvas, const SkBitmap& bm, bool doClip, 23 static void draw_2_bitmaps(SkCanvas* canvas, const SkBitmap& bm, bool doClip,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 draw_2_bitmaps(canvas, bm, true, dx, dy, filter); 89 draw_2_bitmaps(canvas, bm, true, dx, dy, filter);
91 } 90 }
92 91
93 private: 92 private:
94 typedef GM INHERITED; 93 typedef GM INHERITED;
95 }; 94 };
96 95
97 ////////////////////////////////////////////////////////////////////////////// 96 //////////////////////////////////////////////////////////////////////////////
98 97
99 DEF_GM( return new SpriteBitmapGM; ) 98 DEF_GM( return new SpriteBitmapGM; )
OLDNEW
« no previous file with comments | « gm/shadertext3.cpp ('k') | gm/tablecolorfilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698