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

Unified Diff: src/lazy/SkDiscardablePixelRef.cpp

Issue 103753007: Revert of Change SkDecodingImageGenerator API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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/SkDiscardablePixelRef.h ('k') | tests/CachedDecodingPixelRefTest.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 2886156102937faeb734f2891b74daaff47dba61..160ca5b4fbacdaae84f040c5eae3084f10b36cd6 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -72,19 +72,20 @@
SkBitmap* dst,
SkDiscardableMemory::Factory* factory) {
SkImageInfo info;
- SkAutoTDelete<SkImageGenerator> autoGenerator(generator);
- if ((NULL == autoGenerator.get())
- || (!autoGenerator->getInfo(&info))
+ SkASSERT(generator != NULL);
+ if ((NULL == generator)
+ || (!generator->getInfo(&info))
|| (!dst->setConfig(info, 0))) {
+ SkDELETE(generator);
return false;
}
SkASSERT(dst->config() != SkBitmap::kNo_Config);
- if (dst->empty()) { // Use a normal pixelref.
+ if (dst->empty()) { // Use a normal pixelref.
+ SkDELETE(generator); // Do not need this anymore.
return dst->allocPixels(NULL, NULL);
}
- SkAutoTUnref<SkDiscardablePixelRef> ref(
- SkNEW_ARGS(SkDiscardablePixelRef,
- (info, autoGenerator.detach(), dst->rowBytes(), factory)));
+ SkAutoTUnref<SkDiscardablePixelRef> ref(SkNEW_ARGS(SkDiscardablePixelRef,
+ (info, generator, dst->rowBytes(), factory)));
dst->setPixelRef(ref);
return true;
}
« no previous file with comments | « src/lazy/SkDiscardablePixelRef.h ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698