From 116cf92156090bb3f5c15d5be145f1283884d65d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 10 Jun 2020 10:57:59 +0200 Subject: LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much better visual clue about what type of metric is being used. --- Libraries/LibGfx/Bitmap.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'Libraries/LibGfx/Bitmap.h') diff --git a/Libraries/LibGfx/Bitmap.h b/Libraries/LibGfx/Bitmap.h index 75be882187..4d1a0ef90b 100644 --- a/Libraries/LibGfx/Bitmap.h +++ b/Libraries/LibGfx/Bitmap.h @@ -49,11 +49,11 @@ enum RotationDirection { class Bitmap : public RefCounted { public: - static RefPtr create(BitmapFormat, const Size&); - static RefPtr create_purgeable(BitmapFormat, const Size&); - static RefPtr create_wrapper(BitmapFormat, const Size&, size_t pitch, RGBA32*); + static RefPtr create(BitmapFormat, const IntSize&); + static RefPtr create_purgeable(BitmapFormat, const IntSize&); + static RefPtr create_wrapper(BitmapFormat, const IntSize&, size_t pitch, RGBA32*); static RefPtr load_from_file(const StringView& path); - static RefPtr create_with_shared_buffer(BitmapFormat, NonnullRefPtr&&, const Size&); + static RefPtr create_with_shared_buffer(BitmapFormat, NonnullRefPtr&&, const IntSize&); RefPtr rotated(Gfx::RotationDirection) const; RefPtr flipped(Gfx::Orientation) const; @@ -69,8 +69,8 @@ public: u8* bits(int y); const u8* bits(int y) const; - Rect rect() const { return { {}, m_size }; } - Size size() const { return m_size; } + IntRect rect() const { return { {}, m_size }; } + IntSize size() const { return m_size; } int width() const { return m_size.width(); } int height() const { return m_size.height(); } size_t pitch() const { return m_pitch; } @@ -121,7 +121,7 @@ public: Color get_pixel(int x, int y) const; - Color get_pixel(const Point& position) const + Color get_pixel(const IntPoint& position) const { return get_pixel(position.x(), position.y()); } @@ -136,7 +136,7 @@ public: void set_pixel(int x, int y, Color); - void set_pixel(const Point& position, Color color) + void set_pixel(const IntPoint& position, Color color) { set_pixel(position.x(), position.y(), color); } @@ -149,11 +149,11 @@ public: private: enum class Purgeable { No, Yes }; - Bitmap(BitmapFormat, const Size&, Purgeable); - Bitmap(BitmapFormat, const Size&, size_t pitch, RGBA32*); - Bitmap(BitmapFormat, NonnullRefPtr&&, const Size&); + Bitmap(BitmapFormat, const IntSize&, Purgeable); + Bitmap(BitmapFormat, const IntSize&, size_t pitch, RGBA32*); + Bitmap(BitmapFormat, NonnullRefPtr&&, const IntSize&); - Size m_size; + IntSize m_size; RGBA32* m_data { nullptr }; RGBA32* m_palette { nullptr }; size_t m_pitch { 0 }; -- cgit v1.2.3