diff options
author | Brian Osman <brianosman@google.com> | 2017-09-28 12:39:18 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-28 17:19:58 +0000 |
commit | e8b8397664666bfcba8f088ea073ede915da8a41 (patch) | |
tree | 62a0bffe27d5ac0735b423a8fa6feb447c55fb6b /src/gpu/GrOpList.cpp | |
parent | 8477144e75329b146feb2a14cc04696aa53e0a90 (diff) |
Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation""
This reverts commit 837c6c7c0cc76bdb9d61a05244ca5f31e7573c37.
Bug: skia:
Change-Id: I1821f1b2b772c67f1b749692b398eb757d8073c9
Reviewed-on: https://skia-review.googlesource.com/52744
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrOpList.cpp')
-rw-r--r-- | src/gpu/GrOpList.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gpu/GrOpList.cpp b/src/gpu/GrOpList.cpp index 65d4e73fd0..59e1cd0f23 100644 --- a/src/gpu/GrOpList.cpp +++ b/src/gpu/GrOpList.cpp @@ -8,8 +8,9 @@ #include "GrOpList.h" #include "GrContext.h" -#include "GrPrepareCallback.h" +#include "GrDeferredProxyUploader.h" #include "GrSurfaceProxy.h" +#include "GrTextureProxyPriv.h" #include "SkAtomics.h" @@ -57,17 +58,19 @@ void GrOpList::reset() { } fTarget.reset(); - fPrepareCallbacks.reset(); + fDeferredProxies.reset(); fAuditTrail = nullptr; } -void GrOpList::addPrepareCallback(std::unique_ptr<GrPrepareCallback> callback) { - fPrepareCallbacks.push_back(std::move(callback)); +void GrOpList::instantiateDeferredProxies(GrResourceProvider* resourceProvider) { + for (int i = 0; i < fDeferredProxies.count(); ++i) { + fDeferredProxies[i]->instantiate(resourceProvider); + } } void GrOpList::prepare(GrOpFlushState* flushState) { - for (int i = 0; i < fPrepareCallbacks.count(); ++i) { - (*fPrepareCallbacks[i])(flushState); + for (int i = 0; i < fDeferredProxies.count(); ++i) { + fDeferredProxies[i]->texPriv().scheduleUpload(flushState); } this->onPrepare(flushState); @@ -100,6 +103,12 @@ void GrOpList::addDependency(GrSurfaceProxy* dependedOn, const GrCaps& caps) { opList->makeClosed(caps); } } + + if (GrTextureProxy* textureProxy = dependedOn->asTextureProxy()) { + if (textureProxy->texPriv().isDeferred()) { + fDeferredProxies.push_back(textureProxy); + } + } } #ifdef SK_DEBUG |