Move render debug state setup into GL backend
This commit is contained in:
@@ -2190,6 +2190,58 @@ void rejects_incomplete_generic_capability_dispatch(pp::tests::Harness& h)
|
||||
PP_EXPECT(h, status.code == pp::foundation::StatusCode::invalid_argument);
|
||||
}
|
||||
|
||||
void applies_render_platform_hints(pp::tests::Harness& h)
|
||||
{
|
||||
recorded_state_calls.clear();
|
||||
|
||||
const auto status = pp::renderer::gl::apply_opengl_render_platform_hints(
|
||||
pp::renderer::gl::OpenGlRenderPlatformHintDispatch {
|
||||
.enable = record_enable,
|
||||
});
|
||||
|
||||
PP_EXPECT(h, status.ok());
|
||||
PP_EXPECT(h, recorded_state_calls.size() == 2U);
|
||||
PP_EXPECT(h, recorded_state_calls[0].kind == RecordedOpenGlStateCall::Kind::enable);
|
||||
PP_EXPECT(h, recorded_state_calls[0].first == 0x8642U);
|
||||
PP_EXPECT(h, recorded_state_calls[1].kind == RecordedOpenGlStateCall::Kind::enable);
|
||||
PP_EXPECT(h, recorded_state_calls[1].first == 0x0B20U);
|
||||
}
|
||||
|
||||
void rejects_incomplete_render_platform_hint_dispatch(pp::tests::Harness& h)
|
||||
{
|
||||
const auto status = pp::renderer::gl::apply_opengl_render_platform_hints(
|
||||
pp::renderer::gl::OpenGlRenderPlatformHintDispatch {});
|
||||
|
||||
PP_EXPECT(h, !status.ok());
|
||||
PP_EXPECT(h, status.code == pp::foundation::StatusCode::invalid_argument);
|
||||
}
|
||||
|
||||
void applies_debug_output_states(pp::tests::Harness& h)
|
||||
{
|
||||
recorded_state_calls.clear();
|
||||
|
||||
const auto status = pp::renderer::gl::apply_opengl_debug_output_states(
|
||||
pp::renderer::gl::OpenGlDebugOutputStateDispatch {
|
||||
.enable = record_enable,
|
||||
});
|
||||
|
||||
PP_EXPECT(h, status.ok());
|
||||
PP_EXPECT(h, recorded_state_calls.size() == 2U);
|
||||
PP_EXPECT(h, recorded_state_calls[0].kind == RecordedOpenGlStateCall::Kind::enable);
|
||||
PP_EXPECT(h, recorded_state_calls[0].first == 0x92E0U);
|
||||
PP_EXPECT(h, recorded_state_calls[1].kind == RecordedOpenGlStateCall::Kind::enable);
|
||||
PP_EXPECT(h, recorded_state_calls[1].first == 0x8242U);
|
||||
}
|
||||
|
||||
void rejects_incomplete_debug_output_state_dispatch(pp::tests::Harness& h)
|
||||
{
|
||||
const auto status = pp::renderer::gl::apply_opengl_debug_output_states(
|
||||
pp::renderer::gl::OpenGlDebugOutputStateDispatch {});
|
||||
|
||||
PP_EXPECT(h, !status.ok());
|
||||
PP_EXPECT(h, status.code == pp::foundation::StatusCode::invalid_argument);
|
||||
}
|
||||
|
||||
void applies_buffer_clear_dispatch(pp::tests::Harness& h)
|
||||
{
|
||||
recorded_clear_calls.clear();
|
||||
@@ -4325,6 +4377,10 @@ int main()
|
||||
harness.run("rejects_incomplete_scissor_test_dispatch", rejects_incomplete_scissor_test_dispatch);
|
||||
harness.run("applies_generic_capability_dispatch", applies_generic_capability_dispatch);
|
||||
harness.run("rejects_incomplete_generic_capability_dispatch", rejects_incomplete_generic_capability_dispatch);
|
||||
harness.run("applies_render_platform_hints", applies_render_platform_hints);
|
||||
harness.run("rejects_incomplete_render_platform_hint_dispatch", rejects_incomplete_render_platform_hint_dispatch);
|
||||
harness.run("applies_debug_output_states", applies_debug_output_states);
|
||||
harness.run("rejects_incomplete_debug_output_state_dispatch", rejects_incomplete_debug_output_state_dispatch);
|
||||
harness.run("applies_buffer_clear_dispatch", applies_buffer_clear_dispatch);
|
||||
harness.run("rejects_incomplete_buffer_clear_dispatch", rejects_incomplete_buffer_clear_dispatch);
|
||||
harness.run("allocates_texture_2d_through_dispatch", allocates_texture_2d_through_dispatch);
|
||||
|
||||
Reference in New Issue
Block a user