diff options
author | MacDue <macdue@dueutil.tech> | 2022-12-06 21:35:32 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-07 11:48:27 +0100 |
commit | 27fae783359ece05400dcbee66c50fee97cd1b0b (patch) | |
tree | 7918baf077884d287a8dce3ad7ccad9f9d1aaaf0 /Userland/Libraries/LibSoftGPU | |
parent | e011eafd3790ca0375a4678a9cb2debd0ae95ac7 (diff) | |
download | serenity-27fae783359ece05400dcbee66c50fee97cd1b0b.zip |
Meta+Userland: Pass Gfx::IntSize by value
Just two ints like Gfx::IntPoint.
Diffstat (limited to 'Userland/Libraries/LibSoftGPU')
-rw-r--r-- | Userland/Libraries/LibSoftGPU/Buffer/FrameBuffer.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibSoftGPU/Buffer/Typed2DBuffer.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibSoftGPU/Device.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibSoftGPU/Device.h | 4 |
4 files changed, 7 insertions, 7 deletions
diff --git a/Userland/Libraries/LibSoftGPU/Buffer/FrameBuffer.h b/Userland/Libraries/LibSoftGPU/Buffer/FrameBuffer.h index 7945339fe9..289c80ad78 100644 --- a/Userland/Libraries/LibSoftGPU/Buffer/FrameBuffer.h +++ b/Userland/Libraries/LibSoftGPU/Buffer/FrameBuffer.h @@ -25,7 +25,7 @@ namespace SoftGPU { template<typename C, typename D, typename S> class FrameBuffer final : public RefCounted<FrameBuffer<C, D, S>> { public: - static ErrorOr<NonnullRefPtr<FrameBuffer<C, D, S>>> try_create(Gfx::IntSize const& size) + static ErrorOr<NonnullRefPtr<FrameBuffer<C, D, S>>> try_create(Gfx::IntSize size) { Gfx::IntRect rect = { 0, 0, size.width(), size.height() }; auto color_buffer = TRY(Typed2DBuffer<C>::try_create(size)); diff --git a/Userland/Libraries/LibSoftGPU/Buffer/Typed2DBuffer.h b/Userland/Libraries/LibSoftGPU/Buffer/Typed2DBuffer.h index adaa3cb6c5..96b45fbe4f 100644 --- a/Userland/Libraries/LibSoftGPU/Buffer/Typed2DBuffer.h +++ b/Userland/Libraries/LibSoftGPU/Buffer/Typed2DBuffer.h @@ -23,7 +23,7 @@ namespace SoftGPU { template<typename T> class Typed2DBuffer final : public RefCounted<Typed2DBuffer<T>> { public: - static ErrorOr<NonnullRefPtr<Typed2DBuffer>> try_create(Gfx::IntSize const& size) + static ErrorOr<NonnullRefPtr<Typed2DBuffer>> try_create(Gfx::IntSize size) { auto buffer = TRY(Typed3DBuffer<T>::try_create(size.width(), size.height(), 1)); return adopt_ref(*new Typed2DBuffer(buffer)); diff --git a/Userland/Libraries/LibSoftGPU/Device.cpp b/Userland/Libraries/LibSoftGPU/Device.cpp index 284daabb72..c3085a9328 100644 --- a/Userland/Libraries/LibSoftGPU/Device.cpp +++ b/Userland/Libraries/LibSoftGPU/Device.cpp @@ -821,7 +821,7 @@ void Device::rasterize_triangle(Triangle& triangle) }); } -Device::Device(Gfx::IntSize const& size) +Device::Device(Gfx::IntSize size) : m_frame_buffer(FrameBuffer<GPU::ColorType, GPU::DepthType, GPU::StencilType>::try_create(size).release_value_but_fixme_should_propagate_errors()) { m_options.scissor_box = m_frame_buffer->rect(); @@ -1361,7 +1361,7 @@ ALWAYS_INLINE void Device::shade_fragments(PixelQuad& quad) quad.out_color.set_w(quad.out_color.w() * quad.coverage); } -void Device::resize(Gfx::IntSize const& size) +void Device::resize(Gfx::IntSize size) { auto frame_buffer_or_error = FrameBuffer<GPU::ColorType, GPU::DepthType, GPU::StencilType>::try_create(size); m_frame_buffer = MUST(frame_buffer_or_error); @@ -1711,7 +1711,7 @@ Gfx::IntRect Device::get_rasterization_rect_of_size(Gfx::IntSize size) const extern "C" { -GPU::Device* serenity_gpu_create_device(Gfx::IntSize const& size) +GPU::Device* serenity_gpu_create_device(Gfx::IntSize size) { return make<SoftGPU::Device>(size).leak_ptr(); } diff --git a/Userland/Libraries/LibSoftGPU/Device.h b/Userland/Libraries/LibSoftGPU/Device.h index 31e3dc22ee..c772814d03 100644 --- a/Userland/Libraries/LibSoftGPU/Device.h +++ b/Userland/Libraries/LibSoftGPU/Device.h @@ -43,12 +43,12 @@ struct PixelQuad; class Device final : public GPU::Device { public: - Device(Gfx::IntSize const& min_size); + Device(Gfx::IntSize min_size); virtual GPU::DeviceInfo info() const override; virtual void draw_primitives(GPU::PrimitiveType, FloatMatrix4x4 const& model_view_transform, FloatMatrix4x4 const& projection_transform, Vector<GPU::Vertex>& vertices) override; - virtual void resize(Gfx::IntSize const& min_size) override; + virtual void resize(Gfx::IntSize min_size) override; virtual void clear_color(FloatVector4 const&) override; virtual void clear_depth(GPU::DepthType) override; virtual void clear_stencil(GPU::StencilType) override; |