diff options
author | Brian Salomon <bsalomon@google.com> | 2017-03-21 14:22:38 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-21 23:55:32 +0000 |
commit | 54d212e1bfaea0be88c3c40820d0b1ae0daebecf (patch) | |
tree | ce606e9d88dfd04d592d406881b7e6e5d9a855cf /src/gpu/GrProcessorSet.cpp | |
parent | 337432dc092619431eaa62f13e6347f2272f1fa7 (diff) |
Revert "Revert "Remove GrPipeline from GrDrawOp.""
This reverts commit c48af934608bbb65650641f66adb51f2102d4274.
Change-Id: I4ba78fd7e5a7d406b88223ca6f7245c029b60f76
Reviewed-on: https://skia-review.googlesource.com/9981
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrProcessorSet.cpp')
-rw-r--r-- | src/gpu/GrProcessorSet.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gpu/GrProcessorSet.cpp b/src/gpu/GrProcessorSet.cpp index c4b82621d1..94e2004546 100644 --- a/src/gpu/GrProcessorSet.cpp +++ b/src/gpu/GrProcessorSet.cpp @@ -38,6 +38,44 @@ GrProcessorSet::GrProcessorSet(GrPaint&& paint) { } } +GrProcessorSet::~GrProcessorSet() { + if (this->isPendingExecution()) { + for (auto fp : fFragmentProcessors) { + fp->completedExecution(); + } + } else { + for (auto fp : fFragmentProcessors) { + fp->unref(); + } + } +} + +void GrProcessorSet::makePendingExecution() { + SkASSERT(!(kPendingExecution_Flag & fFlags)); + fFlags |= kPendingExecution_Flag; + for (int i = 0; i < fFragmentProcessors.count(); ++i) { + fFragmentProcessors[i]->addPendingExecution(); + fFragmentProcessors[i]->unref(); + } +} + +bool GrProcessorSet::operator==(const GrProcessorSet& that) const { + if (((fFlags ^ that.fFlags) & ~kPendingExecution_Flag) || + fFragmentProcessors.count() != that.fFragmentProcessors.count() || + fColorFragmentProcessorCnt != that.fColorFragmentProcessorCnt) { + return false; + } + for (int i = 0; i < fFragmentProcessors.count(); ++i) { + if (!fFragmentProcessors[i]->isEqual(*that.fFragmentProcessors[i])) { + return false; + } + } + if (fXPFactory != that.fXPFactory) { + return false; + } + return true; +} + ////////////////////////////////////////////////////////////////////////////// void GrProcessorSet::FragmentProcessorAnalysis::internalInit(const GrPipelineInput& colorInput, |