From 890e3b58e78c0825820f75f1f0c5a5d71e855aa6 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Fri, 1 Jun 2012 19:01:37 +0000 Subject: Remove dirty flags from GrGpuGL state flush Review URL: http://codereview.appspot.com/6255073/ git-svn-id: http://skia.googlecode.com/svn/trunk@4122 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/gl/GrGpuGL.cpp | 47 +++-------------------------------------------- 1 file changed, 3 insertions(+), 44 deletions(-) (limited to 'src/gpu/gl/GrGpuGL.cpp') diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index 8817068207..ec535b8a14 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -111,40 +111,6 @@ bool GrGpuGL::BlendCoeffReferencesConstant(GrBlendCoeff coeff) { /////////////////////////////////////////////////////////////////////////////// -void GrGpuGL::AdjustTextureMatrix(const GrGLTexture* texture, - GrSamplerState::SampleMode mode, - GrMatrix* matrix) { - GrAssert(NULL != texture); - GrAssert(NULL != matrix); - GrGLTexture::Orientation orientation = texture->orientation(); - if (GrGLTexture::kBottomUp_Orientation == orientation) { - GrMatrix invY; - invY.setAll(GR_Scalar1, 0, 0, - 0, -GR_Scalar1, GR_Scalar1, - 0, 0, GrMatrix::I()[8]); - matrix->postConcat(invY); - } else { - GrAssert(GrGLTexture::kTopDown_Orientation == orientation); - } -} - -bool GrGpuGL::TextureMatrixIsIdentity(const GrGLTexture* texture, - const GrSamplerState& sampler) { - GrAssert(NULL != texture); - if (!sampler.getMatrix().isIdentity()) { - return false; - } - GrGLTexture::Orientation orientation = texture->orientation(); - if (GrGLTexture::kBottomUp_Orientation == orientation) { - return false; - } else { - GrAssert(GrGLTexture::kTopDown_Orientation == orientation); - } - return true; -} - -/////////////////////////////////////////////////////////////////////////////// - static bool gPrintStartupSpew; static bool fbo_test(const GrGLInterface* gl, int w, int h) { @@ -203,8 +169,6 @@ GrGpuGL::GrGpuGL(const GrGLContextInfo& ctxInfo) : fGLContextInfo(ctxInfo) { GrPrintf("------ EXTENSIONS\n %s \n", ext); } - this->resetDirtyFlags(); - this->initCaps(); fProgramData = NULL; @@ -1657,12 +1621,14 @@ void GrGpuGL::flushRenderTarget(const GrIRect* bound) { GrPrintf("GrGpuGL::flushRenderTarget glCheckFramebufferStatus %x\n", status); } #endif - fDirtyFlags.fRenderTargetChanged = true; fHWBoundRenderTarget = rt; const GrGLIRect& vp = rt->getViewport(); if (fHWBounds.fViewportRect != vp) { vp.pushToGLViewport(this->glInterface()); fHWBounds.fViewportRect = vp; + // View matrices pushed to GL depend upon the viewport. So they + // are now invalid. + fProgramCache->invalidateViewMatrices(); } } if (NULL == bound || !bound->isEmpty()) { @@ -2177,9 +2143,6 @@ bool GrGpuGL::flushGLStateCommon(GrPrimitiveType type) { #endif //GrPrintf("---- bindtexture %d\n", nextTexture->textureID()); fHWBoundTextures[s] = nextTexture; - // The texture matrix has to compensate for texture width/height - // and NPOT-embedded-in-POT - fDirtyFlags.fTextureChangedMask |= (1 << s); } const GrSamplerState& sampler = drawState->getSampler(s); @@ -2480,10 +2443,6 @@ void GrGpuGL::setSpareTextureUnit() { } } -void GrGpuGL::resetDirtyFlags() { - Gr_bzero(&fDirtyFlags, sizeof(fDirtyFlags)); -} - void GrGpuGL::setBuffers(bool indexed, int* extraVertexOffset, int* extraIndexOffset) { -- cgit v1.2.3