CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Change-Id: I308b6d75f2987a667eead9a55760a2ff6aec2984
Reviewed-on: https://skia-review.googlesource.com/5353
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
pipeline.append(SkRasterPipeline::store_f32, &dst);
break;
}
-
- auto p = pipeline.compile();
-
- p(0,0, count);
+ pipeline.run(0,0, count);
return true;
}
DEFINE_DEFAULT(hash_fn);
+ DEFINE_DEFAULT(run_pipeline);
DEFINE_DEFAULT(compile_pipeline);
DEFINE_DEFAULT(convolve_vertically);
return hash_fn(data, bytes, seed);
}
+ extern void (*run_pipeline)(size_t, size_t, size_t, const SkRasterPipeline::Stage*, int);
extern std::function<void(size_t, size_t, size_t)>
(*compile_pipeline)(const SkRasterPipeline::Stage*, int);
SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named).get(), dst);
p.append(SkRasterPipeline::store_f32, &color4f_ptr);
- p.compile()(0,0,1);
+ p.run(0,0,1);
} else {
// Linear gamma, dst gamut.
swizzle_rb(SkNx_cast<float>(Sk4b::Load(&color)) * (1/255.0f)).store(&color4f);
}
}
+void SkRasterPipeline::run(size_t x, size_t y, size_t n) const {
+ SkOpts::run_pipeline(x,y,n, fStages, fNum);
+}
+
std::function<void(size_t, size_t, size_t)> SkRasterPipeline::compile() const {
return SkOpts::compile_pipeline(fStages, fNum);
}
void extend(const SkRasterPipeline&);
// Runs the pipeline walking x through [x,x+n), holding y constant.
+ void run(size_t x, size_t y, size_t n) const;
+
+ // If you're going to run() the pipeline more than once, it's best to compile it.
std::function<void(size_t x, size_t y, size_t n)> compile() const;
void dump() const;
if (is_constant) {
pipeline->append(SkRasterPipeline::store_f32, &paintColor);
- pipeline->compile()(0,0, 1);
+ pipeline->run(0,0, 1);
*pipeline = SkRasterPipeline();
pipeline->append(SkRasterPipeline::constant_color, paintColor);
namespace SkOpts {
void Init_hsw() {
+ run_pipeline = hsw::run_pipeline;
compile_pipeline = hsw::compile_pipeline;
}
}
box_blur_yx = sse41::box_blur_yx;
srcover_srgb_srgb = sse41::srcover_srgb_srgb;
blit_row_s32a_opaque = sse41::blit_row_s32a_opaque;
+ run_pipeline = sse41::run_pipeline;
compile_pipeline = sse41::compile_pipeline;
}
}
return fn;
}
+ SI void run_pipeline(size_t x, size_t y, size_t n,
+ const SkRasterPipeline::Stage* stages, int nstages) {
+ compile_pipeline(stages, nstages)(x,y,n);
+ }
+
} // namespace SK_OPTS_NS
#undef SI
p.append(SkRasterPipeline::load_f16_d, &load_d_ctx);
p.append(SkRasterPipeline::srcover);
p.append(SkRasterPipeline::store_f16, &store_ctx);
- p.compile()(0,0, 1);
+ p.run(0,0, 1);
// We should see half-intensity magenta.
REPORTER_ASSERT(r, ((result >> 0) & 0xffff) == 0x3800);
DEF_TEST(SkRasterPipeline_empty, r) {
// No asserts... just a test that this is safe to run.
SkRasterPipeline p;
- p.compile()(0,0, 20);
+ p.run(0,0, 20);
}
DEF_TEST(SkRasterPipeline_nonsense, r) {
// srcover() calls st->next(); this makes sure we've always got something there to call.
SkRasterPipeline p;
p.append(SkRasterPipeline::srcover);
- p.compile()(0,0, 20);
+ p.run(0,0, 20);
}