diff options
author | Mike Klein <mtklein@chromium.org> | 2016-10-25 15:43:46 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-26 18:15:03 +0000 |
commit | bd3fe475b846da1ae75f22da67a34ae57d0627bb (patch) | |
tree | 9e82f8fba8acee4ff9e28dbdef797f05c6ebfbe8 /tests/SkRasterPipelineTest.cpp | |
parent | ce37e7af8bc3b141a2d02590f81d3cbdca526cac (diff) |
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 <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tests/SkRasterPipelineTest.cpp')
-rw-r--r-- | tests/SkRasterPipelineTest.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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. |