Propagate GrRenderable flag to GrCaps::getBackendFormatFromColorType

This makes calling GrCaps::getBackendFormatFromColorType equivalent to calling GrContext::defaultBackendFormat

Change-Id: Ic402245fa0502920c47c2a29aadc4e559abdc09b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230416
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index 8123864..4dd831d 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -34,19 +34,25 @@
     REPORTER_ASSERT(reporter, actualBackingRefs == expectedBackingRefs);
 }
 
-static sk_sp<GrTextureProxy> make_deferred(GrProxyProvider* proxyProvider, const GrCaps* caps) {
+static sk_sp<GrTextureProxy> make_deferred(GrContext* context) {
+    GrProxyProvider* proxyProvider = context->priv().proxyProvider();
+    const GrCaps* caps = context->priv().caps();
+
     GrSurfaceDesc desc;
     desc.fWidth = kWidthHeight;
     desc.fHeight = kWidthHeight;
     desc.fConfig = kRGBA_8888_GrPixelConfig;
 
-    const GrBackendFormat format = caps->getBackendFormatFromColorType(GrColorType::kRGBA_8888);
+    const GrBackendFormat format = caps->getDefaultBackendFormat(GrColorType::kRGBA_8888,
+                                                                 GrRenderable::kYes);
     return proxyProvider->createProxy(format, desc, GrRenderable::kYes, 1,
                                       kBottomLeft_GrSurfaceOrigin, SkBackingFit::kApprox,
                                       SkBudgeted::kYes, GrProtected::kNo);
 }
 
-static sk_sp<GrTextureProxy> make_wrapped(GrProxyProvider* proxyProvider, const GrCaps* caps) {
+static sk_sp<GrTextureProxy> make_wrapped(GrContext* context) {
+    GrProxyProvider* proxyProvider = context->priv().proxyProvider();
+
     GrSurfaceDesc desc;
     desc.fWidth = kWidthHeight;
     desc.fHeight = kWidthHeight;
@@ -58,14 +64,12 @@
 }
 
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ProxyRefTest, reporter, ctxInfo) {
-    GrProxyProvider* proxyProvider = ctxInfo.grContext()->priv().proxyProvider();
     GrResourceProvider* resourceProvider = ctxInfo.grContext()->priv().resourceProvider();
-    const GrCaps* caps = ctxInfo.grContext()->priv().caps();
 
     for (auto make : { make_deferred, make_wrapped }) {
         // Pending IO ref
         {
-            sk_sp<GrTextureProxy> proxy((*make)(proxyProvider, caps));
+            sk_sp<GrTextureProxy> proxy((*make)(ctxInfo.grContext()));
             if (proxy.get()) {
                 GrProxyPendingIO pendingIO(proxy.get());
 
@@ -82,7 +86,7 @@
 
         // Multiple normal refs
         {
-            sk_sp<GrTextureProxy> proxy((*make)(proxyProvider, caps));
+            sk_sp<GrTextureProxy> proxy((*make)(ctxInfo.grContext()));
             if (proxy.get()) {
                 proxy->ref();
                 proxy->ref();
@@ -103,7 +107,7 @@
 
         // Continue using (reffing) proxy after instantiation
         {
-            sk_sp<GrTextureProxy> proxy((*make)(proxyProvider, caps));
+            sk_sp<GrTextureProxy> proxy((*make)(ctxInfo.grContext()));
             if (proxy.get()) {
                 proxy->ref();