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

Side by Side Diff: gm/deviceproperties.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/bitmapcopy.cpp ('k') | gm/displacement.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 2013 Google Inc. 2 * Copyright 2013 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 #include "gm.h" 7 #include "gm.h"
8 #include "SkTypeface.h" 8 #include "SkTypeface.h"
9 9
10 namespace skiagm { 10 namespace skiagm {
(...skipping 26 matching lines...) Expand all
37 37
38 virtual void onDraw(SkCanvas* originalCanvas) { 38 virtual void onDraw(SkCanvas* originalCanvas) {
39 SkISize size = this->getISize(); 39 SkISize size = this->getISize();
40 SkBitmap bitmap; 40 SkBitmap bitmap;
41 bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height( )); 41 bitmap.setConfig(SkBitmap::kARGB_8888_Config, size.width(), size.height( ));
42 bitmap.allocPixels(); 42 bitmap.allocPixels();
43 SkDeviceProperties properties = SkDeviceProperties::Make( 43 SkDeviceProperties properties = SkDeviceProperties::Make(
44 SkDeviceProperties::Geometry::Make(SkDeviceProperties::Geometry::kVe rtical_Orientation, 44 SkDeviceProperties::Geometry::Make(SkDeviceProperties::Geometry::kVe rtical_Orientation,
45 SkDeviceProperties::Geometry::kBG R_Layout), 45 SkDeviceProperties::Geometry::kBG R_Layout),
46 SK_Scalar1); 46 SK_Scalar1);
47 SkDevice device(bitmap, properties); 47 SkBitmapDevice device(bitmap, properties);
48 SkCanvas canvas(&device); 48 SkCanvas canvas(&device);
49 canvas.drawColor(SK_ColorWHITE); 49 canvas.drawColor(SK_ColorWHITE);
50 50
51 SkPaint paint; 51 SkPaint paint;
52 52
53 paint.setAntiAlias(true); 53 paint.setAntiAlias(true);
54 paint.setLCDRenderText(true); 54 paint.setLCDRenderText(true);
55 //With freetype the default (normal hinting) can be really ugly. 55 //With freetype the default (normal hinting) can be really ugly.
56 //Most distros now set slight (vertical hinting only) in any event. 56 //Most distros now set slight (vertical hinting only) in any event.
57 paint.setHinting(SkPaint::kSlight_Hinting); 57 paint.setHinting(SkPaint::kSlight_Hinting);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 private: 104 private:
105 typedef GM INHERITED; 105 typedef GM INHERITED;
106 }; 106 };
107 107
108 ////////////////////////////////////////////////////////////////////////////// 108 //////////////////////////////////////////////////////////////////////////////
109 109
110 static GM* MyFactory(void*) { return new DevicePropertiesGM; } 110 static GM* MyFactory(void*) { return new DevicePropertiesGM; }
111 static GMRegistry reg(MyFactory); 111 static GMRegistry reg(MyFactory);
112 112
113 } 113 }
OLDNEW
« no previous file with comments | « gm/bitmapcopy.cpp ('k') | gm/displacement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698