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: src/lazy/SkDiscardablePixelRef.cpp

Issue 1017293002: guarded change to SkImageGenerator to make getInfo() const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « src/lazy/SkCachingPixelRef.cpp ('k') | src/ports/SkImageGenerator_skia.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkDiscardablePixelRef.cpp
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index b810c2b1839b9bc4d0cf031edbf9b470e60c844a..1e42042fb6d10c05626f8a3d5bedd28dfcb257c8 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -109,12 +109,12 @@ void SkDiscardablePixelRef::onUnlockPixels() {
bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst,
SkDiscardableMemory::Factory* factory) {
- SkImageInfo info;
SkAutoTDelete<SkImageGenerator> autoGenerator(generator);
- if ((NULL == autoGenerator.get())
- || (!autoGenerator->getInfo(&info))
- || info.isEmpty()
- || (!dst->setInfo(info))) {
+ if (NULL == autoGenerator.get()) {
+ return false;
+ }
+ SkImageInfo info = autoGenerator->getInfo();
+ if (info.isEmpty() || !dst->setInfo(info)) {
return false;
}
// Since dst->setInfo() may have changed/fixed-up info, we copy it back from that bitmap
« no previous file with comments | « src/lazy/SkCachingPixelRef.cpp ('k') | src/ports/SkImageGenerator_skia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698