aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-02-21 13:02:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-21 18:22:47 +0000
commit0a7aa14bf36cbb444b84902a37591d7a9c84fbd0 (patch)
treeaa2769ad071df6f5250a00be9a67ef0c6baf4d44 /src/gpu/SkGpuDevice.cpp
parent32f72e25bd802d15ce43a3dd7ef4a3fcfd646727 (diff)
Add checks for failed SkImageInfo2GrPixelConfig calls
Bug: skia:7645 Change-Id: I32b9326fb43490ef6a7a99527243b68d89184ae1 Reviewed-on: https://skia-review.googlesource.com/109083 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 9a01394691..bc5a34b132 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -159,6 +159,9 @@ sk_sp<GrRenderTargetContext> SkGpuDevice::MakeRenderTargetContext(
}
GrPixelConfig config = SkImageInfo2GrPixelConfig(origInfo, *context->caps());
+ if (kUnknown_GrPixelConfig == config) {
+ return nullptr;
+ }
// This method is used to create SkGpuDevice's for SkSurface_Gpus. In this case
// they need to be exact.
return context->makeDeferredRenderTargetContext(