Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Unified Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 542723004: Make GrDrawState and GrEffectStage use the pending io/exec ref mechanisms. (Closed) Base URL: https://skia.googlesource.com/skia.git@complete
Patch Set: rebase again Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrEffect.cpp ('k') | src/gpu/GrRODrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrInOrderDrawBuffer.cpp
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index b7180da45ce1dfc82e7f211207d7dd4e761d00f4..1f2692d576840a01d01c2398c78339ff20c5061a 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -888,14 +888,18 @@ void GrInOrderDrawBuffer::recordStateIfNecessary() {
GrDrawState& prev = fStates.back();
switch (GrDrawState::CombineIfPossible(prev, curr, *this->caps())) {
case GrDrawState::kIncompatible_CombinedState:
- fStates.push_back() = this->getDrawState();
+ this->convertDrawStateToPendingExec(&fStates.push_back(curr));
this->addToCmdBuffer(kSetState_Cmd);
break;
case GrDrawState::kA_CombinedState:
case GrDrawState::kAOrB_CombinedState: // Treat the same as kA.
break;
case GrDrawState::kB_CombinedState:
- prev = curr;
+ // prev has already been converted to pending execution. That is a one-way ticket.
+ // So here we just delete prev and push back a new copy of curr. Note that this
+ // goes away when we move GrIODB over to taking optimized snapshots of draw states.
+ fStates.pop_back();
+ this->convertDrawStateToPendingExec(&fStates.push_back(curr));
break;
}
}
« no previous file with comments | « src/gpu/GrEffect.cpp ('k') | src/gpu/GrRODrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698