Assign color=0 in GrDrawState.cpp to stop tools from raising false alarms about unini...
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 27 Feb 2013 18:43:47 +0000 (18:43 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 27 Feb 2013 18:43:47 +0000 (18:43 +0000)
We were assigning color to oldColor but it in turn would never be read because the valid flags
would be cleared.

R=jvanverth@google.com
Review URL: https://codereview.chromium.org/12313150

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

src/gpu/GrDrawState.cpp

index 8c74c4a4bd9620edeb2e7080e3a0a0c252d7ecdc..3925bd9a9195538dd8a16409342b93d88a9778d3 100644 (file)
@@ -318,10 +318,11 @@ bool GrDrawState::StageUsesTexCoords(GrVertexLayout layout, int stageIdx) {
 bool GrDrawState::srcAlphaWillBeOne(GrVertexLayout layout) const {
 
     uint32_t validComponentFlags;
-    GrColor  color;
+    GrColor color;
     // Check if per-vertex or constant color may have partial alpha
     if (layout & kColor_VertexLayoutBit) {
         validComponentFlags = 0;
+        color = 0; // not strictly necessary but we get false alarms from tools about uninit.
     } else {
         validComponentFlags = GrEffect::kAll_ValidComponentFlags;
         color = this->getColor();