aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureImageGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-01-09 15:59:17 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-09 21:40:27 +0000
commitf9436b8235620fd9baa5d341e37eedf9c306f68c (patch)
tree3feb7a32442a46462abb46dcf48159d6a6133aa1 /src/core/SkPictureImageGenerator.cpp
parent6294d3f79ecfb9355ce6d65305e28c5d60f4d05f (diff)
Allow constrained and unconstrained picture-images
BUG=skia: Change-Id: Id9b7b2c82c634fec50f9a57f4b59ce0c02e0706a Reviewed-on: https://skia-review.googlesource.com/6818 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src/core/SkPictureImageGenerator.cpp')
-rw-r--r--src/core/SkPictureImageGenerator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/SkPictureImageGenerator.cpp b/src/core/SkPictureImageGenerator.cpp
index 3a4749b480..762654af70 100644
--- a/src/core/SkPictureImageGenerator.cpp
+++ b/src/core/SkPictureImageGenerator.cpp
@@ -44,15 +44,15 @@ SkImageGenerator* SkPictureImageGenerator::Create(const SkISize& size, const SkP
const SkMatrix* matrix, const SkPaint* paint,
SkImage::BitDepth bitDepth,
sk_sp<SkColorSpace> colorSpace) {
- if (!picture || size.isEmpty() || !colorSpace) {
+ if (!picture || size.isEmpty()) {
return nullptr;
}
- if (SkImage::BitDepth::kF16 == bitDepth && !colorSpace->gammaIsLinear()) {
+ if (SkImage::BitDepth::kF16 == bitDepth && (!colorSpace || !colorSpace->gammaIsLinear())) {
return nullptr;
}
- if (!colorSpace->gammaCloseToSRGB() && !colorSpace->gammaIsLinear()) {
+ if (colorSpace && (!colorSpace->gammaCloseToSRGB() && !colorSpace->gammaIsLinear())) {
return nullptr;
}