diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-06-16 17:22:59 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-18 15:32:48 +0000 |
commit | 4c458b12f68d8704a297c1ec252127c77bdee595 (patch) | |
tree | 588efa8ae1870e6d20107c371cc1077662c5ff15 /src/gpu/GrOnFlushResourceProvider.cpp | |
parent | 3567c14a41cd55860fcc836af32d8748c1e3c856 (diff) |
ccpr: Use lazy proxies with GrCCAtlas
Bug: skia:
Change-Id: I576d9303d451352778de0425e3ecbc561331cd09
Reviewed-on: https://skia-review.googlesource.com/135362
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrOnFlushResourceProvider.cpp')
-rw-r--r-- | src/gpu/GrOnFlushResourceProvider.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gpu/GrOnFlushResourceProvider.cpp b/src/gpu/GrOnFlushResourceProvider.cpp index ff56c33c12..535f825e57 100644 --- a/src/gpu/GrOnFlushResourceProvider.cpp +++ b/src/gpu/GrOnFlushResourceProvider.cpp @@ -58,6 +58,13 @@ sk_sp<GrRenderTargetContext> GrOnFlushResourceProvider::makeRenderTargetContext( sk_sp<GrSurfaceProxy> proxy, sk_sp<SkColorSpace> colorSpace, const SkSurfaceProps* props) { + // Since this is at flush time and these won't be allocated for us by the GrResourceAllocator + // we have to manually ensure it is allocated here. The proxy had best have been created + // with the kNoPendingIO flag! + if (!this->instatiateProxy(proxy.get())) { + return nullptr; + } + sk_sp<GrRenderTargetContext> renderTargetContext( fDrawingMgr->makeRenderTargetContext(std::move(proxy), std::move(colorSpace), @@ -67,15 +74,6 @@ sk_sp<GrRenderTargetContext> GrOnFlushResourceProvider::makeRenderTargetContext( return nullptr; } - auto resourceProvider = fDrawingMgr->getContext()->contextPriv().resourceProvider(); - - // Since this is at flush time and these won't be allocated for us by the GrResourceAllocator - // we have to manually ensure it is allocated here. The proxy had best have been created - // with the kNoPendingIO flag! - if (!renderTargetContext->asSurfaceProxy()->instantiate(resourceProvider)) { - return nullptr; - } - renderTargetContext->discard(); return renderTargetContext; |