mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:07:35 +00:00
LibSoftGPU: Use round_to<int> in Device::get_rasterization_rect_of_size
This commit is contained in:
parent
db0ba9f647
commit
d866637074
2 changed files with 4 additions and 4 deletions
|
@ -1299,14 +1299,14 @@ void Device::set_raster_position(FloatVector4 const& position, FloatMatrix4x4 co
|
||||||
m_raster_position.eye_coordinate_distance = eye_coordinates.length();
|
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:
|
// 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
|
// "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."
|
// boundaries) are produced in correspondence with this particular group of elements."
|
||||||
return {
|
return {
|
||||||
static_cast<int>(lroundf(m_raster_position.window_coordinates.x())),
|
round_to<int>(m_raster_position.window_coordinates.x()),
|
||||||
static_cast<int>(lroundf(m_raster_position.window_coordinates.y())),
|
round_to<int>(m_raster_position.window_coordinates.y()),
|
||||||
size.width(),
|
size.width(),
|
||||||
size.height(),
|
size.height(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -75,7 +75,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void draw_statistics_overlay(Gfx::Bitmap&);
|
void draw_statistics_overlay(Gfx::Bitmap&);
|
||||||
Gfx::IntRect get_rasterization_rect_of_size(Gfx::IntSize size);
|
Gfx::IntRect get_rasterization_rect_of_size(Gfx::IntSize size) const;
|
||||||
|
|
||||||
void rasterize_triangle(Triangle const&);
|
void rasterize_triangle(Triangle const&);
|
||||||
void setup_blend_factors();
|
void setup_blend_factors();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue