1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

LibSoftGPU: Use round_to<int> in Device::get_rasterization_rect_of_size

This commit is contained in:
Hendiadyoin1 2022-04-15 19:49:24 +02:00 committed by Linus Groh
parent db0ba9f647
commit d866637074
2 changed files with 4 additions and 4 deletions

View file

@ -1299,14 +1299,14 @@ void Device::set_raster_position(FloatVector4 const& position, FloatMatrix4x4 co
m_raster_position.eye_coordinate_distance = eye_coordinates.length();
}
Gfx::IntRect Device::get_rasterization_rect_of_size(Gfx::IntSize size)
Gfx::IntRect Device::get_rasterization_rect_of_size(Gfx::IntSize size) const
{
// Round the X and Y floating point coordinates to the nearest integer; OpenGL 1.5 spec:
// "Any fragments whose centers lie inside of this rectangle (or on its bottom or left
// boundaries) are produced in correspondence with this particular group of elements."
return {
static_cast<int>(lroundf(m_raster_position.window_coordinates.x())),
static_cast<int>(lroundf(m_raster_position.window_coordinates.y())),
round_to<int>(m_raster_position.window_coordinates.x()),
round_to<int>(m_raster_position.window_coordinates.y()),
size.width(),
size.height(),
};