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

Side by Side Diff: gm/bitmapcopy.cpp

Issue 14885012: Make gms use getTopDevice() rather than getDevice(). (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 | « no previous file | gm/texdata.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 virtual SkISize onISize() { 59 virtual SkISize onISize() {
60 return make_isize(540, 330); 60 return make_isize(540, 330);
61 } 61 }
62 62
63 virtual void onDraw(SkCanvas* canvas) { 63 virtual void onDraw(SkCanvas* canvas) {
64 SkPaint paint; 64 SkPaint paint;
65 SkScalar horizMargin(SkIntToScalar(10)); 65 SkScalar horizMargin(SkIntToScalar(10));
66 SkScalar vertMargin(SkIntToScalar(10)); 66 SkScalar vertMargin(SkIntToScalar(10));
67 67
68 draw_checks(canvas, 40, 40); 68 draw_checks(canvas, 40, 40);
69 SkBitmap src = canvas->getDevice()->accessBitmap(false); 69 SkBitmap src = canvas->getTopDevice()->accessBitmap(false);
70 70
71 for (unsigned i = 0; i < NUM_CONFIGS; ++i) { 71 for (unsigned i = 0; i < NUM_CONFIGS; ++i) {
72 if (!src.deepCopyTo(&fDst[i], gConfigs[i])) { 72 if (!src.deepCopyTo(&fDst[i], gConfigs[i])) {
73 src.copyTo(&fDst[i], gConfigs[i]); 73 src.copyTo(&fDst[i], gConfigs[i]);
74 } 74 }
75 } 75 }
76 76
77 canvas->clear(0xFFDDDDDD); 77 canvas->clear(0xFFDDDDDD);
78 paint.setAntiAlias(true); 78 paint.setAntiAlias(true);
79 SkScalar width = SkIntToScalar(40); 79 SkScalar width = SkIntToScalar(40);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 typedef GM INHERITED; 118 typedef GM INHERITED;
119 }; 119 };
120 120
121 ////////////////////////////////////////////////////////////////////////////// 121 //////////////////////////////////////////////////////////////////////////////
122 122
123 #ifndef SK_BUILD_FOR_ANDROID 123 #ifndef SK_BUILD_FOR_ANDROID
124 static GM* MyFactory(void*) { return new BitmapCopyGM; } 124 static GM* MyFactory(void*) { return new BitmapCopyGM; }
125 static GMRegistry reg(MyFactory); 125 static GMRegistry reg(MyFactory);
126 #endif 126 #endif
127 } 127 }
OLDNEW
« no previous file with comments | « no previous file | gm/texdata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698