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

Side by Side Diff: gm/imagefiltersgraph.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Updating to ToT (10994) Created 7 years, 3 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/gmmain.cpp ('k') | gm/lighting.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 "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 14 matching lines...) Expand all
25 ImageFiltersGraphGM() : fInitialized(false) {} 25 ImageFiltersGraphGM() : fInitialized(false) {}
26 26
27 protected: 27 protected:
28 virtual SkString onShortName() { 28 virtual SkString onShortName() {
29 return SkString("imagefiltersgraph"); 29 return SkString("imagefiltersgraph");
30 } 30 }
31 31
32 void make_bitmap() { 32 void make_bitmap() {
33 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100); 33 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
34 fBitmap.allocPixels(); 34 fBitmap.allocPixels();
35 SkDevice device(fBitmap); 35 SkBitmapDevice device(fBitmap);
36 SkCanvas canvas(&device); 36 SkCanvas canvas(&device);
37 canvas.clear(0x00000000); 37 canvas.clear(0x00000000);
38 SkPaint paint; 38 SkPaint paint;
39 paint.setAntiAlias(true); 39 paint.setAntiAlias(true);
40 paint.setColor(0xFFFFFFFF); 40 paint.setColor(0xFFFFFFFF);
41 paint.setTextSize(SkIntToScalar(96)); 41 paint.setTextSize(SkIntToScalar(96));
42 const char* str = "e"; 42 const char* str = "e";
43 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); 43 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
44 } 44 }
45 45
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 private: 86 private:
87 typedef GM INHERITED; 87 typedef GM INHERITED;
88 SkBitmap fBitmap; 88 SkBitmap fBitmap;
89 bool fInitialized; 89 bool fInitialized;
90 }; 90 };
91 91
92 /////////////////////////////////////////////////////////////////////////////// 92 ///////////////////////////////////////////////////////////////////////////////
93 93
94 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } 94 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; }
95 static skiagm::GMRegistry reg(MyFactory); 95 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/gmmain.cpp ('k') | gm/lighting.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698