Index: src/images/SkDecodingImageGenerator.cpp |
diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp |
index 016362f43c24b741def05a605bb1fe18f765bf0c..deebf7e0bdd9270bdfbfc9fa74e4b9a447d216ce 100644 |
--- a/src/images/SkDecodingImageGenerator.cpp |
+++ b/src/images/SkDecodingImageGenerator.cpp |
@@ -35,12 +35,14 @@ public: |
const SkImageInfo fInfo; |
const int fSampleSize; |
const bool fDitherImage; |
+ const bool fRequireUnpremul; |
reed1
2014/04/07 18:21:12
why isn't this deducible from fInfo?
scroggo
2014/04/07 19:00:12
Done. (I'm actually deducing it from the passed in
|
DecodingImageGenerator(SkData* data, |
SkStreamRewindable* stream, |
const SkImageInfo& info, |
int sampleSize, |
- bool ditherImage); |
+ bool ditherImage, |
+ bool requireUnpremul); |
typedef SkImageGenerator INHERITED; |
}; |
@@ -107,12 +109,14 @@ DecodingImageGenerator::DecodingImageGenerator( |
SkStreamRewindable* stream, |
const SkImageInfo& info, |
int sampleSize, |
- bool ditherImage) |
+ bool ditherImage, |
+ bool requireUnpremul) |
: fData(data) |
, fStream(stream) |
, fInfo(info) |
, fSampleSize(sampleSize) |
, fDitherImage(ditherImage) |
+ , fRequireUnpremul(requireUnpremul) |
{ |
SkASSERT(stream != NULL); |
SkSafeRef(fData); // may be NULL. |
@@ -175,6 +179,7 @@ bool DecodingImageGenerator::getPixels(const SkImageInfo& info, |
} |
decoder->setDitherImage(fDitherImage); |
decoder->setSampleSize(fSampleSize); |
+ decoder->setRequireUnpremultipliedColors(fRequireUnpremul); |
SkBitmap bitmap; |
TargetAllocator allocator(fInfo, pixels, rowBytes); |
@@ -250,7 +255,8 @@ SkImageGenerator* CreateDecodingImageGenerator( |
} |
return SkNEW_ARGS(DecodingImageGenerator, |
(data, autoStream.detach(), info, |
- opts.fSampleSize, opts.fDitherImage)); |
+ opts.fSampleSize, opts.fDitherImage, |
+ opts.fRequireUnpremul)); |
} |
} // namespace |