From: Matt Sarett Date: Fri, 14 Apr 2017 13:23:45 +0000 (-0400) Subject: Let region decoders query the type and color space X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~36^2~793 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=479366cd148136dd0e5657ffc5816ab30f18fa3c;p=platform%2Fupstream%2FlibSkiaSharp.git Let region decoders query the type and color space b/36905374, b/32984164 Test: CtsGraphicsTestCases Written by: romainguy@ Change-Id: Ief4bba6ec3cd3446224199d05f06ffcffaaa72b5 Reviewed-on: https://skia-review.googlesource.com/13472 Reviewed-by: Matt Sarett Reviewed-by: Derek Sollenberger Commit-Queue: Matt Sarett --- diff --git a/include/android/SkBitmapRegionDecoder.h b/include/android/SkBitmapRegionDecoder.h index 841bf8d..df0c370 100644 --- a/include/android/SkBitmapRegionDecoder.h +++ b/include/android/SkBitmapRegionDecoder.h @@ -71,6 +71,12 @@ public: virtual SkEncodedImageFormat getEncodedFormat() = 0; + virtual SkColorType computeOutputColorType(SkColorType requestedColorType) = 0; + + virtual sk_sp computeOutputColorSpace(SkColorType outputColorType, + sk_sp prefColorSpace = nullptr) = 0; + + int width() const { return fWidth; } int height() const { return fHeight; } diff --git a/src/android/SkBitmapRegionCodec.h b/src/android/SkBitmapRegionCodec.h index baaecc9..a7cfe33 100644 --- a/src/android/SkBitmapRegionCodec.h +++ b/src/android/SkBitmapRegionCodec.h @@ -32,6 +32,15 @@ public: SkEncodedImageFormat getEncodedFormat() override { return fCodec->getEncodedFormat(); } + SkColorType computeOutputColorType(SkColorType requestedColorType) override { + return fCodec->computeOutputColorType(requestedColorType); + } + + sk_sp computeOutputColorSpace(SkColorType outputColorType, + sk_sp prefColorSpace = nullptr) override { + return fCodec->computeOutputColorSpace(outputColorType, prefColorSpace); + } + private: std::unique_ptr fCodec;