From d83ec0441279b79551b4ecb4598696249ea55145 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Mon, 10 Apr 2017 11:10:22 -0400 Subject: Rm makeRenderTargetContext in favor of deferred version Change-Id: Ifdf67453607256ba7cdb0837263377bd83907212 Reviewed-on: https://skia-review.googlesource.com/13001 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- src/gpu/GrContext.cpp | 61 +++------------------------------------------------ 1 file changed, 3 insertions(+), 58 deletions(-) (limited to 'src/gpu/GrContext.cpp') diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index bfe094df7a..07ae6b226e 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -489,7 +489,7 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceProxy* srcProxy, SkColorSpace* sr // TODO: Need to decide the semantics of this function for color spaces. Do we support // conversion to a passed-in color space? For now, specifying nullptr means that this // path will do no conversion, so it will match the behavior of the non-draw path. - sk_sp tempRTC = fContext->makeRenderTargetContext( + sk_sp tempRTC = fContext->makeDeferredRenderTargetContext( tempDrawInfo.fTempSurfaceFit, tempDrawInfo.fTempSurfaceDesc.fWidth, tempDrawInfo.fTempSurfaceDesc.fHeight, @@ -776,23 +776,6 @@ static inline GrPixelConfig GrPixelConfigFallback(GrPixelConfig config) { } } -sk_sp GrContext::makeRenderTargetContextWithFallback( - SkBackingFit fit, - int width, int height, - GrPixelConfig config, - sk_sp colorSpace, - int sampleCnt, - GrSurfaceOrigin origin, - const SkSurfaceProps* surfaceProps, - SkBudgeted budgeted) { - if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) { - config = GrPixelConfigFallback(config); - } - - return this->makeRenderTargetContext(fit, width, height, config, std::move(colorSpace), - sampleCnt, origin, surfaceProps, budgeted); -} - sk_sp GrContext::makeDeferredRenderTargetContextWithFallback( SkBackingFit fit, int width, int height, @@ -810,46 +793,6 @@ sk_sp GrContext::makeDeferredRenderTargetContextWithFallb sampleCnt, origin, surfaceProps, budgeted); } -sk_sp GrContext::makeRenderTargetContext(SkBackingFit fit, - int width, int height, - GrPixelConfig config, - sk_sp colorSpace, - int sampleCnt, - GrSurfaceOrigin origin, - const SkSurfaceProps* surfaceProps, - SkBudgeted budgeted) { - if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) { - return nullptr; - } - - GrSurfaceDesc desc; - desc.fFlags = kRenderTarget_GrSurfaceFlag; - desc.fOrigin = origin; - desc.fWidth = width; - desc.fHeight = height; - desc.fConfig = config; - desc.fSampleCnt = sampleCnt; - - sk_sp tex; - if (SkBackingFit::kExact == fit) { - tex = this->resourceProvider()->createTexture(desc, budgeted); - } else { - tex.reset(this->resourceProvider()->createApproxTexture(desc, 0)); - } - if (!tex) { - return nullptr; - } - - sk_sp renderTargetContext( - this->contextPriv().makeWrappedRenderTargetContext(sk_ref_sp(tex->asRenderTarget()), - std::move(colorSpace), surfaceProps)); - if (!renderTargetContext) { - return nullptr; - } - - return renderTargetContext; -} - sk_sp GrContext::makeDeferredRenderTargetContext( SkBackingFit fit, int width, int height, @@ -859,6 +802,8 @@ sk_sp GrContext::makeDeferredRenderTargetContext( GrSurfaceOrigin origin, const SkSurfaceProps* surfaceProps, SkBudgeted budgeted) { + SkASSERT(kDefault_GrSurfaceOrigin != origin); + GrSurfaceDesc desc; desc.fFlags = kRenderTarget_GrSurfaceFlag; desc.fOrigin = origin; -- cgit v1.2.3