Extract stroke draw main pass texture dispatch
This commit is contained in:
@@ -1729,6 +1729,74 @@ void plans_canvas_stroke_dual_material_intent(pp::tests::Harness& h)
|
||||
PP_EXPECT(h, has_texture_binding(dual_composite_pattern, CanvasStrokeTextureRole::pattern, 2));
|
||||
}
|
||||
|
||||
void legacy_canvas_stroke_main_pass_texture_dispatch_preserves_order(pp::tests::Harness& h)
|
||||
{
|
||||
std::vector<std::string> steps;
|
||||
const auto dispatch = pp::panopainter::make_legacy_canvas_stroke_main_pass_texture_dispatch(
|
||||
[&](int slot) {
|
||||
steps.emplace_back("activate:" + std::to_string(slot));
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("bind-tip");
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("unbind-tip");
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("bind-pattern");
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("bind-mixer");
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("unbind-mixer");
|
||||
});
|
||||
|
||||
pp::panopainter::bind_legacy_canvas_stroke_texture_inputs(
|
||||
std::array {
|
||||
pp::panopainter::LegacyCanvasStrokeTextureBinding {
|
||||
.input = pp::panopainter::LegacyCanvasStrokeTextureInput::brush_tip,
|
||||
.slot = 0,
|
||||
},
|
||||
pp::panopainter::LegacyCanvasStrokeTextureBinding {
|
||||
.input = pp::panopainter::LegacyCanvasStrokeTextureInput::pattern,
|
||||
.slot = 2,
|
||||
},
|
||||
pp::panopainter::LegacyCanvasStrokeTextureBinding {
|
||||
.input = pp::panopainter::LegacyCanvasStrokeTextureInput::mixer,
|
||||
.slot = 3,
|
||||
},
|
||||
},
|
||||
dispatch);
|
||||
|
||||
pp::panopainter::unbind_legacy_canvas_stroke_texture_inputs(
|
||||
std::array {
|
||||
pp::panopainter::LegacyCanvasStrokeTextureBinding {
|
||||
.input = pp::panopainter::LegacyCanvasStrokeTextureInput::mixer,
|
||||
.slot = 3,
|
||||
},
|
||||
pp::panopainter::LegacyCanvasStrokeTextureBinding {
|
||||
.input = pp::panopainter::LegacyCanvasStrokeTextureInput::brush_tip,
|
||||
.slot = 0,
|
||||
},
|
||||
},
|
||||
dispatch);
|
||||
|
||||
const std::vector<std::string> expected {
|
||||
"activate:0",
|
||||
"bind-tip",
|
||||
"activate:2",
|
||||
"bind-pattern",
|
||||
"activate:3",
|
||||
"bind-mixer",
|
||||
"activate:3",
|
||||
"unbind-mixer",
|
||||
"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(
|
||||
@@ -3598,6 +3666,9 @@ int main()
|
||||
harness.run("rejects_bad_stroke_composite_plans", rejects_bad_stroke_composite_plans);
|
||||
harness.run("plans_canvas_stroke_material_passes", plans_canvas_stroke_material_passes);
|
||||
harness.run("plans_canvas_stroke_dual_material_intent", plans_canvas_stroke_dual_material_intent);
|
||||
harness.run(
|
||||
"legacy_canvas_stroke_main_pass_texture_dispatch_preserves_order",
|
||||
legacy_canvas_stroke_main_pass_texture_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