From bd3fe475b846da1ae75f22da67a34ae57d0627bb Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Tue, 25 Oct 2016 15:43:46 -0400 Subject: Convert SkRasterPipeline loads and stores to indirect. This allows us to change the underlying pointer without rebuilding the pipeline, e.g. when moving the blitter from scanline to scanline. The extra overhead when not needed is measurable but small, <2%. We can always add back direct stages later for cases where we know the context pointer will not change. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3943 Change-Id: I827d7e6e4e67d02dd2802610f898f98c5f36f8cb Reviewed-on: https://skia-review.googlesource.com/3943 Reviewed-by: Herb Derby Commit-Queue: Mike Klein --- tests/SkRasterPipelineTest.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests/SkRasterPipelineTest.cpp') diff --git a/tests/SkRasterPipelineTest.cpp b/tests/SkRasterPipelineTest.cpp index 049729043f..96798fcd52 100644 --- a/tests/SkRasterPipelineTest.cpp +++ b/tests/SkRasterPipelineTest.cpp @@ -16,11 +16,15 @@ DEF_TEST(SkRasterPipeline, r) { blue = 0x3800380000000000ull, result; + void* load_s_ctx = &blue; + void* load_d_ctx = &red; + void* store_ctx = &result; + SkRasterPipeline p; - p.append(SkRasterPipeline::load_s_f16, &blue); - p.append(SkRasterPipeline::load_d_f16, &red); + p.append(SkRasterPipeline::load_s_f16, &load_s_ctx); + p.append(SkRasterPipeline::load_d_f16, &load_d_ctx); p.append(SkRasterPipeline::srcover); - p.append(SkRasterPipeline::store_f16, &result); + p.append(SkRasterPipeline::store_f16, &store_ctx); p.compile()(0, 1); // We should see half-intensity magenta. -- cgit v1.2.3