mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb: Change ASSERTs into VERIFYs when comparing bitmap alpha types
For non-debug builds, this is still very useful to check and doesn't significantly impact any hot paths.
This commit is contained in:
parent
e4a5be0206
commit
d30c217866
Notes:
github-actions[bot]
2025-03-22 16:50:46 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/d30c2178661 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3705
1 changed files with 2 additions and 2 deletions
|
@ -456,8 +456,8 @@ WebIDL::ExceptionOr<GC::Ptr<ImageData>> CanvasRenderingContext2D::get_image_data
|
|||
// NOTE: Internally we must use premultiplied alpha, but ImageData should hold unpremultiplied alpha. This conversion
|
||||
// might result in a loss of precision, but is according to spec.
|
||||
// See: https://html.spec.whatwg.org/multipage/canvas.html#premultiplied-alpha-and-the-2d-rendering-context
|
||||
ASSERT(snapshot->alpha_type() == Gfx::AlphaType::Premultiplied);
|
||||
ASSERT(image_data->bitmap().alpha_type() == Gfx::AlphaType::Unpremultiplied);
|
||||
VERIFY(snapshot->alpha_type() == Gfx::AlphaType::Premultiplied);
|
||||
VERIFY(image_data->bitmap().alpha_type() == Gfx::AlphaType::Unpremultiplied);
|
||||
|
||||
auto painter = Gfx::Painter::create(image_data->bitmap());
|
||||
painter->draw_bitmap(image_data->bitmap().rect().to_type<float>(), *snapshot, source_rect_intersected, Gfx::ScalingMode::NearestNeighbor, {}, 1, Gfx::CompositingAndBlendingOperator::SourceOver);
|
||||
|
|
Loading…
Add table
Reference in a new issue