1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:08:13 +00:00

LibGL: Stop unnecessarily casting to float

If the `GLContext`'s internal state uses a `float`, it makes no sense
casting to and from `double`s.
This commit is contained in:
Jelle Raaijmakers 2023-01-01 21:11:20 +01:00 committed by Andreas Kling
parent 474f9e9c69
commit ee4039caf8
5 changed files with 21 additions and 26 deletions

View file

@ -117,13 +117,13 @@ void GLContext::gl_clear_color(GLclampf red, GLclampf green, GLclampf blue, GLcl
m_clear_color.clamp(0.f, 1.f);
}
void GLContext::gl_clear_depth(GLdouble depth)
void GLContext::gl_clear_depth(GLfloat depth)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_clear_depth, depth);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
m_clear_depth = clamp(static_cast<float>(depth), 0.f, 1.f);
m_clear_depth = clamp(depth, 0.f, 1.f);
}
void GLContext::gl_end()