Extract dual brush tip dispatch
This commit is contained in:
@@ -1892,6 +1892,48 @@ void legacy_canvas_stroke_live_pass_sampler_dispatch_preserves_order(pp::tests::
|
||||
PP_EXPECT(h, steps == expected);
|
||||
}
|
||||
|
||||
void legacy_canvas_stroke_dual_pass_brush_tip_dispatch_preserves_order(pp::tests::Harness& h)
|
||||
{
|
||||
std::vector<std::string> steps;
|
||||
const auto dispatch = pp::panopainter::make_legacy_canvas_stroke_brush_tip_texture_dispatch(
|
||||
[&](int slot) {
|
||||
steps.emplace_back("activate:" + std::to_string(slot));
|
||||
},
|
||||
[&](int) {
|
||||
steps.emplace_back("bind-tip");
|
||||
},
|
||||
[&](int) {
|
||||
steps.emplace_back("unbind-tip");
|
||||
},
|
||||
0);
|
||||
|
||||
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
|
||||
std::array {
|
||||
pp::panopainter::LegacyCanvasStrokeTextureBinding {
|
||||
.input = pp::panopainter::LegacyCanvasStrokeTextureInput::brush_tip,
|
||||
.slot = 0,
|
||||
},
|
||||
},
|
||||
dispatch);
|
||||
|
||||
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
||||
std::array {
|
||||
pp::panopainter::LegacyCanvasStrokeTextureBinding {
|
||||
.input = pp::panopainter::LegacyCanvasStrokeTextureInput::brush_tip,
|
||||
.slot = 0,
|
||||
},
|
||||
},
|
||||
dispatch);
|
||||
|
||||
const std::vector<std::string> expected {
|
||||
"activate:0",
|
||||
"bind-tip",
|
||||
"activate:0",
|
||||
"unbind-tip",
|
||||
};
|
||||
PP_EXPECT(h, steps == expected);
|
||||
}
|
||||
|
||||
void plans_canvas_stroke_commit_erase_sequence(pp::tests::Harness& h)
|
||||
{
|
||||
const auto plan = plan_canvas_stroke_commit_sequence(
|
||||
@@ -3767,6 +3809,9 @@ int main()
|
||||
harness.run(
|
||||
"legacy_canvas_stroke_live_pass_sampler_dispatch_preserves_order",
|
||||
legacy_canvas_stroke_live_pass_sampler_dispatch_preserves_order);
|
||||
harness.run(
|
||||
"legacy_canvas_stroke_dual_pass_brush_tip_dispatch_preserves_order",
|
||||
legacy_canvas_stroke_dual_pass_brush_tip_dispatch_preserves_order);
|
||||
harness.run("plans_canvas_stroke_commit_erase_sequence", plans_canvas_stroke_commit_erase_sequence);
|
||||
harness.run("plans_canvas_stroke_commit_composite_sequence", plans_canvas_stroke_commit_composite_sequence);
|
||||
harness.run(
|
||||
|
||||
Reference in New Issue
Block a user