Fix grdrawstate == test when left side has disabled stage and right side does not
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 18 Jul 2012 18:25:07 +0000 (18:25 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 18 Jul 2012 18:25:07 +0000 (18:25 +0000)
Review URL: http://codereview.appspot.com/6427044/

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

src/gpu/GrDrawState.h

index 3de33d8..b5c3482 100644 (file)
@@ -797,8 +797,11 @@ public:
         }
 
         for (int i = 0; i < kNumStages; i++) {
-            if (this->isStageEnabled(i) &&
-                this->fSamplerStates[i] != s.fSamplerStates[i]) {
+            bool enabled = this->isStageEnabled(i);
+            if (enabled != s.isStageEnabled(i)) {
+                return false;
+            }
+            if (enabled && this->fSamplerStates[i] != s.fSamplerStates[i]) {
                 return false;
             }
         }