Route paint texture unit binding through GL backend
This commit is contained in:
@@ -2359,6 +2359,38 @@ void rejects_invalid_render_target_clear_dispatch(pp::tests::Harness& h)
|
||||
PP_EXPECT(h, missing_masked_dispatch.code == pp::foundation::StatusCode::invalid_argument);
|
||||
}
|
||||
|
||||
void activates_texture_unit_through_dispatch(pp::tests::Harness& h)
|
||||
{
|
||||
recorded_active_texture_calls.clear();
|
||||
|
||||
const auto zero = pp::renderer::gl::activate_opengl_texture_unit(
|
||||
0U,
|
||||
pp::renderer::gl::OpenGlActiveTextureDispatch {
|
||||
.active_texture = record_active_texture,
|
||||
});
|
||||
const auto four = pp::renderer::gl::activate_opengl_texture_unit(
|
||||
4U,
|
||||
pp::renderer::gl::OpenGlActiveTextureDispatch {
|
||||
.active_texture = record_active_texture,
|
||||
});
|
||||
|
||||
PP_EXPECT(h, zero.ok());
|
||||
PP_EXPECT(h, four.ok());
|
||||
PP_EXPECT(h, recorded_active_texture_calls.size() == 2U);
|
||||
PP_EXPECT(h, recorded_active_texture_calls[0] == 0x84C0U);
|
||||
PP_EXPECT(h, recorded_active_texture_calls[1] == 0x84C4U);
|
||||
}
|
||||
|
||||
void rejects_incomplete_active_texture_dispatch(pp::tests::Harness& h)
|
||||
{
|
||||
const auto status = pp::renderer::gl::activate_opengl_texture_unit(
|
||||
0U,
|
||||
pp::renderer::gl::OpenGlActiveTextureDispatch {});
|
||||
|
||||
PP_EXPECT(h, !status.ok());
|
||||
PP_EXPECT(h, status.code == pp::foundation::StatusCode::invalid_argument);
|
||||
}
|
||||
|
||||
void applies_viewport_dispatch(pp::tests::Harness& h)
|
||||
{
|
||||
recorded_viewport_calls.clear();
|
||||
@@ -5254,6 +5286,8 @@ int main()
|
||||
harness.run("clears_render_target_through_dispatch", clears_render_target_through_dispatch);
|
||||
harness.run("clears_color_buffer_with_write_mask_and_restores_previous_mask", clears_color_buffer_with_write_mask_and_restores_previous_mask);
|
||||
harness.run("rejects_invalid_render_target_clear_dispatch", rejects_invalid_render_target_clear_dispatch);
|
||||
harness.run("activates_texture_unit_through_dispatch", activates_texture_unit_through_dispatch);
|
||||
harness.run("rejects_incomplete_active_texture_dispatch", rejects_incomplete_active_texture_dispatch);
|
||||
harness.run("applies_viewport_dispatch", applies_viewport_dispatch);
|
||||
harness.run("rejects_incomplete_viewport_dispatch", rejects_incomplete_viewport_dispatch);
|
||||
harness.run("applies_scissor_dispatch", applies_scissor_dispatch);
|
||||
|
||||
Reference in New Issue
Block a user