Skip flush functions for disabled stages
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 13 Dec 2011 18:40:47 +0000 (18:40 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 13 Dec 2011 18:40:47 +0000 (18:40 +0000)
Review URL: http://codereview.appspot.com/5483061

git-svn-id: http://skia.googlecode.com/svn/trunk@2870 2bbb7eff-a529-9590-31e7-b0007b416f81

src/gpu/GrGpuGLShaders.cpp

index 5fe90b8b1236a011892e59963880c1884b441e4b..98ac1bfe2e43944c00847d6864de7a612d59c631 100644 (file)
@@ -718,15 +718,17 @@ bool GrGpuGLShaders::flushGraphicsState(GrPrimitiveType type) {
     this->flushViewMatrix();
 
     for (int s = 0; s < GrDrawState::kNumStages; ++s) {
-        this->flushTextureMatrix(s);
+        if (this->isStageEnabled(s)) {
+            this->flushTextureMatrix(s);
 
-        this->flushRadial2(s);
+            this->flushRadial2(s);
 
-        this->flushConvolution(s);
+            this->flushConvolution(s);
 
-        this->flushTexelSize(s);
+            this->flushTexelSize(s);
 
-        this->flushTextureDomain(s);
+            this->flushTextureDomain(s);
+        }
     }
     this->flushEdgeAAData();
     resetDirtyFlags();