[M62 cherry-pick] Disable deferred proxies a different way in Chrome
This keeps crbug.com/769760 working but also fixes the new bug (crbug.com/769898)
One can compare with https://skia-review.googlesource.com/c/skia/+/18592 ([M60 cherry-pick] Disable deferred proxies for M60 branch)
No-Tree-Checks: true
No-Try: true
No-Presubmit: true
Bug: 769898
Change-Id: Ic9a9f8cd540bda04624f79e679744ccb4feaa75f
Reviewed-on: https://skia-review.googlesource.com/59746
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index fd29fef..6bb5802 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -238,25 +238,20 @@
GrSurfaceDesc copyDesc = desc;
copyDesc.fSampleCnt = caps->getSampleCount(desc.fSampleCnt, desc.fConfig);
- // Temporarily force instantiation for crbug.com/769760
- if (willBeRT) {
- // We know anything we instantiate later from this deferred path will be
- // both texturable and renderable
- sk_sp<GrTextureProxy> temp(new GrTextureRenderTargetProxy(*caps, copyDesc, fit,
- budgeted, flags));
- if (temp && temp->instantiate(resourceProvider)) {
- return temp;
- }
+ // Temporarily force instantiation for crbug.com/769760 and crbug.com/769898
+ sk_sp<GrTexture> tex;
+ if (SkBackingFit::kApprox == fit) {
+ tex = resourceProvider->createApproxTexture(copyDesc, flags);
+ } else {
+ tex = resourceProvider->createTexture(copyDesc, budgeted, flags);
+ }
+
+ if (!tex) {
return nullptr;
}
- sk_sp<GrTextureProxy> temp(new GrTextureProxy(copyDesc, fit, budgeted, nullptr, 0, flags));
- if (temp && temp->instantiate(resourceProvider)) {
- return temp;
- }
-
- return nullptr;
+ return GrSurfaceProxy::MakeWrapped(std::move(tex), copyDesc.fOrigin);
}
sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceProvider,
diff --git a/tests/DetermineDomainModeTest.cpp b/tests/DetermineDomainModeTest.cpp
index ee9a694..70e6802 100644
--- a/tests/DetermineDomainModeTest.cpp
+++ b/tests/DetermineDomainModeTest.cpp
@@ -8,6 +8,7 @@
#include "Test.h"
#if SK_SUPPORT_GPU
+#if 0
#include "GrSurfaceProxy.h"
#include "GrTextureProducer.h"
@@ -445,3 +446,4 @@
}
#endif
+#endif
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index e605716..3afba6a 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -46,6 +46,7 @@
return fPendingWrites;
}
+#if 0
static const int kWidthHeight = 128;
static void check_refs(skiatest::Reporter* reporter,
@@ -192,3 +193,4 @@
}
#endif
+#endif
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 453cb5e..a6501dd 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -10,6 +10,7 @@
#include "Test.h"
#if SK_SUPPORT_GPU
+#if 0
#include "GrBackendSurface.h"
#include "GrRenderTargetPriv.h"
@@ -311,3 +312,4 @@
}
#endif
+#endif