aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/android/SkBitmapRegionCodec.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-04-11 09:51:32 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-11 14:27:28 +0000
commit68feef423dfa1f3e2e6e9b0f4df1027f6e8645b1 (patch)
tree39da66c24218258f5b8abb1c64a7a236ab1529e4 /src/android/SkBitmapRegionCodec.cpp
parent3fbca26e9c0e6e3c27c9dd437c9f790a31f20675 (diff)
Allow BF and BRD clients to request an output color space
Bug: skia: Change-Id: I0f0d3bfdd5c47544ab71167fd7984ee8e8ac5903 Reviewed-on: https://skia-review.googlesource.com/11601 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'src/android/SkBitmapRegionCodec.cpp')
-rw-r--r--src/android/SkBitmapRegionCodec.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/android/SkBitmapRegionCodec.cpp b/src/android/SkBitmapRegionCodec.cpp
index ffe7ea81f8..7ce9d26b4d 100644
--- a/src/android/SkBitmapRegionCodec.cpp
+++ b/src/android/SkBitmapRegionCodec.cpp
@@ -18,7 +18,7 @@ SkBitmapRegionCodec::SkBitmapRegionCodec(SkAndroidCodec* codec)
bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocator,
const SkIRect& desiredSubset, int sampleSize, SkColorType prefColorType,
- bool requireUnpremul) {
+ bool requireUnpremul, sk_sp<SkColorSpace> prefColorSpace) {
// Fix the input sampleSize if necessary.
if (sampleSize < 1) {
@@ -52,7 +52,8 @@ bool SkBitmapRegionCodec::decodeRegion(SkBitmap* bitmap, SkBRDAllocator* allocat
// Create the image info for the decode
SkColorType dstColorType = fCodec->computeOutputColorType(prefColorType);
SkAlphaType dstAlphaType = fCodec->computeOutputAlphaType(requireUnpremul);
- sk_sp<SkColorSpace> dstColorSpace = fCodec->computeOutputColorSpace(dstColorType);
+ sk_sp<SkColorSpace> dstColorSpace = fCodec->computeOutputColorSpace(dstColorType,
+ prefColorSpace);
SkImageInfo decodeInfo = SkImageInfo::Make(scaledSize.width(), scaledSize.height(),
dstColorType, dstAlphaType, dstColorSpace);