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

Unified Diff: gm/xfermodes3.cpp

Issue 163603003: 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/xfermodeimagefilter.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodes3.cpp
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index bb7d6149c5e3c790a2720b65b4b13597c1832bd2..76c4b88380d6c9d093a0b3522168572be1978a9b 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -168,8 +168,11 @@ private:
if (NULL == layerCanvas) {
canvas->restore();
} else {
- SkBitmap bitmap = layerCanvas->getDevice()->accessBitmap(false);
- canvas->drawBitmap(bitmap, 0, 0);
+ SkAutoROCanvasPixels ropixels(layerCanvas);
+ SkBitmap bitmap;
+ if (ropixels.asROBitmap(&bitmap)) {
+ canvas->drawBitmap(bitmap, 0, 0);
+ }
}
r.inset(-SK_ScalarHalf, -SK_ScalarHalf);
« no previous file with comments | « gm/xfermodeimagefilter.cpp ('k') | gyp/gmslides.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698