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

Unified Diff: gm/bitmapcopy.cpp

Issue 161733002: add peekPixels to SkCanvas and SkSurface (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gm/aaclip.cpp ('k') | gm/bitmapsource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bitmapcopy.cpp
diff --git a/gm/bitmapcopy.cpp b/gm/bitmapcopy.cpp
index 928b4037c136000d0d9910102c37ad51c5a4a31d..f210b4aa5e0870e2c55682924c5e93831797be95 100644
--- a/gm/bitmapcopy.cpp
+++ b/gm/bitmapcopy.cpp
@@ -62,14 +62,14 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- SkScalar horizMargin(SkIntToScalar(10));
- SkScalar vertMargin(SkIntToScalar(10));
+ SkScalar horizMargin = 10;
+ SkScalar vertMargin = 10;
- SkBitmapDevice devTmp(SkBitmap::kARGB_8888_Config, 40, 40, false);
- SkCanvas canvasTmp(&devTmp);
+ SkBitmap src;
+ src.allocN32Pixels(40, 40);
+ SkCanvas canvasTmp(src);
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 | « gm/aaclip.cpp ('k') | gm/bitmapsource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698