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

Unified Diff: gm/bitmapcopy.cpp

Issue 22353006: gm/bitmapcopy: create the bitmap in a secondary canvas, since the one in which we draw might be bac… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bitmapcopy.cpp
===================================================================
--- gm/bitmapcopy.cpp (revision 10562)
+++ gm/bitmapcopy.cpp (working copy)
@@ -21,7 +21,8 @@
SkBitmap::Config gConfigs[] = {
SkBitmap::kRGB_565_Config,
- SkBitmap::kARGB_4444_Config,
+ SkBitmap::kARGB_4444_Config, // TODO(edisonn): Should we remove it from GM?
+ // it fails to copy in bitmap with this config.
SkBitmap::kARGB_8888_Config,
};
@@ -65,8 +66,11 @@
SkScalar horizMargin(SkIntToScalar(10));
SkScalar vertMargin(SkIntToScalar(10));
- draw_checks(canvas, 40, 40);
- SkBitmap src = canvas->getTopDevice()->accessBitmap(false);
+ SkDevice devTmp(SkBitmap::kARGB_8888_Config, 40, 40);
+ SkCanvas canvasTmp(&devTmp);
+
+ draw_checks(&canvasTmp, 40, 40);
+ SkBitmap src = canvasTmp.getTopDevice()->accessBitmap(false);
for (unsigned i = 0; i < NUM_CONFIGS; ++i) {
if (!src.deepCopyTo(&fDst[i], gConfigs[i])) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698