Disable deferred proxies for M60 branch
Bug: 720325
Change-Id: I0529bbcd592bdc5d5a741731af8a66971e485649
Reviewed-on: https://skia-review.googlesource.com/18239
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h
index 4ae041d..be8c194 100644
--- a/include/private/GrSurfaceProxy.h
+++ b/include/private/GrSurfaceProxy.h
@@ -24,6 +24,8 @@
class GrTextureOpList;
class GrTextureProxy;
+//#define SK_DISABLE_DEFERRED_PROXIES 1
+
// This class replicates the functionality GrIORef<GrSurface> but tracks the
// utilitization for later resource allocation (for the deferred case) and
// forwards on the utilization in the wrapped case
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 0d9198fd..2577fc8 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -168,6 +168,21 @@
GrSurfaceDesc copyDesc = desc;
copyDesc.fSampleCnt = SkTMin(desc.fSampleCnt, caps->maxSampleCount());
+#ifdef SK_DISABLE_DEFERRED_PROXIES
+ sk_sp<GrTexture> tex;
+
+ if (SkBackingFit::kApprox == fit) {
+ tex.reset(resourceProvider->createApproxTexture(copyDesc, flags));
+ } else {
+ tex = resourceProvider->createTexture(copyDesc, budgeted, flags);
+ }
+
+ if (!tex) {
+ return nullptr;
+ }
+
+ return GrSurfaceProxy::MakeWrapped(std::move(tex));
+#else
if (willBeRT) {
// We know anything we instantiate later from this deferred path will be
// both texturable and renderable
@@ -176,6 +191,7 @@
}
return sk_sp<GrTextureProxy>(new GrTextureProxy(copyDesc, fit, budgeted, nullptr, 0, flags));
+#endif
}
sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceProvider,
diff --git a/tests/DetermineDomainModeTest.cpp b/tests/DetermineDomainModeTest.cpp
index add746f..1ce38d3 100644
--- a/tests/DetermineDomainModeTest.cpp
+++ b/tests/DetermineDomainModeTest.cpp
@@ -341,6 +341,8 @@
insetAmount, halfFilterWidth, 0, name);
}
+#ifndef SK_DISABLE_DEFERRED_PROXIES
+
static void proxy_test(skiatest::Reporter* reporter, GrResourceProvider* resourceProvider) {
GrTextureProducer_TestAccess::DomainMode actualMode, expectedMode;
SkRect actualDomainRect;
@@ -444,3 +446,5 @@
}
#endif
+
+#endif
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index cd07e18..0775fde 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -45,6 +45,8 @@
return fPendingWrites;
}
+#ifndef SK_DISABLE_DEFERRED_PROXIES
+
static const int kWidthHeight = 128;
static void check_refs(skiatest::Reporter* reporter,
@@ -189,3 +191,5 @@
}
#endif
+
+#endif
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 1799a75..40cbeeb 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -10,6 +10,9 @@
#include "Test.h"
#if SK_SUPPORT_GPU
+
+#ifndef SK_DISABLE_DEFERRED_PROXIES
+
#include "GrBackendSurface.h"
#include "GrRenderTargetPriv.h"
#include "GrRenderTargetProxy.h"
@@ -307,3 +310,5 @@
}
#endif
+
+#endif