From 0abddf7bb7f77b1ff6a48efc9d1eafd053d975d2 Mon Sep 17 00:00:00 2001 From: mtklein Date: Wed, 13 Jul 2016 08:22:20 -0700 Subject: SkRasterPipeline: simplify impl and remove need to rewire stages This builds the stages correctly wired from the get-go. With a little clever setup, we can also design around the previous error cases like having no stages or pipelines that call st->next() off the end. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2149443002 Review-Url: https://codereview.chromium.org/2149443002 --- tests/SkRasterPipelineTest.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/SkRasterPipelineTest.cpp') diff --git a/tests/SkRasterPipelineTest.cpp b/tests/SkRasterPipelineTest.cpp index 1db0206705..beb517b3f7 100644 --- a/tests/SkRasterPipelineTest.cpp +++ b/tests/SkRasterPipelineTest.cpp @@ -85,3 +85,17 @@ DEF_TEST(SkRasterPipeline, r) { REPORTER_ASSERT(r, dst_vals[3] == 16); REPORTER_ASSERT(r, dst_vals[4] == 25); } + +DEF_TEST(SkRasterPipeline_empty, r) { + // No asserts... just a test that this is safe to run. + SkRasterPipeline p; + p.run(20); +} + +DEF_TEST(SkRasterPipeline_nonsense, r) { + // No asserts... just a test that this is safe to run and terminates. + // square() always calls st->next(); this makes sure we've always got something there to call. + SkRasterPipeline p; + p.append(square); + p.run(20); +} -- cgit v1.2.3