Loading libs/hwui/hwui/ImageDecoder.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,11 @@ static bool requires_matrix_scaling(bool swapWidthHeight, const SkISize& decodeS || (!swapWidthHeight && decodeSize != targetSize); } SkISize ImageDecoder::getSampledDimensions(int sampleSize) const { auto size = mCodec->getSampledDimensions(sampleSize); return swapWidthHeight() ? swapped(size) : size; } bool ImageDecoder::setTargetSize(int width, int height) { if (width <= 0 || height <= 0) { return false; Loading libs/hwui/hwui/ImageDecoder.h +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public: sk_sp<SkPngChunkReader> peeker = nullptr); ~ImageDecoder(); SkISize getSampledDimensions(int sampleSize) const; bool setTargetSize(int width, int height); bool setCropRect(const SkIRect*); Loading libs/hwui/jni/ImageDecoder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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()); } Loading native/graphics/jni/imagedecoder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -353,7 +353,7 @@ int AImageDecoder_computeSampledSize(const AImageDecoder* decoder, int sampleSiz return ANDROID_IMAGE_DECODER_BAD_PARAMETER; } SkISize size = toDecoder(decoder)->mCodec->getSampledDimensions(sampleSize); SkISize size = toDecoder(decoder)->getSampledDimensions(sampleSize); *width = size.width(); *height = size.height(); return ANDROID_IMAGE_DECODER_SUCCESS; Loading Loading
libs/hwui/hwui/ImageDecoder.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,11 @@ static bool requires_matrix_scaling(bool swapWidthHeight, const SkISize& decodeS || (!swapWidthHeight && decodeSize != targetSize); } SkISize ImageDecoder::getSampledDimensions(int sampleSize) const { auto size = mCodec->getSampledDimensions(sampleSize); return swapWidthHeight() ? swapped(size) : size; } bool ImageDecoder::setTargetSize(int width, int height) { if (width <= 0 || height <= 0) { return false; Loading
libs/hwui/hwui/ImageDecoder.h +1 −0 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public: sk_sp<SkPngChunkReader> peeker = nullptr); ~ImageDecoder(); SkISize getSampledDimensions(int sampleSize) const; bool setTargetSize(int width, int height); bool setCropRect(const SkIRect*); Loading
libs/hwui/jni/ImageDecoder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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()); } Loading
native/graphics/jni/imagedecoder.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -353,7 +353,7 @@ int AImageDecoder_computeSampledSize(const AImageDecoder* decoder, int sampleSiz return ANDROID_IMAGE_DECODER_BAD_PARAMETER; } SkISize size = toDecoder(decoder)->mCodec->getSampledDimensions(sampleSize); SkISize size = toDecoder(decoder)->getSampledDimensions(sampleSize); *width = size.width(); *height = size.height(); return ANDROID_IMAGE_DECODER_SUCCESS; Loading