From 89e6f5bacf09333cdb0111bc7d18afdb2cfa8206 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 27 Feb 2013 18:43:47 +0000 Subject: Assign color=0 in GrDrawState.cpp to stop tools from raising false alarms about uninit reads. 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp index 8c74c4a4bd..3925bd9a91 100644 --- a/src/gpu/GrDrawState.cpp +++ b/src/gpu/GrDrawState.cpp @@ -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(); -- cgit v1.2.3