aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrResourceProvider.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-09-21 14:25:31 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-21 19:16:26 +0000
commit0f17181047031bebf96b7e223b1520e027b119a6 (patch)
tree3ca4a74b36c0c2952a629181212402479281f378 /src/gpu/GrResourceProvider.cpp
parent780f5bfdfefafacf7670573ac20c5394a55cadc6 (diff)
Guard resource provider path creation methods against abandoned context
Change-Id: Idb447352d1c39b14137e8bb5af4f3c8fd7378750 Reviewed-on: https://skia-review.googlesource.com/49767 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrResourceProvider.cpp')
-rw-r--r--src/gpu/GrResourceProvider.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 7e7fef4661..933f732a2a 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -352,12 +352,20 @@ const GrBuffer* GrResourceProvider::createQuadIndexBuffer() {
int GrResourceProvider::QuadCountOfQuadBuffer() { return kMaxQuads; }
sk_sp<GrPath> GrResourceProvider::createPath(const SkPath& path, const GrStyle& style) {
+ if (this->isAbandoned()) {
+ return nullptr;
+ }
+
SkASSERT(this->gpu()->pathRendering());
return this->gpu()->pathRendering()->createPath(path, style);
}
sk_sp<GrPathRange> GrResourceProvider::createPathRange(GrPathRange::PathGenerator* gen,
const GrStyle& style) {
+ if (this->isAbandoned()) {
+ return nullptr;
+ }
+
SkASSERT(this->gpu()->pathRendering());
return this->gpu()->pathRendering()->createPathRange(gen, style);
}