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

Unified Diff: src/lazy/SkDiscardablePixelRef.cpp

Issue 1226023003: Remove SkImageGenerator pieces only for SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@severIG
Patch Set: Change the public interface without staging it. 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
« 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 73fa4ce84cc2062e29c9dfb67fdd856229f71156..19bfc8ccc798b84cdbb7829b89d6f4dfe04fbd7d 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -71,18 +71,12 @@ bool SkDiscardablePixelRef::onNewLockPixels(LockRec* rec) {
SkPMColor colors[256];
int colorCount = 0;
- const SkImageGenerator::Result result = fGenerator->getPixels(info, pixels, fRowBytes, NULL,
- colors, &colorCount);
- switch (result) {
- case SkImageGenerator::kSuccess:
- case SkImageGenerator::kIncompleteInput:
- break;
- default:
- fDiscardableMemory->unlock();
- fDiscardableMemoryIsLocked = false;
- SkDELETE(fDiscardableMemory);
- fDiscardableMemory = NULL;
- return false;
+ if (!fGenerator->getPixels(info, pixels, fRowBytes, colors, &colorCount)) {
+ fDiscardableMemory->unlock();
+ fDiscardableMemoryIsLocked = false;
+ SkDELETE(fDiscardableMemory);
+ fDiscardableMemory = NULL;
+ return false;
}
// Note: our ctable is not purgeable, as it is not stored in the discardablememory block.
« 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