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

Unified Diff: src/images/SkDecodingImageGenerator.h

Issue 223903007: Add option to SkDecodingImageGenerator to require unpremul. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Match surrounding code line length. Created 6 years, 8 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 | « no previous file | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkDecodingImageGenerator.h
diff --git a/src/images/SkDecodingImageGenerator.h b/src/images/SkDecodingImageGenerator.h
index 17802433b166b446bc43f4ceb089945d4553bb94..6cb39be8d84ada83173a549aab4e8ce8fb29dfd4 100644
--- a/src/images/SkDecodingImageGenerator.h
+++ b/src/images/SkDecodingImageGenerator.h
@@ -40,27 +40,42 @@ namespace SkDecodingImageGenerator {
* type. If the decoder won't support this color type,
* SkDecodingImageGenerator::Create will return
* NULL. kIndex_8_SkColorType is not supported.
+ *
+ * @param fRequireUnpremul If true, the decoder will attempt to
+ * decode without premultiplying the alpha. If it cannot,
+ * the pixels will be set to NULL.
*/
struct Options {
Options()
: fSampleSize(1)
, fDitherImage(true)
, fUseRequestedColorType(false)
- , fRequestedColorType() { }
+ , fRequestedColorType()
+ , fRequireUnpremul(false) { }
Options(int sampleSize, bool dither)
: fSampleSize(sampleSize)
, fDitherImage(dither)
, fUseRequestedColorType(false)
- , fRequestedColorType() { }
+ , fRequestedColorType()
+ , fRequireUnpremul(false) { }
Options(int sampleSize, bool dither, SkColorType colorType)
: fSampleSize(sampleSize)
, fDitherImage(dither)
, fUseRequestedColorType(true)
- , fRequestedColorType(colorType) { }
+ , fRequestedColorType(colorType)
+ , fRequireUnpremul(false) { }
+ Options(int sampleSize, bool dither, SkColorType colorType,
+ bool requireUnpremul)
+ : fSampleSize(sampleSize)
+ , fDitherImage(dither)
+ , fUseRequestedColorType(true)
+ , fRequestedColorType(colorType)
+ , fRequireUnpremul(requireUnpremul) { }
const int fSampleSize;
const bool fDitherImage;
const bool fUseRequestedColorType;
const SkColorType fRequestedColorType;
+ const bool fRequireUnpremul;
};
/**
« no previous file with comments | « no previous file | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698