Remove GrSurface-based surfaceContext factories from GrContextPriv
This relies on both:
https://skia-review.googlesource.com/c/13001/ (Rm makeRenderTargetContext in favor of deferred version)
https://skia-review.googlesource.com/c/11125/ (Remove discard from GrRenderTarget & force it to always go through a RenderTargetContext)
Change-Id: Ia06469a6fa0048e162fb769ed4a11e4773cfacca
Reviewed-on: https://skia-review.googlesource.com/13130
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 128ef75..53b9b46 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -161,11 +161,14 @@
if (make_info(desc.fWidth, desc.fHeight, desc.fConfig, &srcInfo)) {
sk_sp<GrTexture> tex = this->getExactScratch(desc, budgeted, 0);
- sk_sp<GrSurfaceContext> sContext =
- context->contextPriv().makeWrappedSurfaceContext(std::move(tex));
- if (sContext) {
- if (sContext->writePixels(srcInfo, mipLevel.fPixels, mipLevel.fRowBytes, 0, 0)) {
- return sContext->asTextureProxyRef();
+ sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeWrapped(std::move(tex));
+ if (proxy) {
+ sk_sp<GrSurfaceContext> sContext =
+ context->contextPriv().makeWrappedSurfaceContext(std::move(proxy), nullptr);
+ if (sContext) {
+ if (sContext->writePixels(srcInfo, mipLevel.fPixels, mipLevel.fRowBytes, 0, 0)) {
+ return sContext->asTextureProxyRef();
+ }
}
}
}