| OLD | NEW |
| 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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 } | 826 } |
| 827 if (kReserved_GeometrySrcType == restoredState.fIndexSrc || | 827 if (kReserved_GeometrySrcType == restoredState.fIndexSrc || |
| 828 kArray_GeometrySrcType == restoredState.fIndexSrc) { | 828 kArray_GeometrySrcType == restoredState.fIndexSrc) { |
| 829 poolState.fUsedPoolIndexBytes = sizeof(uint16_t) * | 829 poolState.fUsedPoolIndexBytes = sizeof(uint16_t) * |
| 830 restoredState.fIndexCount; | 830 restoredState.fIndexCount; |
| 831 } | 831 } |
| 832 } | 832 } |
| 833 | 833 |
| 834 void GrInOrderDrawBuffer::recordStateIfNecessary() { | 834 void GrInOrderDrawBuffer::recordStateIfNecessary() { |
| 835 if (fStates.empty()) { | 835 if (fStates.empty()) { |
| 836 this->convertDrawStateToPendingExec(&fStates.push_back(this->getDrawStat
e())); | 836 fStates.push_back() = this->getDrawState(); |
| 837 this->addToCmdBuffer(kSetState_Cmd); | 837 this->addToCmdBuffer(kSetState_Cmd); |
| 838 return; | 838 return; |
| 839 } | 839 } |
| 840 const GrDrawState& curr = this->getDrawState(); | 840 const GrDrawState& curr = this->getDrawState(); |
| 841 GrDrawState& prev = fStates.back(); | 841 GrDrawState& prev = fStates.back(); |
| 842 switch (GrDrawState::CombineIfPossible(prev, curr, *this->caps())) { | 842 switch (GrDrawState::CombineIfPossible(prev, curr, *this->caps())) { |
| 843 case GrDrawState::kIncompatible_CombinedState: | 843 case GrDrawState::kIncompatible_CombinedState: |
| 844 this->convertDrawStateToPendingExec(&fStates.push_back(curr)); | 844 this->convertDrawStateToPendingExec(&fStates.push_back(curr)); |
| 845 this->addToCmdBuffer(kSetState_Cmd); | 845 this->addToCmdBuffer(kSetState_Cmd); |
| 846 break; | 846 break; |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 GrSurfa
ce* src) { | 918 GrSurfa
ce* src) { |
| 919 this->addToCmdBuffer(kCopySurface_Cmd); | 919 this->addToCmdBuffer(kCopySurface_Cmd); |
| 920 return GrNEW_APPEND_TO_ALLOCATOR(&fCopySurfaces, CopySurface, (dst, src)); | 920 return GrNEW_APPEND_TO_ALLOCATOR(&fCopySurfaces, CopySurface, (dst, src)); |
| 921 } | 921 } |
| 922 | 922 |
| 923 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { | 923 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { |
| 924 INHERITED::clipWillBeSet(newClipData); | 924 INHERITED::clipWillBeSet(newClipData); |
| 925 fClipSet = true; | 925 fClipSet = true; |
| 926 fClipProxyState = kUnknown_ClipProxyState; | 926 fClipProxyState = kUnknown_ClipProxyState; |
| 927 } | 927 } |
| OLD | NEW |