summaryrefslogtreecommitdiff
path: root/Libraries/LibGfx/Painter.cpp
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-09-06 01:10:33 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-12 00:13:29 +0200
commitd6673b384efe02b0d8aa3f0abd58c51afb278485 (patch)
treed54f15648ca1ce2e10c17576c315b95ea1e1bdce /Libraries/LibGfx/Painter.cpp
parent25ccd40d5a5f39f43e548498c06996cc2e721c1f (diff)
downloadserenity-d6673b384efe02b0d8aa3f0abd58c51afb278485.zip
LibGfx: Remove redundant bits() method
In all circumstances, this returned exactly the same thing as scanline_u8(), so let's just remove the silly detour. This does not add any new dependency on Bitmap-internals, because that already existed.
Diffstat (limited to 'Libraries/LibGfx/Painter.cpp')
-rw-r--r--Libraries/LibGfx/Painter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Libraries/LibGfx/Painter.cpp b/Libraries/LibGfx/Painter.cpp
index 9f218c36f9..1844da6a24 100644
--- a/Libraries/LibGfx/Painter.cpp
+++ b/Libraries/LibGfx/Painter.cpp
@@ -51,13 +51,13 @@ template<BitmapFormat format = BitmapFormat::Invalid>
ALWAYS_INLINE Color get_pixel(const Gfx::Bitmap& bitmap, int x, int y)
{
if constexpr (format == BitmapFormat::Indexed8)
- return bitmap.palette_color(bitmap.bits(y)[x]);
+ return bitmap.palette_color(bitmap.scanline_u8(y)[x]);
if constexpr (format == BitmapFormat::Indexed4)
- return bitmap.palette_color(bitmap.bits(y)[x]);
+ return bitmap.palette_color(bitmap.scanline_u8(y)[x]);
if constexpr (format == BitmapFormat::Indexed2)
- return bitmap.palette_color(bitmap.bits(y)[x]);
+ return bitmap.palette_color(bitmap.scanline_u8(y)[x]);
if constexpr (format == BitmapFormat::Indexed1)
- return bitmap.palette_color(bitmap.bits(y)[x]);
+ return bitmap.palette_color(bitmap.scanline_u8(y)[x]);
if constexpr (format == BitmapFormat::RGB32)
return Color::from_rgb(bitmap.scanline(y)[x]);
if constexpr (format == BitmapFormat::RGBA32)
@@ -678,7 +678,7 @@ void Painter::blit(const IntPoint& position, const Gfx::Bitmap& source, const In
}
if (Bitmap::is_indexed(source.format())) {
- const u8* src = source.bits(src_rect.top() + first_row) + src_rect.left() + first_column;
+ const u8* src = source.scanline_u8(src_rect.top() + first_row) + src_rect.left() + first_column;
const size_t src_skip = source.pitch();
for (int row = first_row; row <= last_row; ++row) {
for (int i = 0; i < clipped_rect.width(); ++i)