Move GetFallbackColorTypeAndFormat to GrCaps
This just reduces the usage of GrSurfaceFillContext
Bug: skia:11837
Change-Id: I0fd0b169dbca24901d22421a4c0f13219c44cb3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416797
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index 1b25b06..8eb66f2 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -25,7 +25,6 @@
#include "src/gpu/GrImageContextPriv.h"
#include "src/gpu/GrRenderTarget.h"
#include "src/gpu/GrResourceProvider.h"
-#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrSurfaceProxy.h"
#include "src/gpu/GrSurfaceProxyPriv.h"
#include "src/gpu/GrTexture.h"
@@ -243,14 +242,15 @@
if (!proxy) {
return {};
}
+ const GrCaps* caps = fImageContext->priv().caps();
+
// Assume that we used a fallback color type if and only if the proxy is renderable.
if (proxy->asRenderTargetProxy()) {
GrBackendFormat expectedFormat;
- std::tie(ct, expectedFormat) =
- GrSurfaceFillContext::GetFallbackColorTypeAndFormat(fImageContext, ct, sampleCnt);
+ std::tie(ct, expectedFormat) = caps->getFallbackColorTypeAndFormat(ct, sampleCnt);
SkASSERT(expectedFormat == proxy->backendFormat());
}
- GrSwizzle swizzle = fImageContext->priv().caps()->getReadSwizzle(proxy->backendFormat(), ct);
+ GrSwizzle swizzle = caps->getReadSwizzle(proxy->backendFormat(), ct);
return {std::move(proxy), origin, swizzle};
}