Fix clang static analyzer errors in Gr
Review URL: http://codereview.appspot.com/5433055/
git-svn-id: http://skia.googlecode.com/svn/trunk@2743 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpuGL.cpp b/src/gpu/GrGpuGL.cpp
index 093a53b..7e9b102 100644
--- a/src/gpu/GrGpuGL.cpp
+++ b/src/gpu/GrGpuGL.cpp
@@ -1763,8 +1763,13 @@
GrAssert(stencilBits ||
(GrStencilSettings::gDisabled ==
fCurrDrawState.fStencilSettings));
- GrGLuint clipStencilMask = 1 << (stencilBits - 1);
- GrGLuint userStencilMask = clipStencilMask - 1;
+
+ GrGLuint clipStencilMask = 0;
+ GrGLuint userStencilMask = ~0;
+ if (stencilBits > 0) {
+ clipStencilMask = 1 << (stencilBits - 1);
+ userStencilMask = clipStencilMask - 1;
+ }
unsigned int frontRef = settings->fFrontFuncRef;
unsigned int frontMask = settings->fFrontFuncMask;
diff --git a/src/gpu/GrGpuGLShaders.cpp b/src/gpu/GrGpuGLShaders.cpp
index bae699d..7b364e6 100644
--- a/src/gpu/GrGpuGLShaders.cpp
+++ b/src/gpu/GrGpuGLShaders.cpp
@@ -546,7 +546,7 @@
// down).
float values[6] = {
GrScalarToFloat(a),
- 1 / (2.f * values[0]),
+ 1 / (2.f * GrScalarToFloat(a)),
GrScalarToFloat(centerX1),
GrScalarToFloat(radius0),
GrScalarToFloat(GrMul(radius0, radius0)),