summaryrefslogtreecommitdiff
path: root/libs/hwui/jni/ImageDecoder.cpp
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2021-01-15 14:09:13 -0500
committerLeon Scroggins III <scroggo@google.com>2021-01-19 09:57:35 -0500
commit5a5c2ce593384bec4fc6982976ec11afa18afe8f (patch)
tree3fd09046fd7b88f92c006d59a7bd25658b9ec69a /libs/hwui/jni/ImageDecoder.cpp
parentba9a690d26e258b8c00f71b6ffc6e371aa155a7f (diff)
(A)ImageDecoder: fix sampled dimensions with exif
Test: I138ec784a77253c7ae94765d0670e5947d97caf5 Recently (Ib93b0ced09fa3cca4a6681745406355c48158fae), handling exif moved from SkAndroidCodec to hwui/ImageDecoder. This missed getSampledDimensions, which reports the sampled dimensions without taking exif into account. Fix this for both android.graphics.ImageDecoder and AImageDecoder. Note that in the Java case, the method is private, and although the method was returning swapped dimensions in some cases, it gets corrected by getTargetDimension, so there is no user visible change. Change-Id: I918328c39d6230ae6ba4cab0733fff0732b39888
Diffstat (limited to 'libs/hwui/jni/ImageDecoder.cpp')
-rw-r--r--libs/hwui/jni/ImageDecoder.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/jni/ImageDecoder.cpp b/libs/hwui/jni/ImageDecoder.cpp
index 96e912fd9f26..ad7741b61e9f 100644
--- a/libs/hwui/jni/ImageDecoder.cpp
+++ b/libs/hwui/jni/ImageDecoder.cpp
@@ -465,7 +465,7 @@ static jobject ImageDecoder_nDecodeBitmap(JNIEnv* env, jobject /*clazz*/, jlong
static jobject ImageDecoder_nGetSampledSize(JNIEnv* env, jobject /*clazz*/, jlong nativePtr,
jint sampleSize) {
auto* decoder = reinterpret_cast<ImageDecoder*>(nativePtr);
- SkISize size = decoder->mCodec->getSampledDimensions(sampleSize);
+ SkISize size = decoder->getSampledDimensions(sampleSize);
return env->NewObject(gSize_class, gSize_constructorMethodID, size.width(), size.height());
}