From 4150eea6c49ecec882a8d3e1c61d6a25fcd1e905 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Wed, 7 Feb 2018 17:08:21 -0500 Subject: Move control of explicit GPU resource allocation to GrContextOptions Change-Id: Ic284acc79bab5936f0007d5ae5fb1e7a9929e2af Reviewed-on: https://skia-review.googlesource.com/104880 Commit-Queue: Robert Phillips Reviewed-by: Brian Salomon Reviewed-by: Greg Daniel --- src/gpu/GrRenderTargetContext.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/gpu/GrRenderTargetContext.cpp') diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp index d4cfb7f0a6..cb7b677759 100644 --- a/src/gpu/GrRenderTargetContext.cpp +++ b/src/gpu/GrRenderTargetContext.cpp @@ -155,12 +155,14 @@ GrRenderTargetContext::GrRenderTargetContext(GrContext* context, , fOpList(sk_ref_sp(fRenderTargetProxy->getLastRenderTargetOpList())) , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) , fManagedOpList(managedOpList) { -#ifdef SK_DISABLE_EXPLICIT_GPU_RESOURCE_ALLOCATION - // MDB TODO: to ensure all resources still get allocated in the correct order in the hybrid - // world we need to get the correct opList here so that it, in turn, can grab and hold - // its rendertarget. - this->getRTOpList(); -#endif + GrResourceProvider* resourceProvider = context->contextPriv().resourceProvider(); + if (resourceProvider && !resourceProvider->explicitlyAllocateGPUResources()) { + // MDB TODO: to ensure all resources still get allocated in the correct order in the hybrid + // world we need to get the correct opList here so that it, in turn, can grab and hold + // its rendertarget. + this->getRTOpList(); + } + fTextTarget.reset(new TextTarget(this)); SkDEBUGCODE(this->validate();) } -- cgit v1.2.3