summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2020-02-07 14:27:15 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-02-07 14:27:15 +0000
commitcbeeff9e2e890982557b6a85e33eccb96d3ea921 (patch)
treeecdc54ad9f1636b2c9e743923f705b34defdd130 /native
parent83b29756351065db6e7cd7780e9b8e54c5cc21fe (diff)
parent6eeca5c776d95067d5e796b02cf11b8a755b4efc (diff)
Merge "AImageDecoder: allow no color conversion"
Diffstat (limited to 'native')
-rw-r--r--native/graphics/jni/imagedecoder.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/native/graphics/jni/imagedecoder.cpp b/native/graphics/jni/imagedecoder.cpp
index c1143ce9c3dc..2e4d2140809e 100644
--- a/native/graphics/jni/imagedecoder.cpp
+++ b/native/graphics/jni/imagedecoder.cpp
@@ -213,12 +213,12 @@ int32_t AImageDecoderHeaderInfo_getDataSpace(const AImageDecoderHeaderInfo* info
return ANDROID_IMAGE_DECODER_BAD_PARAMETER;
}
- // Note: This recomputes the data space because it's possible the client has
- // changed the output color space, so we cannot rely on it. Alternatively,
+ // Note: This recomputes the color type because it's possible the client has
+ // changed the output color type, so we cannot rely on it. Alternatively,
// we could store the ADataSpace in the ImageDecoder.
const ImageDecoder* imageDecoder = toDecoder(info);
SkColorType colorType = imageDecoder->mCodec->computeOutputColorType(kN32_SkColorType);
- sk_sp<SkColorSpace> colorSpace = imageDecoder->mCodec->computeOutputColorSpace(colorType);
+ sk_sp<SkColorSpace> colorSpace = imageDecoder->getDefaultColorSpace();
return uirenderer::ColorSpaceToADataSpace(colorSpace.get(), colorType);
}