aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2014-10-02 09:57:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-10-02 09:57:48 -0700
commit3b8af078281a5a20f951b9fd84f38d92b8f6217b (patch)
tree92c250b9011e2ee5e0e1a2517e7c7ee550853ddc /tests
parent8f8c25eabb97da8eda488895f04f2d12cb5ea4cf (diff)
Add isSingleComponent bool to getConstantColorComponent
Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components. BUG=skia: Review URL: https://codereview.chromium.org/608253002
Diffstat (limited to 'tests')
-rw-r--r--tests/GpuColorFilterTest.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/GpuColorFilterTest.cpp b/tests/GpuColorFilterTest.cpp
index 202756b0e6..a61fe0b545 100644
--- a/tests/GpuColorFilterTest.cpp
+++ b/tests/GpuColorFilterTest.cpp
@@ -99,12 +99,14 @@ static void test_getConstantColorComponents(skiatest::Reporter* reporter, GrCont
const GetConstantComponentTestCase& test = filterTests[i];
SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(test.filterColor, test.filterMode));
SkAutoTUnref<GrFragmentProcessor> effect(cf->asFragmentProcessor(grContext));
- GrColor color = test.inputColor;
- uint32_t components = test.inputComponents;
- effect->getConstantColorComponents(&color, &components);
-
- REPORTER_ASSERT(reporter, filterColor(color, components) == test.outputColor);
- REPORTER_ASSERT(reporter, test.outputComponents == components);
+ GrProcessor::InvariantOutput inout;
+ inout.fColor = test.inputColor;
+ inout.fValidFlags = test.inputComponents;
+ inout.fIsSingleComponent = false;
+ effect->computeInvariantOutput(&inout);
+
+ REPORTER_ASSERT(reporter, filterColor(inout.fColor, inout.fValidFlags) == test.outputColor);
+ REPORTER_ASSERT(reporter, test.outputComponents == inout.fValidFlags);
}
}