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/src/gpu/ops/GrLatticeOp.cpp b/src/gpu/ops/GrLatticeOp.cpp
index d53f8f9..4b9a09a 100644
--- a/src/gpu/ops/GrLatticeOp.cpp
+++ b/src/gpu/ops/GrLatticeOp.cpp
@@ -404,10 +404,11 @@
desc.fConfig = kRGBA_8888_GrPixelConfig;
desc.fWidth = random->nextRangeU(1, 1000);
desc.fHeight = random->nextRangeU(1, 1000);
- GrSurfaceOrigin origin =
- random->nextBool() ? kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin;
+ GrSurfaceOrigin origin = random->nextBool() ? kTopLeft_GrSurfaceOrigin
+ : kBottomLeft_GrSurfaceOrigin;
const GrBackendFormat format =
- context->priv().caps()->getBackendFormatFromColorType(GrColorType::kRGBA_8888);
+ context->priv().caps()->getDefaultBackendFormat(GrColorType::kRGBA_8888,
+ GrRenderable::kNo);
auto proxy = context->priv().proxyProvider()->createProxy(format, desc, GrRenderable::kNo, 1,
origin, SkBackingFit::kExact,
SkBudgeted::kYes, GrProtected::kNo);
diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp
index c9c3d08..f6a3705 100644
--- a/src/gpu/ops/GrSmallPathRenderer.cpp
+++ b/src/gpu/ops/GrSmallPathRenderer.cpp
@@ -874,9 +874,8 @@
SkASSERT(!args.fShape->isEmpty());
SkASSERT(args.fShape->hasUnstyledKey());
if (!fAtlas) {
- const GrBackendFormat format =
- args.fContext->priv().caps()->getBackendFormatFromColorType(
- GrColorType::kAlpha_8);
+ const GrBackendFormat format = args.fContext->priv().caps()->getDefaultBackendFormat(
+ GrColorType::kAlpha_8, GrRenderable::kNo);
fAtlas = GrDrawOpAtlas::Make(args.fContext->priv().proxyProvider(),
format,
GrColorType::kAlpha_8,
@@ -965,8 +964,8 @@
if (context->priv().contextID() != gTestStruct.fContextID) {
gTestStruct.fContextID = context->priv().contextID();
gTestStruct.reset();
- const GrBackendFormat format =
- context->priv().caps()->getBackendFormatFromColorType(GrColorType::kAlpha_8);
+ const GrBackendFormat format = context->priv().caps()->getDefaultBackendFormat(
+ GrColorType::kAlpha_8, GrRenderable::kNo);
gTestStruct.fAtlas = GrDrawOpAtlas::Make(context->priv().proxyProvider(),
format, GrColorType::kAlpha_8,
ATLAS_TEXTURE_WIDTH, ATLAS_TEXTURE_HEIGHT,
diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp
index 8b7d8c1..e7bf602 100644
--- a/src/gpu/ops/GrTextureOp.cpp
+++ b/src/gpu/ops/GrTextureOp.cpp
@@ -688,9 +688,9 @@
if (mipMapped == GrMipMapped::kNo) {
fit = random->nextBool() ? SkBackingFit::kApprox : SkBackingFit::kExact;
}
-
const GrBackendFormat format =
- context->priv().caps()->getBackendFormatFromColorType(GrColorType::kRGBA_8888);
+ context->priv().caps()->getDefaultBackendFormat(GrColorType::kRGBA_8888,
+ GrRenderable::kNo);
GrProxyProvider* proxyProvider = context->priv().proxyProvider();
sk_sp<GrTextureProxy> proxy = proxyProvider->createProxy(