aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-14 18:14:19 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-14 18:14:19 +0000
commit7425c124f685978a0a6f0a1f79e89154019e7c99 (patch)
tree289904fea2f3fee2c571d39d5acd43959bcd50fb /src/effects/gradients
parent0c0e14c14e24bfe1c7881cf0c31486283de4f652 (diff)
Refactor GrGLUniformManager::UniformHandle to initialize itself by default
Refactor GrGLUniformManager::UniformHandle to initialize itself to "invalid" state by default. This simplifies the effect constructors. In the future, it should also help catch potential uninitialized uniform variable usage. Remove unneeded explicit uniform handle validity assertions before the handle usage. The assertion will always be made when handle is converted to index. BUG=skia:1492 R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://chromiumcodereview.appspot.com/22340010 git-svn-id: http://skia.googlecode.com/svn/trunk@10713 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkGradientShader.cpp1
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp3
-rw-r--r--src/effects/gradients/SkTwoPointRadialGradient.cpp3
3 files changed, 0 insertions, 7 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 4e528b5ba8..2c554dc376 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -826,7 +826,6 @@ SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
GrGLGradientEffect::GrGLGradientEffect(const GrBackendEffectFactory& factory)
: INHERITED(factory)
, fCachedYCoord(SK_ScalarMax)
- , fFSYUni(GrGLUniformManager::kInvalidUniformHandle)
, fEffectMatrix(kCoordsType) {
}
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 664ec914be..ee6e25a88e 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -336,7 +336,6 @@ void SkTwoPointConicalGradient::flatten(
// For brevity
typedef GrGLUniformManager::UniformHandle UniformHandle;
-static const UniformHandle kInvalidUniformHandle = GrGLUniformManager::kInvalidUniformHandle;
class GrGLConical2Gradient : public GrGLGradientEffect {
public:
@@ -475,8 +474,6 @@ GrEffectRef* GrConical2Gradient::TestCreate(SkMWCRandom* random,
GrGLConical2Gradient::GrGLConical2Gradient(const GrBackendEffectFactory& factory,
const GrDrawEffect& drawEffect)
: INHERITED(factory)
- , fVSParamUni(kInvalidUniformHandle)
- , fFSParamUni(kInvalidUniformHandle)
, fVSVaryingName(NULL)
, fFSVaryingName(NULL)
, fCachedCenter(SK_ScalarMax)
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index 3d526a6c1c..46724cb45b 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -376,7 +376,6 @@ void SkTwoPointRadialGradient::init() {
// For brevity
typedef GrGLUniformManager::UniformHandle UniformHandle;
-static const UniformHandle kInvalidUniformHandle = GrGLUniformManager::kInvalidUniformHandle;
class GrGLRadial2Gradient : public GrGLGradientEffect {
@@ -516,8 +515,6 @@ GrEffectRef* GrRadial2Gradient::TestCreate(SkMWCRandom* random,
GrGLRadial2Gradient::GrGLRadial2Gradient(const GrBackendEffectFactory& factory,
const GrDrawEffect& drawEffect)
: INHERITED(factory)
- , fVSParamUni(kInvalidUniformHandle)
- , fFSParamUni(kInvalidUniformHandle)
, fVSVaryingName(NULL)
, fFSVaryingName(NULL)
, fCachedCenter(SK_ScalarMax)