Set texture dirty flag only when texture has really changed
Review URL: http://codereview.appspot.com/4571073/



git-svn-id: http://skia.googlecode.com/svn/trunk@1592 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index aa8c6db..177ddb1 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -1778,6 +1778,9 @@
             #endif
                 //GrPrintf("---- bindtexture %d\n", nextTexture->textureID());
                 fHWDrawState.fTextures[s] = nextTexture;
+                // The texture matrix has to compensate for texture width/height
+                // and NPOT-embedded-in-POT
+                fDirtyFlags.fTextureChangedMask |= (1 << s);
             }
 
             const GrSamplerState& sampler = fCurrDrawState.fSamplerStates[s];
@@ -1818,10 +1821,6 @@
                                     newTexParams.fWrapT));
             }
             nextTexture->setTexParams(newTexParams);
-
-            // The texture matrix has to compensate for texture width/height
-            // and NPOT-embedded-in-POT
-            fDirtyFlags.fTextureChangedMask |= (1 << s);
         }
     }