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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrEffect.cpp ('k') | src/gpu/GrRODrawState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrInOrderDrawBuffer.h" 8 #include "GrInOrderDrawBuffer.h"
9 9
10 #include "GrBufferAllocPool.h" 10 #include "GrBufferAllocPool.h"
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 void GrInOrderDrawBuffer::recordStateIfNecessary() { 881 void GrInOrderDrawBuffer::recordStateIfNecessary() {
882 if (fStates.empty()) { 882 if (fStates.empty()) {
883 fStates.push_back() = this->getDrawState(); 883 fStates.push_back() = this->getDrawState();
884 this->addToCmdBuffer(kSetState_Cmd); 884 this->addToCmdBuffer(kSetState_Cmd);
885 return; 885 return;
886 } 886 }
887 const GrDrawState& curr = this->getDrawState(); 887 const GrDrawState& curr = this->getDrawState();
888 GrDrawState& prev = fStates.back(); 888 GrDrawState& prev = fStates.back();
889 switch (GrDrawState::CombineIfPossible(prev, curr, *this->caps())) { 889 switch (GrDrawState::CombineIfPossible(prev, curr, *this->caps())) {
890 case GrDrawState::kIncompatible_CombinedState: 890 case GrDrawState::kIncompatible_CombinedState:
891 fStates.push_back() = this->getDrawState(); 891 this->convertDrawStateToPendingExec(&fStates.push_back(curr));
892 this->addToCmdBuffer(kSetState_Cmd); 892 this->addToCmdBuffer(kSetState_Cmd);
893 break; 893 break;
894 case GrDrawState::kA_CombinedState: 894 case GrDrawState::kA_CombinedState:
895 case GrDrawState::kAOrB_CombinedState: // Treat the same as kA. 895 case GrDrawState::kAOrB_CombinedState: // Treat the same as kA.
896 break; 896 break;
897 case GrDrawState::kB_CombinedState: 897 case GrDrawState::kB_CombinedState:
898 prev = curr; 898 // prev has already been converted to pending execution. That is a o ne-way ticket.
899 // So here we just delete prev and push back a new copy of curr. Not e that this
900 // goes away when we move GrIODB over to taking optimized snapshots of draw states.
901 fStates.pop_back();
902 this->convertDrawStateToPendingExec(&fStates.push_back(curr));
899 break; 903 break;
900 } 904 }
901 } 905 }
902 906
903 bool GrInOrderDrawBuffer::needsNewClip() const { 907 bool GrInOrderDrawBuffer::needsNewClip() const {
904 if (this->getDrawState().isClipState()) { 908 if (this->getDrawState().isClipState()) {
905 if (fClipSet && 909 if (fClipSet &&
906 (fClips.empty() || 910 (fClips.empty() ||
907 fClips.back().fStack != *this->getClip()->fClipStack || 911 fClips.back().fStack != *this->getClip()->fClipStack ||
908 fClips.back().fOrigin != this->getClip()->fOrigin)) { 912 fClips.back().fOrigin != this->getClip()->fOrigin)) {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 GrInOrderDrawBuffer::CopySurface* GrInOrderDrawBuffer::recordCopySurface() { 962 GrInOrderDrawBuffer::CopySurface* GrInOrderDrawBuffer::recordCopySurface() {
959 this->addToCmdBuffer(kCopySurface_Cmd); 963 this->addToCmdBuffer(kCopySurface_Cmd);
960 return &fCopySurfaces.push_back(); 964 return &fCopySurfaces.push_back();
961 } 965 }
962 966
963 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { 967 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) {
964 INHERITED::clipWillBeSet(newClipData); 968 INHERITED::clipWillBeSet(newClipData);
965 fClipSet = true; 969 fClipSet = true;
966 fClipProxyState = kUnknown_ClipProxyState; 970 fClipProxyState = kUnknown_ClipProxyState;
967 } 971 }
OLDNEW
« 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