Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Unified Diff: tests/GpuColorFilterTest.cpp

Issue 973593002: change colorfilter to return an array of frag processors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update gm Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/effects/SkColorCubeFilter.cpp ('K') | « src/gpu/SkGr.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/GpuColorFilterTest.cpp
diff --git a/tests/GpuColorFilterTest.cpp b/tests/GpuColorFilterTest.cpp
index bf0ba3046a34b1c7f17af522043d6a3e11d3b314..037734eebcf5d1063f01af2f52dce778657aff5e 100644
--- a/tests/GpuColorFilterTest.cpp
+++ b/tests/GpuColorFilterTest.cpp
@@ -99,14 +99,18 @@ static void test_getConstantColorComponents(skiatest::Reporter* reporter, GrCont
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));
- SkAutoTUnref<GrFragmentProcessor> effect(cf->asFragmentProcessor(grContext));
+ SkTDArray<GrFragmentProcessor*> array;
+ bool hasFrag = cf->asFragmentProcessors(grContext, &array);
+ REPORTER_ASSERT(reporter, hasFrag);
+ REPORTER_ASSERT(reporter, 1 == array.count());
GrInvariantOutput inout(test.inputColor,
static_cast<GrColorComponentFlags>(test.inputComponents),
false);
- effect->computeInvariantOutput(&inout);
+ array[0]->computeInvariantOutput(&inout);
REPORTER_ASSERT(reporter, filterColor(inout.color(), inout.validFlags()) == test.outputColor);
REPORTER_ASSERT(reporter, test.outputComponents == inout.validFlags());
+ array[0]->unref();
}
}
« src/effects/SkColorCubeFilter.cpp ('K') | « src/gpu/SkGr.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698