mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
LibGfx/PortableFormat: Write directly to the bitmap
No need to copy the data first to a Vector and then to the Bitmap. We can skip this unnecessary step.
This commit is contained in:
parent
d8c1150f6b
commit
d00a563462
4 changed files with 19 additions and 55 deletions
|
@ -175,18 +175,6 @@ static ErrorOr<void> create_bitmap(TContext& context)
|
|||
return {};
|
||||
}
|
||||
|
||||
template<typename TContext>
|
||||
static void set_pixels(TContext& context, Vector<Gfx::Color> const& color_data)
|
||||
{
|
||||
size_t index = 0;
|
||||
for (size_t y = 0; y < context.height; ++y) {
|
||||
for (size_t x = 0; x < context.width; ++x) {
|
||||
context.bitmap->set_pixel(x, y, color_data.at(index));
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<typename TContext>
|
||||
static ErrorOr<void> decode(TContext& context)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue