Route render capture hooks through platform services

This commit is contained in:
2026-06-03 04:54:29 +02:00
parent 7a9b14a86f
commit beb7f717f1
10 changed files with 76 additions and 18 deletions

View File

@@ -65,6 +65,16 @@ public:
++render_context_presents;
}
void begin_render_capture_frame() override
{
++render_capture_begins;
}
void end_render_capture_frame() override
{
++render_capture_ends;
}
void update_platform_frame(float delta_time_seconds) override
{
++platform_frame_updates;
@@ -140,6 +150,8 @@ public:
int render_context_acquires = 0;
int render_context_releases = 0;
int render_context_presents = 0;
int render_capture_begins = 0;
int render_capture_ends = 0;
int platform_frame_updates = 0;
int frame_reports = 0;
int display_file_requests = 0;
@@ -233,6 +245,18 @@ void platform_services_dispatch_render_context_lifecycle(pp::tests::Harness& har
PP_EXPECT(harness, fake.render_context_releases == 1);
}
void platform_services_dispatch_render_capture_hooks(pp::tests::Harness& harness)
{
FakePlatformServices fake("unused");
pp::platform::PlatformServices& services = fake;
services.begin_render_capture_frame();
services.end_render_capture_frame();
PP_EXPECT(harness, fake.render_capture_begins == 1);
PP_EXPECT(harness, fake.render_capture_ends == 1);
}
void platform_services_dispatch_frame_hooks(pp::tests::Harness& harness)
{
FakePlatformServices fake("unused");
@@ -321,6 +345,7 @@ int main()
harness.run("platform services dispatch visibility updates", platform_services_dispatch_visibility_updates);
harness.run("platform services dispatch UI thread lifecycle", platform_services_dispatch_ui_thread_lifecycle);
harness.run("platform services dispatch render context lifecycle", platform_services_dispatch_render_context_lifecycle);
harness.run("platform services dispatch render capture hooks", platform_services_dispatch_render_capture_hooks);
harness.run("platform services dispatch frame hooks", platform_services_dispatch_frame_hooks);
harness.run("platform services dispatch file actions", platform_services_dispatch_file_actions);
harness.run("platform services dispatch picker callbacks", platform_services_dispatch_picker_callbacks);