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

Unified Diff: src/images/SkDecodingImageGenerator.cpp

Issue 223903007: Add option to SkDecodingImageGenerator to require unpremul. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, leave headers in src/ for now. 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 | « src/images/SkDecodingImageGenerator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/images/SkDecodingImageGenerator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698