aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/GrSurfaceProxy.cpp11
-rw-r--r--tests/ResourceAllocatorTest.cpp4
-rw-r--r--tests/TextureProxyTest.cpp6
3 files changed, 18 insertions, 3 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 9cc3036268..0cc3621572 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -267,6 +267,7 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceP
GrSurfaceDesc copyDesc = desc;
copyDesc.fSampleCnt = caps->getSampleCount(desc.fSampleCnt, desc.fConfig);
+#ifdef SK_DISABLE_DEFERRED_PROXIES
// Temporarily force instantiation for crbug.com/769760
if (willBeRT) {
// We know anything we instantiate later from this deferred path will be
@@ -286,6 +287,16 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceP
}
return nullptr;
+#else
+ if (willBeRT) {
+ // We know anything we instantiate later from this deferred path will be
+ // both texturable and renderable
+ return sk_sp<GrTextureProxy>(new GrTextureRenderTargetProxy(*caps, copyDesc, fit,
+ budgeted, flags));
+ }
+
+ return sk_sp<GrTextureProxy>(new GrTextureProxy(copyDesc, fit, budgeted, nullptr, 0, flags));
+#endif
}
sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceProvider,
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp
index bceb7cb6b9..7af0d03a35 100644
--- a/tests/ResourceAllocatorTest.cpp
+++ b/tests/ResourceAllocatorTest.cpp
@@ -8,7 +8,8 @@
// Include here to ensure SK_SUPPORT_GPU is set correctly before it is examined.
#include "SkTypes.h"
-#if 0
+#if SK_SUPPORT_GPU
+#ifndef SK_DISABLE_DEFERRED_PROXIES
#include "Test.h"
#include "GrContextPriv.h"
@@ -198,3 +199,4 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) {
}
#endif
+#endif
diff --git a/tests/TextureProxyTest.cpp b/tests/TextureProxyTest.cpp
index c4493904c0..d2277890c2 100644
--- a/tests/TextureProxyTest.cpp
+++ b/tests/TextureProxyTest.cpp
@@ -254,7 +254,7 @@ static void invalidation_test(GrContext* context, skiatest::Reporter* reporter)
REPORTER_ASSERT(reporter, 0 == cache->getResourceCount());
}
-#if 0
+#ifndef SK_DISABLE_DEFERRED_PROXIES
// Test if invalidating unique ids prior to instantiating operates as expected
static void invalidation_and_instantiation_test(GrContext* context, skiatest::Reporter* reporter) {
GrResourceProvider* provider = context->resourceProvider();
@@ -318,7 +318,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TextureProxyTest, reporter, ctxInfo) {
}
invalidation_test(context, reporter);
- //invalidation_and_instantiation_test(context, reporter);
+#ifndef SK_DISABLE_DEFERRED_PROXIES
+ invalidation_and_instantiation_test(context, reporter);
+#endif
}
#endif