diff options
author | 2017-06-05 10:45:30 -0400 | |
---|---|---|
committer | 2017-06-05 15:13:40 +0000 | |
commit | d3df9ec874b2668111b36ce0993d860b4f88c765 (patch) | |
tree | 693ad2138c2fe4facd362eee8289af1a811f60e3 /src/image/SkImage.cpp | |
parent | d81fed9ce2b9c8f2f227cf74c2578b90aafbe196 (diff) |
SkImage::makeColorSpace(): Fix nullptr->sRGB bug with picture images
Bug: 729352
Change-Id: I5ad5e2121ce87dc154528bfd9ec0f3e9253ed792
Reviewed-on: https://skia-review.googlesource.com/18590
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/image/SkImage.cpp')
-rw-r--r-- | src/image/SkImage.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp index 3e525b399c..858aa9b029 100644 --- a/src/image/SkImage.cpp +++ b/src/image/SkImage.cpp @@ -307,10 +307,9 @@ sk_sp<SkImage> SkImage::makeColorSpace(sk_sp<SkColorSpace> target, } // No need to create a new image if: - // (1) The color spaces are equal (nullptr is considered to be sRGB). + // (1) The color spaces are equal. // (2) The color type is kAlpha8. - if ((!this->colorSpace() && target->isSRGB()) || - SkColorSpace::Equals(this->colorSpace(), target.get()) || + if (SkColorSpace::Equals(this->colorSpace(), target.get()) || kAlpha_8_SkColorType == as_IB(this)->onImageInfo().colorType()) { return sk_ref_sp(const_cast<SkImage*>(this)); } |