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

Unified Diff: src/lazy/SkCachingPixelRef.cpp

Issue 1226023003: Remove SkImageGenerator pieces only for SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@severIG
Patch Set: Created 5 years, 5 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
Index: src/lazy/SkCachingPixelRef.cpp
diff --git a/src/lazy/SkCachingPixelRef.cpp b/src/lazy/SkCachingPixelRef.cpp
index 5fc0d2a87fa7180e88ed3404c175ee0750cf2f5e..31f23ec2fe0758cbcb94143bd632c25e2a697c17 100644
--- a/src/lazy/SkCachingPixelRef.cpp
+++ b/src/lazy/SkCachingPixelRef.cpp
@@ -53,6 +53,7 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) {
fErrorInDecoding = true;
return false;
}
+#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
const SkImageGenerator::Result result = fImageGenerator->getPixels(info,
fLockedBitmap.getPixels(), fRowBytes);
switch (result) {
@@ -60,8 +61,11 @@ bool SkCachingPixelRef::onNewLockPixels(LockRec* rec) {
case SkImageGenerator::kSuccess:
break;
default:
- fErrorInDecoding = true;
- return false;
+#else
+ if (!fImageGenerator->getPixels(info, fLockedBitmap.getPixels(), fRowBytes)) {
+#endif
+ fErrorInDecoding = true;
+ return false;
}
fLockedBitmap.setImmutable();
SkBitmapCache::Add(this, info.bounds(), fLockedBitmap);

Powered by Google App Engine
This is Rietveld 408576698