aboutsummaryrefslogtreecommitdiff
path: root/tests/GLProgramsTest.cpp
diff options
context:
space:
mode:
authoregdaniel <egdaniel@google.com>2014-07-21 11:37:28 -0700
committerCommit bot <commit-bot@chromium.org>2014-07-21 11:37:28 -0700
commit02cafcc1bf6e2968c2efdf459871167970da150e (patch)
tree6407fddf603d832732c775e450c6430e0d120e55 /tests/GLProgramsTest.cpp
parent5b7c7c4ed3baf24e10db8f1b647f7c711b4420fd (diff)
Remove gpu shader optimatization for solid white or trans black colors
Running test on the added bench which draws a grid of all white paths, all blue paths, or alternating checkered white/blue paths. With optimization in (ms): White Blue Checkered Linux ~80 ~80 ~160 N7 ~800 ~1100 ~1500 Moto-e ~830 ~1100 ~2500 Without optimization in (ms): White Blue Checkered Linux ~80 ~80 ~80 N7 ~1100 ~1100 ~1100 Moto-e ~1100 ~1100 ~1500 BUG=skia: Committed: https://skia.googlesource.com/skia/+/5f78d2251a440443c9eaa321dad058d7a32bfef7 R=bsalomon@google.com Author: egdaniel@google.com Review URL: https://codereview.chromium.org/375823005
Diffstat (limited to 'tests/GLProgramsTest.cpp')
-rw-r--r--tests/GLProgramsTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 899b42fb4f..9da1ecc53c 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -73,8 +73,9 @@ bool 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 = static_cast<GrGLProgramDesc::ColorInput>(
- random->nextULessThan(kColorInputCnt));
+ uint32_t colorRand = random->nextULessThan(2);
+ header->fColorInput = (0 == colorRand) ? GrGLProgramDesc::kAttribute_ColorInput :
+ GrGLProgramDesc::kUniform_ColorInput;
} while (GrDrawState::kMaxVertexAttribCnt <= currAttribIndex &&
kAttribute_ColorInput == header->fColorInput);