aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProxyProvider.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-31 09:29:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-31 21:15:45 +0000
commitd5f9cdd4b3a6ab0e49bb1a56f2e52e2f40edd0fa (patch)
tree6dce4e0c8b1d00eaef4514cb426790a0d75c73c2 /src/gpu/GrProxyProvider.cpp
parent9c17391cef1b0903a3240a50557e20fe68a7f42d (diff)
Add SkSurface_Gpu::MakeWrappedRenderTarget method
This is pulled out of https://skia-review.googlesource.com/c/skia/+/101480 (Implement GPU/OpList DDLs) Change-Id: I12b1ac346c7c1fa10f2120bc92bee63c93fc2249 Reviewed-on: https://skia-review.googlesource.com/102101 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrProxyProvider.cpp')
-rw-r--r--src/gpu/GrProxyProvider.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index 5bb58af36f..604dd1bb32 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -54,7 +54,7 @@ bool GrProxyProvider::assignUniqueKeyToProxy(const GrUniqueKey& key, GrTexturePr
// If there is already a GrResource with this key then the caller has violated the normal
// usage pattern of uniquely keyed resources (e.g., they have created one w/o first seeing
// if it already existed in the cache).
- SkASSERT(!fResourceCache->findAndRefUniqueResource(key));
+ SkASSERT(!fResourceCache || !fResourceCache->findAndRefUniqueResource(key));
// Uncached resources can never have a unique key, unless they're wrapped resources. Wrapped
// resources are a special case: the unique keys give us a weak ref so that we can reuse the
@@ -133,6 +133,10 @@ sk_sp<GrTextureProxy> GrProxyProvider::findOrCreateProxyByUniqueKey(const GrUniq
return result;
}
+ if (!fResourceCache) {
+ return nullptr;
+ }
+
GrGpuResource* resource = fResourceCache->findAndRefUniqueResource(key);
if (!resource) {
return nullptr;