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

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: Fix for andriod only code. 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
« no previous file with comments | « gyp/tests.gyp ('k') | samplecode/SampleColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageDecoder.h
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
index 5ef569047b81087ccc728ef8c486d51e648593d5..360f03acb6304022b949b3d4708456c336b227c4 100644
--- a/include/core/SkImageDecoder.h
+++ b/include/core/SkImageDecoder.h
@@ -82,6 +82,21 @@ public:
fPreferQualityOverSpeed = qualityOverSpeed;
}
+ /** Set to true to require the decoder to return a bitmap with unpremultiplied
+ colors. The default is false, meaning the resulting bitmap will have its
+ colors premultiplied.
+ NOTE: Passing true to this function may result in a bitmap which cannot
+ be properly used by Skia.
+ */
+ void setRequireUnpremultipliedColors(bool request) {
+ fRequireUnpremultipliedColors = request;
+ }
+
+ /** Returns true if the decoder will only return bitmaps with unpremultiplied
+ colors.
+ */
+ bool getRequireUnpremultipliedColors() const { return fRequireUnpremultipliedColors; }
+
/** \class Peeker
Base class for optional callbacks to retrieve meta/chunk data out of
@@ -433,6 +448,7 @@ private:
bool fUsePrefTable;
mutable bool fShouldCancelDecode;
bool fPreferQualityOverSpeed;
+ bool fRequireUnpremultipliedColors;
};
/** Calling newDecoder with a stream returns a new matching imagedecoder
« no previous file with comments | « gyp/tests.gyp ('k') | samplecode/SampleColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698