diff options
author | Brian Osman <brianosman@google.com> | 2017-09-29 09:22:17 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-29 13:48:54 +0000 |
commit | fdd2cb52b781dd68f515a1eb9fe6d054a0ebc226 (patch) | |
tree | be3eb525ce37c3df6c4150ed1e210632b3ec7b13 /src/gpu/GrOpList.cpp | |
parent | 5fdee443e750b16dabfe3b1aa61b77207660457a (diff) |
Revert "Revert "Revert "Revert "Make threaded proxy generation MDB-friendly, and defer instantiation""""
This reverts commit 9f8d4d36b514ffe3cc3a4a48900e3dc1fecb2a96.
Bug: skia:
Change-Id: I8d7c1df24d8b13b94404f3d9ba69a1ab55ee00c0
Reviewed-on: https://skia-review.googlesource.com/52920
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@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 |