aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-21 22:15:46 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-21 22:15:46 +0000
commitf3fcbbea08863f0632c6a9ea056369427fe38d14 (patch)
treec32ded5d8355d7675be2bd11c8a03f248c8a3fbf /src
parent255fa16facc94ffa7475775ce7484d85b257fa13 (diff)
Kill GrGpuGL::fHWDrawState
Review URL: http://codereview.appspot.com/6227048/ git-svn-id: http://skia.googlecode.com/svn/trunk@4024 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/gpu/gl/GrGpuGL.cpp11
-rw-r--r--src/gpu/gl/GrGpuGL.h15
-rw-r--r--src/gpu/gl/GrGpuGLShaders.cpp3
3 files changed, 8 insertions, 21 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index b6bfd65679..62dcb4f21f 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -483,7 +483,6 @@ void GrGpuGL::onResetContext() {
}
fHWAAState.invalidate();
fHWWriteToColor = kUnknown_TriState;
- fHWDrawState.resetStateFlags();
// we only ever use lines in hairline mode
GL_CALL(LineWidth(1));
@@ -493,8 +492,6 @@ void GrGpuGL::onResetContext() {
fHWBlendState.invalidate();
- fHWDrawState.setViewMatrix(GrMatrix::InvalidMatrix());
-
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
fHWBoundTextures[s] = NULL;
}
@@ -2251,14 +2248,6 @@ bool GrGpuGL::flushGLStateCommon(GrPrimitiveType type) {
this->flushStencil();
- // This copy must happen after flushStencil() is called. flushStencil()
- // relies on detecting when the kModifyStencilClip_StateBit state has
- // changed since the last draw.
- fHWDrawState.copyStateFlags(*drawState);
-
- // TODO: may no longer need this
- // only GrInOrderDrawBuffer ever needs to ref/unref the textures
- fHWDrawState.disableBehavior(GrDrawState::kTexturesNeedRef_BehaviorBit);
return true;
}
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index 0e5125c27b..0be9f9cd64 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -69,13 +69,14 @@ protected:
kDownOnWrite_UpOnRead_UnpremulConversion
} fUnpremulConversion;
- GrDrawState fHWDrawState;
-
- // As flush of GL state proceeds it updates fHDrawState
- // to reflect the new state. Later parts of the state flush
- // may perform cascaded changes but cannot refer to fHWDrawState.
- // These code paths can refer to the dirty flags. Subclass should
- // call resetDirtyFlags after its flush is complete
+ // As flush of GL state proceeds the tracking variables are updated to
+ // reflect the new state. Later parts of the flush may have to perform
+ // cascaded changes but now the tracking vars have been updated. These flags
+ // track when the RT or texture has been changed so that the subclass can
+ // trigger any cascaded changes. Subclass should call resetDirtyFlags after
+ // its flush is complete.
+ // TODO: Merge GrGpuGLShaders into GrGpuGL and remove the need for these
+ // flags
struct {
bool fRenderTargetChanged : 1;
int fTextureChangedMask;
diff --git a/src/gpu/gl/GrGpuGLShaders.cpp b/src/gpu/gl/GrGpuGLShaders.cpp
index 30b260b340..0589cfe3c6 100644
--- a/src/gpu/gl/GrGpuGLShaders.cpp
+++ b/src/gpu/gl/GrGpuGLShaders.cpp
@@ -701,9 +701,6 @@ bool GrGpuGLShaders::flushGraphicsState(GrPrimitiveType type) {
const GrDrawState& drawState = this->getDrawState();
if (fDirtyFlags.fRenderTargetChanged) {
- // our coords are in pixel space and the GL matrices map to NDC
- // so if the viewport changed, our matrix is now wrong.
- fHWDrawState.setViewMatrix(GrMatrix::InvalidMatrix());
// we assume all shader matrices may be wrong after viewport changes
fProgramCache->invalidateViewMatrices();
}