aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-09-29 06:38:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-29 06:38:55 -0700
commite25eea4b36a488448fb730f4e3dc5a900b0e2892 (patch)
tree6d4dbf179e793c456c2c164a6822528a13cba715 /tests
parentc56c6ef3ce6447f39894649d535acb1606595d31 (diff)
Use child processors to implement compose color filter.
Diffstat (limited to 'tests')
-rw-r--r--tests/GpuColorFilterTest.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/GpuColorFilterTest.cpp b/tests/GpuColorFilterTest.cpp
index a99e91b824..543aefe517 100644
--- a/tests/GpuColorFilterTest.cpp
+++ b/tests/GpuColorFilterTest.cpp
@@ -100,19 +100,18 @@ static void test_getConstantColorComponents(skiatest::Reporter* reporter, GrCont
GrPaint paint;
for (size_t i = 0; i < SK_ARRAY_COUNT(filterTests); ++i) {
const GetConstantComponentTestCase& test = filterTests[i];
- SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(test.filterColor, test.filterMode));
- SkTDArray<const GrFragmentProcessor*> array;
- bool hasFrag = cf->asFragmentProcessors(grContext, paint.getProcessorDataManager(), &array);
- REPORTER_ASSERT(reporter, hasFrag);
- REPORTER_ASSERT(reporter, 1 == array.count());
+ SkAutoTUnref<SkColorFilter> cf(
+ SkColorFilter::CreateModeFilter(test.filterColor, test.filterMode));
+ SkAutoTUnref<const GrFragmentProcessor> fp(
+ cf->asFragmentProcessor(grContext, paint.getProcessorDataManager()));
+ REPORTER_ASSERT(reporter, fp);
GrInvariantOutput inout(test.inputColor,
static_cast<GrColorComponentFlags>(test.inputComponents),
false);
- array[0]->computeInvariantOutput(&inout);
-
- REPORTER_ASSERT(reporter, filterColor(inout.color(), inout.validFlags()) == test.outputColor);
+ fp->computeInvariantOutput(&inout);
+ REPORTER_ASSERT(reporter, filterColor(inout.color(), inout.validFlags()) ==
+ test.outputColor);
REPORTER_ASSERT(reporter, test.outputComponents == inout.validFlags());
- array[0]->unref();
}
}