Pipe all SDC creation through the recording context
In the new GrSurfaceContext class hierarchy we can get either a v1 or v2 SFC/SDC depending on the context options setting.
Bug: skia:11837
Change-Id: Ia25bc10b58bbbaf65a484b323d9d0eee471bb7ef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/435276
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/GrDirectContextPriv.cpp b/src/gpu/GrDirectContextPriv.cpp
index ba08749..cfd91c3 100644
--- a/src/gpu/GrDirectContextPriv.cpp
+++ b/src/gpu/GrDirectContextPriv.cpp
@@ -251,8 +251,8 @@
SkImageInfo::Make(kSize, kSize, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
const SkImageInfo upmII = pmII.makeAlphaType(kUnpremul_SkAlphaType);
- auto readSFC = GrSurfaceFillContext::Make(dContext, upmII, SkBackingFit::kExact);
- auto tempSFC = GrSurfaceFillContext::Make(dContext, pmII, SkBackingFit::kExact);
+ auto readSFC = dContext->priv().makeSFC(upmII, SkBackingFit::kExact);
+ auto tempSFC = dContext->priv().makeSFC(pmII, SkBackingFit::kExact);
if (!readSFC || !tempSFC) {
return false;
}
@@ -368,3 +368,44 @@
mipmapped, isProtected,
origin, props, init);
}
+
+std::unique_ptr<GrSurfaceContext> GrDirectContextPriv::makeSC(GrSurfaceProxyView readView,
+ const GrColorInfo& info) {
+ return fContext->GrRecordingContext::priv().makeSC(readView, info);
+}
+
+std::unique_ptr<GrSurfaceFillContext> GrDirectContextPriv::makeSFC(GrImageInfo info,
+ SkBackingFit fit,
+ int sampleCount,
+ GrMipmapped mipmapped,
+ GrProtected isProtected,
+ GrSurfaceOrigin origin,
+ SkBudgeted budgeted) {
+ return fContext->GrRecordingContext::priv().makeSFC(info, fit, sampleCount, mipmapped,
+ isProtected, origin, budgeted);
+}
+
+std::unique_ptr<GrSurfaceFillContext> GrDirectContextPriv::makeSFCWithFallback(
+ GrImageInfo info,
+ SkBackingFit fit,
+ int sampleCount,
+ GrMipmapped mipmapped,
+ GrProtected isProtected,
+ GrSurfaceOrigin origin,
+ SkBudgeted budgeted) {
+ return fContext->GrRecordingContext::priv().makeSFCWithFallback(info, fit, sampleCount,
+ mipmapped, isProtected,
+ origin, budgeted);
+}
+
+std::unique_ptr<GrSurfaceFillContext> GrDirectContextPriv::makeSFCFromBackendTexture(
+ GrColorInfo info,
+ const GrBackendTexture& tex,
+ int sampleCount,
+ GrSurfaceOrigin origin,
+ sk_sp<GrRefCntedCallback> releaseHelper) {
+ return fContext->GrRecordingContext::priv().makeSFCFromBackendTexture(info, tex, sampleCount,
+ origin,
+ std::move(releaseHelper));
+
+}