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

Side by Side Diff: gm/imagefiltersgraph.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/imagefilterscropped.cpp ('k') | gm/imagefiltersscaled.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 9
10 #include "SkArithmeticMode.h" 10 #include "SkArithmeticMode.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 SK_DECLARE_STATIC_ONCE(once); 84 SK_DECLARE_STATIC_ONCE(once);
85 SkOnce(&once, init_flattenable, &dummy); 85 SkOnce(&once, init_flattenable, &dummy);
86 } 86 }
87 87
88 protected: 88 protected:
89 virtual SkString onShortName() { 89 virtual SkString onShortName() {
90 return SkString("imagefiltersgraph"); 90 return SkString("imagefiltersgraph");
91 } 91 }
92 92
93 void make_bitmap() { 93 void make_bitmap() {
94 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100); 94 fBitmap.allocN32Pixels(100, 100);
95 fBitmap.allocPixels();
96 SkBitmapDevice device(fBitmap); 95 SkBitmapDevice device(fBitmap);
97 SkCanvas canvas(&device); 96 SkCanvas canvas(&device);
98 canvas.clear(0x00000000); 97 canvas.clear(0x00000000);
99 SkPaint paint; 98 SkPaint paint;
100 paint.setAntiAlias(true); 99 paint.setAntiAlias(true);
101 paint.setColor(0xFFFFFFFF); 100 paint.setColor(0xFFFFFFFF);
102 paint.setTextSize(SkIntToScalar(96)); 101 paint.setTextSize(SkIntToScalar(96));
103 const char* str = "e"; 102 const char* str = "e";
104 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); 103 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
105 } 104 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 private: 205 private:
207 typedef GM INHERITED; 206 typedef GM INHERITED;
208 SkBitmap fBitmap; 207 SkBitmap fBitmap;
209 bool fInitialized; 208 bool fInitialized;
210 }; 209 };
211 210
212 /////////////////////////////////////////////////////////////////////////////// 211 ///////////////////////////////////////////////////////////////////////////////
213 212
214 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } 213 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; }
215 static skiagm::GMRegistry reg(MyFactory); 214 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/imagefilterscropped.cpp ('k') | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698