diff options
author | 2018-02-07 17:08:21 -0500 | |
---|---|---|
committer | 2018-02-08 12:36:29 +0000 | |
commit | 4150eea6c49ecec882a8d3e1c61d6a25fcd1e905 (patch) | |
tree | 21b7089d6745f769be88f8f3d9a127d521ff48be /src/gpu/GrRenderTargetContext.cpp | |
parent | 1f1bb9c0b8d5f50ac74716e6961a6c92f1d373d8 (diff) |
Move control of explicit GPU resource allocation to GrContextOptions
Change-Id: Ic284acc79bab5936f0007d5ae5fb1e7a9929e2af
Reviewed-on: https://skia-review.googlesource.com/104880
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetContext.cpp')
-rw-r--r-- | src/gpu/GrRenderTargetContext.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
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();) } |