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

Side by Side Diff: gm/xfermodes.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/xfermodeimagefilter.cpp ('k') | gm/xfermodes2.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkShader.h" 10 #include "SkShader.h"
11 #include "SkXfermode.h" 11 #include "SkXfermode.h"
12 12
13 namespace skiagm { 13 namespace skiagm {
14 14
15 static void make_bitmaps(int w, int h, SkBitmap* src, SkBitmap* dst, 15 static void make_bitmaps(int w, int h, SkBitmap* src, SkBitmap* dst,
16 SkBitmap* transparent) { 16 SkBitmap* transparent) {
17 src->setConfig(SkBitmap::kARGB_8888_Config, w, h); 17 src->allocN32Pixels(w, h);
18 src->allocPixels();
19 src->eraseColor(SK_ColorTRANSPARENT); 18 src->eraseColor(SK_ColorTRANSPARENT);
20 19
21 SkPaint p; 20 SkPaint p;
22 p.setAntiAlias(true); 21 p.setAntiAlias(true);
23 22
24 SkRect r; 23 SkRect r;
25 SkScalar ww = SkIntToScalar(w); 24 SkScalar ww = SkIntToScalar(w);
26 SkScalar hh = SkIntToScalar(h); 25 SkScalar hh = SkIntToScalar(h);
27 26
28 { 27 {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 private: 284 private:
286 typedef GM INHERITED; 285 typedef GM INHERITED;
287 }; 286 };
288 287
289 ////////////////////////////////////////////////////////////////////////////// 288 //////////////////////////////////////////////////////////////////////////////
290 289
291 static GM* MyFactory(void*) { return new XfermodesGM; } 290 static GM* MyFactory(void*) { return new XfermodesGM; }
292 static GMRegistry reg(MyFactory); 291 static GMRegistry reg(MyFactory);
293 292
294 } 293 }
OLDNEW
« no previous file with comments | « gm/xfermodeimagefilter.cpp ('k') | gm/xfermodes2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698