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

Side by Side Diff: gm/morphology.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/matrixconvolution.cpp ('k') | gm/ninepatchstretch.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 #include "SkMorphologyImageFilter.h" 9 #include "SkMorphologyImageFilter.h"
10 10
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 protected: 23 protected:
24 virtual SkString onShortName() { 24 virtual SkString onShortName() {
25 return SkString("morphology"); 25 return SkString("morphology");
26 } 26 }
27 27
28 void make_bitmap() { 28 void make_bitmap() {
29 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 135, 135); 29 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 135, 135);
30 fBitmap.allocPixels(); 30 fBitmap.allocPixels();
31 SkDevice device(fBitmap); 31 SkBitmapDevice device(fBitmap);
32 SkCanvas canvas(&device); 32 SkCanvas canvas(&device);
33 canvas.clear(0x0); 33 canvas.clear(0x0);
34 SkPaint paint; 34 SkPaint paint;
35 paint.setAntiAlias(true); 35 paint.setAntiAlias(true);
36 const char* str1 = "ABC"; 36 const char* str1 = "ABC";
37 const char* str2 = "XYZ"; 37 const char* str2 = "XYZ";
38 paint.setColor(0xFFFFFFFF); 38 paint.setColor(0xFFFFFFFF);
39 paint.setTextSize(64); 39 paint.setTextSize(64);
40 canvas.drawText(str1, strlen(str1), 10, 55, paint); 40 canvas.drawText(str1, strlen(str1), 10, 55, paint);
41 canvas.drawText(str2, strlen(str2), 10, 110, paint); 41 canvas.drawText(str2, strlen(str2), 10, 110, paint);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 SkBitmap fBitmap; 89 SkBitmap fBitmap;
90 bool fOnce; 90 bool fOnce;
91 }; 91 };
92 92
93 ////////////////////////////////////////////////////////////////////////////// 93 //////////////////////////////////////////////////////////////////////////////
94 94
95 static GM* MyFactory(void*) { return new MorphologyGM; } 95 static GM* MyFactory(void*) { return new MorphologyGM; }
96 static GMRegistry reg(MyFactory); 96 static GMRegistry reg(MyFactory);
97 97
98 } 98 }
OLDNEW
« no previous file with comments | « gm/matrixconvolution.cpp ('k') | gm/ninepatchstretch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698