aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrInOrderDrawBuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrInOrderDrawBuffer.cpp')
-rw-r--r--src/gpu/GrInOrderDrawBuffer.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index e327413226..87ecc8579f 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -570,8 +570,11 @@ bool GrInOrderDrawBuffer::flushTo(GrDrawTarget* target) {
GrDrawTarget::AutoClipRestore acr(target);
AutoGeometryPush agp(target);
+
+ GrDrawState playbackState;
GrDrawState* prevDrawState = target->drawState();
prevDrawState->ref();
+ target->setDrawState(&playbackState);
GrClipData clipData;
@@ -581,6 +584,7 @@ bool GrInOrderDrawBuffer::flushTo(GrDrawTarget* target) {
int currDraw = 0;
int currStencilPath = 0;
+
for (int c = 0; c < numCmds; ++c) {
switch (fCmds[c]) {
case kDraw_Cmd: {
@@ -611,7 +615,7 @@ bool GrInOrderDrawBuffer::flushTo(GrDrawTarget* target) {
break;
}
case kSetState_Cmd:
- target->setDrawState(&fStates[currState]);
+ fStates[currState].restoreTo(&playbackState);
++currState;
break;
case kSetClip_Cmd:
@@ -860,7 +864,7 @@ void GrInOrderDrawBuffer::geometrySourceWillPop(
}
bool GrInOrderDrawBuffer::needsNewState() const {
- return fStates.empty() || fStates.back() != this->getDrawState();
+ return fStates.empty() || !fStates.back().isEqual(this->getDrawState());
}
bool GrInOrderDrawBuffer::needsNewClip() const {
@@ -883,19 +887,8 @@ void GrInOrderDrawBuffer::recordClip() {
fCmds.push_back(kSetClip_Cmd);
}
-void GrInOrderDrawBuffer::recordDefaultClip() {
- fClips.push_back() = SkClipStack();
- fClipOrigins.push_back() = SkIPoint::Make(0, 0);
- fCmds.push_back(kSetClip_Cmd);
-}
-
void GrInOrderDrawBuffer::recordState() {
- fStates.push_back(this->getDrawState());
- fCmds.push_back(kSetState_Cmd);
-}
-
-void GrInOrderDrawBuffer::recordDefaultState() {
- fStates.push_back(GrDrawState());
+ fStates.push_back().saveFrom(this->getDrawState());
fCmds.push_back(kSetState_Cmd);
}