Share retained stroke temporary composite helper

This commit is contained in:
2026-06-13 11:08:02 +02:00
parent fae108d520
commit cf3b8e856d
6 changed files with 121 additions and 52 deletions

View File

@@ -709,6 +709,27 @@ void retained_stroke_preview_texture_copy_binds_before_copy(pp::tests::Harness&
PP_EXPECT(h, copy_args[5] == 64);
}
void retained_stroke_temporary_composite_preserves_retained_call_order(pp::tests::Harness& h)
{
std::vector<std::string> events;
pp::panopainter::execute_legacy_canvas_stroke_temporary_composite(
[&]() { events.emplace_back("setup"); },
[&]() { events.emplace_back("bind-samplers"); },
[&]() { events.emplace_back("bind-textures"); },
[&]() { events.emplace_back("draw"); },
[&]() { events.emplace_back("unbind-textures"); });
const std::vector<std::string> expected_events {
"setup",
"bind-samplers",
"bind-textures",
"draw",
"unbind-textures",
};
PP_EXPECT(h, events == expected_events);
}
void retained_stroke_mix_pass_skips_inactive_planes_and_preserves_texture_order(pp::tests::Harness& h)
{
const std::array<LegacyCanvasStrokeMixPassPlane, 4> planes {
@@ -825,6 +846,9 @@ int main()
harness.run(
"retained_stroke_preview_texture_copy_binds_before_copy",
retained_stroke_preview_texture_copy_binds_before_copy);
harness.run(
"retained_stroke_temporary_composite_preserves_retained_call_order",
retained_stroke_temporary_composite_preserves_retained_call_order);
harness.run(
"retained_stroke_mix_pass_skips_inactive_planes_and_preserves_texture_order",
retained_stroke_mix_pass_skips_inactive_planes_and_preserves_texture_order);