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

Unified Diff: src/lazy/SkDiscardablePixelRef.cpp

Issue 99303003: SkDiscardablePixelRef objects are now marked immutable. (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 | « include/core/SkImageGenerator.h ('k') | no next file » | 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 b6e1b1004ed7096fc180be5945aa44e5dfab1c1c..4e19c7f65b9c011e6e2ab424a5e05a67218f2986 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -20,6 +20,9 @@ SkDiscardablePixelRef::SkDiscardablePixelRef(SkImageGenerator* generator,
SkASSERT(fGenerator != NULL);
SkASSERT(fSize > 0);
SkASSERT(fRowBytes > 0);
+ // The SkImageGenerator contract requires fGenerator to always
+ // decode the same image on each call to getPixels().
+ this->setImmutable();
}
SkDiscardablePixelRef::~SkDiscardablePixelRef() {
« no previous file with comments | « include/core/SkImageGenerator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698