mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
5865cf5864
When converting a `Gfx::Bitmap` to a Skia bitmap, we cannot assume the color data is unpremultiplied. For example, everything canvas-related uses premultiplied color data: https://html.spec.whatwg.org/multipage/canvas.html#premultiplied-alpha-and-the-2d-rendering-context We were probably assuming unpremultiplied since that is what the PNG decoder gives us. Since we now make `Gfx::Bitmap` identify what alpha type is being used, we can instruct Skia a bit better :^) Update our `EdgeFlagPathRasterizer` to use premultiplied alpha instead of unpremultiplied so we can apply alpha correctly for path masks. This fixes the dark borders sometimes visible when SVGs are blended with a colored background. This also exposed an issue with our `CanvasRenderingContext2D`, which is supposed to hold a bitmap with premultiplied alpha internally but expose a bitmap with unpremultiplied alpha in `CanvasImageData`. Expand our C2D test to include the alpha channel as well. Finally, this also exposed an off-by-one issue in `EdgeFlagPathRasterizer` which caused the last scanlines for edges to render incorrectly. We had some reference images which included these corruptions (they were almost unnoticeable), so update them as well. |
||
---|---|---|
.. | ||
Font | ||
ICC | ||
ImageFormats | ||
AffineTransform.cpp | ||
AffineTransform.h | ||
AntiAliasingPainter.cpp | ||
AntiAliasingPainter.h | ||
Bitmap.cpp | ||
Bitmap.h | ||
BoundingBox.h | ||
CIELAB.h | ||
CMakeLists.txt | ||
CMYKBitmap.cpp | ||
CMYKBitmap.h | ||
Color.cpp | ||
Color.h | ||
Color.swift | ||
DeltaE.cpp | ||
DeltaE.h | ||
DisjointRectSet.h | ||
EdgeFlagPathRasterizer.cpp | ||
EdgeFlagPathRasterizer.h | ||
FontCascadeList.cpp | ||
FontCascadeList.h | ||
Forward.h | ||
FourCC.h | ||
GradientPainting.cpp | ||
Gradients.h | ||
ImmutableBitmap.cpp | ||
ImmutableBitmap.h | ||
Line.h | ||
LineStyle.h | ||
Matrix.h | ||
Matrix3x3.h | ||
Matrix4x4.h | ||
MedianCut.cpp | ||
MedianCut.h | ||
Orientation.h | ||
Painter.cpp | ||
Painter.h | ||
PaintStyle.h | ||
Palette.cpp | ||
Palette.h | ||
Path.cpp | ||
Path.h | ||
PathClipper.cpp | ||
PathClipper.h | ||
Point.cpp | ||
Point.h | ||
Quad.h | ||
Rect.cpp | ||
Rect.h | ||
ScalingMode.h | ||
ShareableBitmap.cpp | ||
ShareableBitmap.h | ||
Size.cpp | ||
Size.h | ||
StandardCursor.h | ||
SystemTheme.cpp | ||
SystemTheme.h | ||
TextAlignment.h | ||
TextAttributes.h | ||
TextLayout.cpp | ||
TextLayout.h | ||
TIFFGenerator.py | ||
Triangle.cpp | ||
Triangle.h | ||
Vector2.h | ||
Vector3.h | ||
Vector4.h | ||
VectorGraphic.cpp | ||
VectorGraphic.h | ||
VectorN.h | ||
WindingRule.h |