Extract stroke draw pad face helper
This commit is contained in:
@@ -2009,6 +2009,58 @@ void legacy_canvas_stroke_pad_destination_dispatch_preserves_order(pp::tests::Ha
|
||||
PP_EXPECT(h, steps == expected);
|
||||
}
|
||||
|
||||
void legacy_canvas_stroke_pad_face_callbacks_preserve_order(pp::tests::Harness& h)
|
||||
{
|
||||
std::vector<std::string> steps;
|
||||
const auto padded_faces = pp::panopainter::execute_legacy_canvas_stroke_pad_face_callbacks(
|
||||
std::array {
|
||||
pp::panopainter::LegacyCanvasStrokePadFace {
|
||||
.index = 2,
|
||||
.dirty = true,
|
||||
.pass_dirty_box = glm::vec4(1.f),
|
||||
},
|
||||
},
|
||||
pp::renderer::Extent2D { 64U, 32U },
|
||||
true,
|
||||
[&](std::span<const vertex_t> pad_quad) {
|
||||
steps.emplace_back("upload:" + std::to_string(pad_quad.size()));
|
||||
},
|
||||
[&](int face_index) {
|
||||
steps.emplace_back("begin:" + std::to_string(face_index));
|
||||
},
|
||||
[&](int face_index) {
|
||||
steps.emplace_back("bind:" + std::to_string(face_index));
|
||||
},
|
||||
[&](const pp::paint_renderer::CanvasStrokeCopyRegion& copy_region) {
|
||||
steps.emplace_back(
|
||||
"copy:" + std::to_string(copy_region.x) + "," +
|
||||
std::to_string(copy_region.y) + "," +
|
||||
std::to_string(copy_region.width) + "," +
|
||||
std::to_string(copy_region.height));
|
||||
},
|
||||
[&](int face_index) {
|
||||
steps.emplace_back("unbind:" + std::to_string(face_index));
|
||||
},
|
||||
[&] {
|
||||
steps.emplace_back("draw");
|
||||
},
|
||||
[&](int face_index) {
|
||||
steps.emplace_back("finish:" + std::to_string(face_index));
|
||||
});
|
||||
|
||||
const std::vector<std::string> expected {
|
||||
"upload:6",
|
||||
"begin:2",
|
||||
"bind:2",
|
||||
"copy:0,0,64,32",
|
||||
"draw",
|
||||
"unbind:2",
|
||||
"finish:2",
|
||||
};
|
||||
PP_EXPECT(h, padded_faces == 1U);
|
||||
PP_EXPECT(h, steps == expected);
|
||||
}
|
||||
|
||||
void plans_canvas_stroke_commit_erase_sequence(pp::tests::Harness& h)
|
||||
{
|
||||
const auto plan = plan_canvas_stroke_commit_sequence(
|
||||
|
||||
Reference in New Issue
Block a user