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

Side by Side Diff: gm/bitmapcopy.cpp

Issue 167683006: Offer single-param version of deepCopyTo -- much easier to migrate to colortypes (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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/simpleaaclip.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 SkScalar horizMargin = 10; 65 SkScalar horizMargin = 10;
66 SkScalar vertMargin = 10; 66 SkScalar vertMargin = 10;
67 67
68 SkBitmap src; 68 SkBitmap src;
69 src.allocN32Pixels(40, 40); 69 src.allocN32Pixels(40, 40);
70 SkCanvas canvasTmp(src); 70 SkCanvas canvasTmp(src);
71 71
72 draw_checks(&canvasTmp, 40, 40); 72 draw_checks(&canvasTmp, 40, 40);
73 73
74 for (unsigned i = 0; i < NUM_CONFIGS; ++i) { 74 for (unsigned i = 0; i < NUM_CONFIGS; ++i) {
75 if (!src.deepCopyTo(&fDst[i], gConfigs[i])) { 75 src.copyTo(&fDst[i], gConfigs[i]);
76 src.copyTo(&fDst[i], gConfigs[i]);
77 }
78 } 76 }
79 77
80 canvas->clear(0xFFDDDDDD); 78 canvas->clear(0xFFDDDDDD);
81 paint.setAntiAlias(true); 79 paint.setAntiAlias(true);
82 SkScalar width = SkIntToScalar(40); 80 SkScalar width = SkIntToScalar(40);
83 SkScalar height = SkIntToScalar(40); 81 SkScalar height = SkIntToScalar(40);
84 if (paint.getFontSpacing() > height) { 82 if (paint.getFontSpacing() > height) {
85 height = paint.getFontSpacing(); 83 height = paint.getFontSpacing();
86 } 84 }
87 for (unsigned i = 0; i < NUM_CONFIGS; i++) { 85 for (unsigned i = 0; i < NUM_CONFIGS; i++) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 typedef GM INHERITED; 119 typedef GM INHERITED;
122 }; 120 };
123 121
124 ////////////////////////////////////////////////////////////////////////////// 122 //////////////////////////////////////////////////////////////////////////////
125 123
126 #ifndef SK_BUILD_FOR_ANDROID 124 #ifndef SK_BUILD_FOR_ANDROID
127 static GM* MyFactory(void*) { return new BitmapCopyGM; } 125 static GM* MyFactory(void*) { return new BitmapCopyGM; }
128 static GMRegistry reg(MyFactory); 126 static GMRegistry reg(MyFactory);
129 #endif 127 #endif
130 } 128 }
OLDNEW
« no previous file with comments | « no previous file | gm/simpleaaclip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698