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 <msarett@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
This commit is contained in:
Matt Sarett 2017-04-14 09:23:45 -04:00 committed by Skia Commit-Bot
parent 7a34dca6c8
commit 479366cd14
2 changed files with 15 additions and 0 deletions

View File

@ -71,6 +71,12 @@ public:
virtual SkEncodedImageFormat getEncodedFormat() = 0;
virtual SkColorType computeOutputColorType(SkColorType requestedColorType) = 0;
virtual sk_sp<SkColorSpace> computeOutputColorSpace(SkColorType outputColorType,
sk_sp<SkColorSpace> prefColorSpace = nullptr) = 0;
int width() const { return fWidth; }
int height() const { return fHeight; }

View File

@ -32,6 +32,15 @@ public:
SkEncodedImageFormat getEncodedFormat() override { return fCodec->getEncodedFormat(); }
SkColorType computeOutputColorType(SkColorType requestedColorType) override {
return fCodec->computeOutputColorType(requestedColorType);
}
sk_sp<SkColorSpace> computeOutputColorSpace(SkColorType outputColorType,
sk_sp<SkColorSpace> prefColorSpace = nullptr) override {
return fCodec->computeOutputColorSpace(outputColorType, prefColorSpace);
}
private:
std::unique_ptr<SkAndroidCodec> fCodec;