diff options
author | 2012-10-05 20:13:28 +0000 | |
---|---|---|
committer | 2012-10-05 20:13:28 +0000 | |
commit | 5b3e890c376f2211218c43edd11939cfc78fd60a (patch) | |
tree | 83fbe3b7080aade2d97934bdf4779b050415791e /src/gpu/GrDrawTarget.cpp | |
parent | c7448cef098b835d6f9adf8a365fde9de076f178 (diff) |
Move some auto restore helpers from GrDrawTarget to GrDrawState.
R=robertphillips@google.com
git-svn-id: http://skia.googlecode.com/svn/trunk@5846 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r-- | src/gpu/GrDrawTarget.cpp | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp index ab345bc6cb..4c028c3d0a 100644 --- a/src/gpu/GrDrawTarget.cpp +++ b/src/gpu/GrDrawTarget.cpp @@ -1160,47 +1160,6 @@ void GrDrawTarget::AutoStateRestore::set(GrDrawTarget* target, ASRInit init) { //////////////////////////////////////////////////////////////////////////////// -GrDrawTarget::AutoDeviceCoordDraw::AutoDeviceCoordDraw(GrDrawTarget* target, - uint32_t explicitCoordStageMask) { - GrAssert(NULL != target); - GrDrawState* drawState = target->drawState(); - - fDrawTarget = target; - fViewMatrix = drawState->getViewMatrix(); - fRestoreMask = 0; - GrMatrix invVM; - bool inverted = false; - - for (int s = 0; s < GrDrawState::kNumStages; ++s) { - if (!(explicitCoordStageMask & (1 << s)) && drawState->isStageEnabled(s)) { - if (!inverted && !fViewMatrix.invert(&invVM)) { - // sad trombone sound - fDrawTarget = NULL; - return; - } else { - inverted = true; - } - fRestoreMask |= (1 << s); - GrSamplerState* sampler = drawState->sampler(s); - fSamplerMatrices[s] = sampler->getMatrix(); - sampler->preConcatMatrix(invVM); - } - } - drawState->viewMatrix()->reset(); -} - -GrDrawTarget::AutoDeviceCoordDraw::~AutoDeviceCoordDraw() { - GrDrawState* drawState = fDrawTarget->drawState(); - drawState->setViewMatrix(fViewMatrix); - for (int s = 0; s < GrDrawState::kNumStages; ++s) { - if (fRestoreMask & (1 << s)) { - *drawState->sampler(s)->matrix() = fSamplerMatrices[s]; - } - } -} - -//////////////////////////////////////////////////////////////////////////////// - GrDrawTarget::AutoReleaseGeometry::AutoReleaseGeometry( GrDrawTarget* target, GrVertexLayout vertexLayout, |