aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkSpecialSurface.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-11-18 08:44:13 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-18 14:26:48 +0000
commit833dcf48844dd053ddf7ecea20e3e1c2b6b47e01 (patch)
tree6d7726179687c027c9ab65cc02bfb4155caf7488 /src/core/SkSpecialSurface.cpp
parenteaef615377bc5347bfcf3c3da0b6ad922441a317 (diff)
Add handling for instantiate failure up the call stack
The following two CLs were created via grep: https://skia-review.googlesource.com/c/4929/ (Guard against instantiate & accessRenderTarget failures) https://skia-review.googlesource.com/c/4961/ (Remove accessRenderTarget call in SkGpuDevice ctor) This CL was created by running through all the tests and having instantiate fail so it catches up-stack failures to handle a null return. BUG=665681,665500,665621 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4991 Change-Id: I6611eec8d36679123eef140538ee2526fb18628f Reviewed-on: https://skia-review.googlesource.com/4991 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/core/SkSpecialSurface.cpp')
-rw-r--r--src/core/SkSpecialSurface.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/SkSpecialSurface.cpp b/src/core/SkSpecialSurface.cpp
index f0c66ae1d7..956300cb3e 100644
--- a/src/core/SkSpecialSurface.cpp
+++ b/src/core/SkSpecialSurface.cpp
@@ -136,6 +136,9 @@ public:
~SkSpecialSurface_Gpu() override { }
sk_sp<SkSpecialImage> onMakeImageSnapshot() override {
+ if (!fRenderTargetContext->asTexture()) {
+ return nullptr;
+ }
sk_sp<SkSpecialImage> tmp(SkSpecialImage::MakeFromGpu(
this->subset(),
kNeedNewImageUniqueID_SpecialImage,