Separate out the texture matrix from the coord-system change matrix in GrSamplerState. This is a step towards moving texture matrix to GrCustomStage.
R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6721047
git-svn-id: http://skia.googlecode.com/svn/trunk@5973 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index cc11f6c..c95049a 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -54,7 +54,7 @@
fDrawState->setViewMatrix(fViewMatrix);
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
if (fRestoreMask & (1 << s)) {
- fDrawState->sampler(s)->setMatrixDeprecated(fSamplerMatrices[s]);
+ fDrawState->sampler(s)->restoreCoordChange(fSavedCoordChanges[s]);
}
}
}
@@ -77,8 +77,8 @@
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
if (!(explicitCoordStageMask & (1 << s)) && drawState->isStageEnabled(s)) {
fRestoreMask |= (1 << s);
- fSamplerMatrices[s] = drawState->sampler(s)->getMatrix();
- drawState->sampler(s)->preConcatMatrix(preconcatMatrix);
+ fDrawState->sampler(s)->saveCoordChange(&fSavedCoordChanges[s]);
+ drawState->sampler(s)->preConcatCoordChange(preconcatMatrix);
}
}
}
@@ -90,7 +90,7 @@
fDrawState->setViewMatrix(fViewMatrix);
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
if (fRestoreMask & (1 << s)) {
- fDrawState->sampler(s)->setMatrixDeprecated(fSamplerMatrices[s]);
+ fDrawState->sampler(s)->restoreCoordChange(fSavedCoordChanges[s]);
}
}
}
@@ -124,8 +124,8 @@
}
fRestoreMask |= (1 << s);
GrSamplerState* sampler = drawState->sampler(s);
- fSamplerMatrices[s] = sampler->getMatrix();
- sampler->preConcatMatrix(invVM);
+ sampler->saveCoordChange(&fSavedCoordChanges[s]);
+ sampler->preConcatCoordChange(invVM);
}
}
drawState->viewMatrix()->reset();