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

Unified Diff: src/animator/SkSnapshot.cpp

Issue 355193006: stop calling SkCanvas::getDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: guard gpu code in no-gpu build Created 6 years, 6 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 | « samplecode/SampleTextAlpha.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/animator/SkSnapshot.cpp
diff --git a/src/animator/SkSnapshot.cpp b/src/animator/SkSnapshot.cpp
index 6f818a627d7e19f364c8c84d0229705ec50a6721..b61d602047a67811d15c0d62a987d750bee13e45 100644
--- a/src/animator/SkSnapshot.cpp
+++ b/src/animator/SkSnapshot.cpp
@@ -60,8 +60,10 @@ bool SkSnapshot::draw(SkAnimateMaker& maker) {
name.append(".jpg");
else if (type == SkImageEncoder::kPNG_Type)
name.append(".png");
- encoder->encodeFile(name.c_str(),
- maker.fCanvas->getDevice()->accessBitmap(false),
- SkScalarFloorToInt(quality));
+
+ SkBitmap pixels;
+ pixels.allocPixels(maker.fCanvas->imageInfo());
+ maker.fCanvas->readPixels(&pixels, 0, 0);
+ encoder->encodeFile(name.c_str(), pixels, SkScalarFloorToInt(quality));
return false;
}
« no previous file with comments | « samplecode/SampleTextAlpha.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698