aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/codec/SkCodecImageGenerator.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-08-22 08:48:40 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-22 08:48:40 -0700
commitdcd5e65340f9ef239d769bf20bafd2fa819eab31 (patch)
tree5597db8cdd3183f6ea8e9acb090887a90ba0f174 /src/codec/SkCodecImageGenerator.cpp
parentc0c6e1c5d133c51cc75ed9d5770fdc5448d8c324 (diff)
Support color xforms for kIndex8 pngs
This change started as: "Always use color xforms to premultiply". We need to be in a linear space to premultiply correctly. It became clear that we also need to support kIndex8 color xforms in order to make this change. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246143002 Review-Url: https://codereview.chromium.org/2246143002
Diffstat (limited to 'src/codec/SkCodecImageGenerator.cpp')
-rw-r--r--src/codec/SkCodecImageGenerator.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/codec/SkCodecImageGenerator.cpp b/src/codec/SkCodecImageGenerator.cpp
index e579da92f6..1bae1df856 100644
--- a/src/codec/SkCodecImageGenerator.cpp
+++ b/src/codec/SkCodecImageGenerator.cpp
@@ -37,7 +37,12 @@ SkData* SkCodecImageGenerator::onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) {
bool SkCodecImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
SkPMColor ctable[], int* ctableCount) {
- SkCodec::Result result = fCodec->getPixels(info, pixels, rowBytes, nullptr, ctable,
+ // FIXME (msarett):
+ // We don't give the client the chance to request an SkColorSpace. Until we improve
+ // the API, let's assume that they want legacy mode.
+ SkImageInfo decodeInfo = info.makeColorSpace(nullptr);
+
+ SkCodec::Result result = fCodec->getPixels(decodeInfo, pixels, rowBytes, nullptr, ctable,
ctableCount);
switch (result) {
case SkCodec::kSuccess: