diff options
author | Brian Salomon <bsalomon@google.com> | 2017-10-31 14:42:10 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-31 19:01:06 +0000 |
commit | 29b60c9020ce4376df3d31db15d1aa316d640711 (patch) | |
tree | 86748ea86ae5d10f62d1714e0423487ed4e43a4a /src/gpu/GrTextureOpList.cpp | |
parent | f78b55cb94f4ac89b76a26d5a56d6380aa8fea6b (diff) |
Make deferred upload handling and draw recording be virtual interfaces implemented by GrOpFlushState.
The motivation for this is to allow other clients of GrDrawOpAtlas. Making GrMeshDrawOp::Target also be an abstract interface is somewhat incidental to this goal.
Bug: skia:
Change-Id: I0987adfa8a269aa2ca94147e933a2827d734c1cc
Reviewed-on: https://skia-review.googlesource.com/65121
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrTextureOpList.cpp')
-rw-r--r-- | src/gpu/GrTextureOpList.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp index 852258fa71..cf003098cd 100644 --- a/src/gpu/GrTextureOpList.cpp +++ b/src/gpu/GrTextureOpList.cpp @@ -52,8 +52,15 @@ void GrTextureOpList::onPrepare(GrOpFlushState* flushState) { // Loop over the ops that haven't yet generated their geometry for (int i = 0; i < fRecordedOps.count(); ++i) { if (fRecordedOps[i]) { - // We do not call flushState->setDrawOpArgs as this op list does not support GrDrawOps. + GrOpFlushState::OpArgs opArgs = { + fRecordedOps[i].get(), + nullptr, + nullptr, + GrXferProcessor::DstProxy() + }; + flushState->setOpArgs(&opArgs); fRecordedOps[i]->prepare(flushState); + flushState->setOpArgs(nullptr); } } } @@ -69,8 +76,15 @@ bool GrTextureOpList::onExecute(GrOpFlushState* flushState) { flushState->setCommandBuffer(commandBuffer.get()); for (int i = 0; i < fRecordedOps.count(); ++i) { - // We do not call flushState->setDrawOpArgs as this op list does not support GrDrawOps. + GrOpFlushState::OpArgs opArgs = { + fRecordedOps[i].get(), + nullptr, + nullptr, + GrXferProcessor::DstProxy() + }; + flushState->setOpArgs(&opArgs); fRecordedOps[i]->execute(flushState); + flushState->setOpArgs(nullptr); } commandBuffer->submit(); |