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

Side by Side Diff: gm/bitmapcopy.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/beziereffects.cpp ('k') | gm/deviceproperties.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 9
10 namespace skiagm { 10 namespace skiagm {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 virtual SkISize onISize() { 60 virtual SkISize onISize() {
61 return make_isize(540, 330); 61 return make_isize(540, 330);
62 } 62 }
63 63
64 virtual void onDraw(SkCanvas* canvas) { 64 virtual void onDraw(SkCanvas* canvas) {
65 SkPaint paint; 65 SkPaint paint;
66 SkScalar horizMargin(SkIntToScalar(10)); 66 SkScalar horizMargin(SkIntToScalar(10));
67 SkScalar vertMargin(SkIntToScalar(10)); 67 SkScalar vertMargin(SkIntToScalar(10));
68 68
69 SkDevice devTmp(SkBitmap::kARGB_8888_Config, 40, 40); 69 SkBitmapDevice devTmp(SkBitmap::kARGB_8888_Config, 40, 40, false);
70 SkCanvas canvasTmp(&devTmp); 70 SkCanvas canvasTmp(&devTmp);
71 71
72 draw_checks(&canvasTmp, 40, 40); 72 draw_checks(&canvasTmp, 40, 40);
73 SkBitmap src = canvasTmp.getTopDevice()->accessBitmap(false); 73 SkBitmap src = canvasTmp.getTopDevice()->accessBitmap(false);
74 74
75 for (unsigned i = 0; i < NUM_CONFIGS; ++i) { 75 for (unsigned i = 0; i < NUM_CONFIGS; ++i) {
76 if (!src.deepCopyTo(&fDst[i], gConfigs[i])) { 76 if (!src.deepCopyTo(&fDst[i], gConfigs[i])) {
77 src.copyTo(&fDst[i], gConfigs[i]); 77 src.copyTo(&fDst[i], gConfigs[i]);
78 } 78 }
79 } 79 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 typedef GM INHERITED; 122 typedef GM INHERITED;
123 }; 123 };
124 124
125 ////////////////////////////////////////////////////////////////////////////// 125 //////////////////////////////////////////////////////////////////////////////
126 126
127 #ifndef SK_BUILD_FOR_ANDROID 127 #ifndef SK_BUILD_FOR_ANDROID
128 static GM* MyFactory(void*) { return new BitmapCopyGM; } 128 static GM* MyFactory(void*) { return new BitmapCopyGM; }
129 static GMRegistry reg(MyFactory); 129 static GMRegistry reg(MyFactory);
130 #endif 130 #endif
131 } 131 }
OLDNEW
« no previous file with comments | « gm/beziereffects.cpp ('k') | gm/deviceproperties.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698