Move explicit backend object allocation API to GrContext
This initial portion of the API should be ready to go. Follow on CLs will add the other entry points.
Change-Id: Ia9c708046ba08b16f9a71558e2bf2c38279abe5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/tools/DDLPromiseImageHelper.cpp b/tools/DDLPromiseImageHelper.cpp
index 80cf64c..799efc0 100644
--- a/tools/DDLPromiseImageHelper.cpp
+++ b/tools/DDLPromiseImageHelper.cpp
@@ -24,7 +24,7 @@
SkASSERT(!fTotalFulfills || fDoneCnt);
if (fPromiseImageTexture) {
- fContext->priv().deleteBackendTexture(fPromiseImageTexture->backendTexture());
+ fContext->deleteBackendTexture(fPromiseImageTexture->backendTexture());
}
}
diff --git a/tools/fm/fm.cpp b/tools/fm/fm.cpp
index d5d15d1..7f30a26 100644
--- a/tools/fm/fm.cpp
+++ b/tools/fm/fm.cpp
@@ -280,11 +280,11 @@
break;
case SurfaceType::kBackendTexture:
- backendTexture = context->priv().createBackendTexture(info.width(),
- info.height(),
- info.colorType(),
- GrMipMapped::kNo,
- GrRenderable::kYes);
+ backendTexture = context->createBackendTexture(info.width(),
+ info.height(),
+ info.colorType(),
+ GrMipMapped::kNo,
+ GrRenderable::kYes);
surface = SkSurface::MakeFromBackendTexture(context,
backendTexture,
kTopLeft_GrSurfaceOrigin,
@@ -331,7 +331,7 @@
if (!context->abandoned()) {
surface.reset();
if (backendTexture.isValid()) {
- context->priv().deleteBackendTexture(backendTexture);
+ context->deleteBackendTexture(backendTexture);
}
if (backendRT.isValid()) {
context->priv().getGpu()->deleteTestingOnlyBackendRenderTarget(backendRT);
diff --git a/tools/gpu/ProxyUtils.cpp b/tools/gpu/ProxyUtils.cpp
index 9e01b17..d3cc1f1 100644
--- a/tools/gpu/ProxyUtils.cpp
+++ b/tools/gpu/ProxyUtils.cpp
@@ -34,7 +34,7 @@
sk_sp<GrTextureProxy> proxy;
if (kBottomLeft_GrSurfaceOrigin == origin) {
// We (soon will) only support using kBottomLeft with wrapped textures.
- auto backendTex = context->priv().createBackendTexture(
+ auto backendTex = context->createBackendTexture(
width, height, format, GrMipMapped::kNo, renderable);
if (!backendTex.isValid()) {
return nullptr;
@@ -51,7 +51,7 @@
}
if (!proxy) {
- context->priv().deleteBackendTexture(backendTex);
+ context->deleteBackendTexture(backendTex);
return nullptr;
}