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

Side by Side Diff: gm/arithmode.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, 11 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/aarectmodes.cpp ('k') | gm/bicubicfilter.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 2011 Google Inc. 2 * Copyright 2011 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 "SkColorPriv.h" 10 #include "SkColorPriv.h"
11 #include "SkShader.h" 11 #include "SkShader.h"
12 12
13 #include "SkArithmeticMode.h" 13 #include "SkArithmeticMode.h"
14 #include "SkGradientShader.h" 14 #include "SkGradientShader.h"
15 #define WW 100 15 #define WW 100
16 #define HH 32 16 #define HH 32
17 17
18 static SkBitmap make_bm() { 18 static SkBitmap make_bm() {
19 SkBitmap bm; 19 SkBitmap bm;
20 bm.setConfig(SkBitmap::kARGB_8888_Config, WW, HH); 20 bm.allocN32Pixels(WW, HH);
21 bm.allocPixels();
22 bm.eraseColor(SK_ColorTRANSPARENT); 21 bm.eraseColor(SK_ColorTRANSPARENT);
23 return bm; 22 return bm;
24 } 23 }
25 24
26 static SkBitmap make_src() { 25 static SkBitmap make_src() {
27 SkBitmap bm = make_bm(); 26 SkBitmap bm = make_bm();
28 SkCanvas canvas(bm); 27 SkCanvas canvas(bm);
29 SkPaint paint; 28 SkPaint paint;
30 SkPoint pts[] = { {0, 0}, {SkIntToScalar(WW), SkIntToScalar(HH)} }; 29 SkPoint pts[] = { {0, 0}, {SkIntToScalar(WW), SkIntToScalar(HH)} };
31 SkColor colors[] = { 30 SkColor colors[] = {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 123 }
125 124
126 private: 125 private:
127 typedef GM INHERITED; 126 typedef GM INHERITED;
128 }; 127 };
129 128
130 /////////////////////////////////////////////////////////////////////////////// 129 ///////////////////////////////////////////////////////////////////////////////
131 130
132 static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; } 131 static skiagm::GM* MyFactory(void*) { return new ArithmodeGM; }
133 static skiagm::GMRegistry reg(MyFactory); 132 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/aarectmodes.cpp ('k') | gm/bicubicfilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698