mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-26 18:09:45 +00:00
LibWeb: Ensure putImageData() is unaffected by drawing state
This commit is contained in:
parent
2ac4544a81
commit
d3ca038b2c
Notes:
github-actions[bot]
2025-10-21 07:53:34 +00:00
Author: https://github.com/tcl3
Commit: d3ca038b2c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6518
Reviewed-by: https://github.com/gmta ✅
3 changed files with 50 additions and 1 deletions
|
|
@ -600,14 +600,18 @@ WebIDL::ExceptionOr<void> CanvasRenderingContext2D::put_pixels_from_an_image_dat
|
|||
// imageData data structure's bitmap, converted from imageData's colorSpace to the color space of bitmap using
|
||||
// 'relative-colorimetric' rendering intent.
|
||||
auto dst_rect = Gfx::FloatRect { dx + dirty_x, dy + dirty_y, dirty_width, dirty_height };
|
||||
painter.save();
|
||||
painter.set_transform({});
|
||||
painter.draw_bitmap(
|
||||
dst_rect,
|
||||
Gfx::ImmutableBitmap::create(image_data.bitmap(), Gfx::AlphaType::Unpremultiplied),
|
||||
Gfx::IntRect { dirty_x, dirty_y, dirty_width, dirty_height },
|
||||
Gfx::ScalingMode::NearestNeighbor,
|
||||
drawing_state().filter,
|
||||
{},
|
||||
1.0f,
|
||||
Gfx::CompositingAndBlendingOperator::SourceOver);
|
||||
painter.restore();
|
||||
|
||||
did_draw(dst_rect);
|
||||
|
||||
return {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue