aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-01 18:43:29 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-10-01 18:43:29 +0000
commit949eef0af2f5b47000e637347801cf2970092a38 (patch)
treed4a174c12f5d9dd4fd93cb794eccc381cab0ee8f /tests
parent1d06999bc2ad627649396dc51d3c3776aea2eacb (diff)
Use explicitly-sized enums in GrGLProgramDesc::KeyHeader
Uses enums explicitly sized to 8 bits in GrGLProgramDesc::KeyHeader, instead of storing them as uint8_t values. This avoids the need to static_cast them. R=bsalomon@google.com Author: cdalton@nvidia.com Review URL: https://codereview.chromium.org/23875048 git-svn-id: http://skia.googlecode.com/svn/trunk@11560 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/GLProgramsTest.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 10380f7924..fe17f88945 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -44,7 +44,8 @@ void GrGLProgramDesc::setRandom(SkRandom* random,
// if the effects have used up all off the available attributes,
// don't try to use color or coverage attributes as input
do {
- header->fColorInput = random->nextULessThan(kColorInputCnt);
+ header->fColorInput = static_cast<GrGLProgramDesc::ColorInput>(
+ random->nextULessThan(kColorInputCnt));
} while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
kAttribute_ColorInput == header->fColorInput);
header->fColorAttributeIndex = (header->fColorInput == kAttribute_ColorInput) ?
@@ -52,14 +53,16 @@ void GrGLProgramDesc::setRandom(SkRandom* random,
-1;
do {
- header->fCoverageInput = random->nextULessThan(kColorInputCnt);
+ header->fCoverageInput = static_cast<GrGLProgramDesc::ColorInput>(
+ random->nextULessThan(kColorInputCnt));
} while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
kAttribute_ColorInput == header->fCoverageInput);
header->fCoverageAttributeIndex = (header->fCoverageInput == kAttribute_ColorInput) ?
currAttribIndex++ :
-1;
- header->fColorFilterXfermode = random->nextULessThan(SkXfermode::kLastCoeffMode + 1);
+ header->fColorFilterXfermode = static_cast<SkXfermode::Mode>(
+ random->nextULessThan(SkXfermode::kLastCoeffMode + 1));
#if GR_GL_EXPERIMENTAL_GS
header->fExperimentalGS = gpu->caps()->geometryShaderSupport() && random->nextBool();