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

Unified Diff: include/core/SkImageDecoder.h

Issue 16410009: Add an option to create unpremultiplied bitmaps. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 6 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: include/core/SkImageDecoder.h
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
index 5ef569047b81087ccc728ef8c486d51e648593d5..d41d9880b102a91e5ef23f4e79e93113f00e02dd 100644
--- a/include/core/SkImageDecoder.h
+++ b/include/core/SkImageDecoder.h
@@ -82,6 +82,19 @@ public:
fPreferQualityOverSpeed = qualityOverSpeed;
}
+ /** Set to true if the decoder should return a bitmap with unpremultiplied
+ colors. The decoder is free to ignore this request. The default is
+ false, meaning the resulting bitmap will have its colors premultiplied.
+ */
+ void setRequestUnpremultipliedColors(bool request) {
+ fRequestUnpremultipliedColors = request;
+ }
+
+ /** Returns true if the decoder should try to return a bitmap with unpremultiplied
+ colors.
+ */
+ bool getRequestUnpremultipliedColors() const { return fRequestUnpremultipliedColors; }
+
/** \class Peeker
Base class for optional callbacks to retrieve meta/chunk data out of
@@ -433,6 +446,7 @@ private:
bool fUsePrefTable;
mutable bool fShouldCancelDecode;
bool fPreferQualityOverSpeed;
+ bool fRequestUnpremultipliedColors;
};
/** Calling newDecoder with a stream returns a new matching imagedecoder

Powered by Google App Engine
This is Rietveld 408576698