mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +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
46f94a40a8
commit
9e3391b850
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