mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 01:29:17 +00:00
LibGfx+LibWeb: Specify bottom left origin for WebGL's PaintingSurface
By doing that we eliminate the need for the vertical flip flag. As a side effect it fixes the bug when doing: `canvasContext2d.drawImage(canvasWithWebGLContext, 0, 0);` produced a flipped image because we didn't account for different origin while serializing PaintingSurface into Gfx::Bitmap. Visual progress on https://ciechanow.ski/curves-and-surfaces/
This commit is contained in:
parent
28388f1fd2
commit
30d915c361
Notes:
github-actions[bot]
2024-12-20 19:48:39 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 30d915c361
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2994
4 changed files with 20 additions and 19 deletions
|
@ -152,17 +152,7 @@ void DisplayListPlayerSkia::draw_painting_surface(DrawPaintingSurface const& com
|
|||
auto& canvas = surface().canvas();
|
||||
auto image = sk_surface.makeImageSnapshot();
|
||||
SkPaint paint;
|
||||
if (command.surface->flip_vertically()) {
|
||||
canvas.save();
|
||||
SkMatrix matrix;
|
||||
matrix.setIdentity();
|
||||
matrix.preScale(1, -1, dst_rect.centerX(), dst_rect.centerY());
|
||||
canvas.concat(matrix);
|
||||
}
|
||||
canvas.drawImageRect(image, src_rect, dst_rect, to_skia_sampling_options(command.scaling_mode), &paint, SkCanvas::kStrict_SrcRectConstraint);
|
||||
if (command.surface->flip_vertically()) {
|
||||
canvas.restore();
|
||||
}
|
||||
}
|
||||
|
||||
void DisplayListPlayerSkia::draw_scaled_immutable_bitmap(DrawScaledImmutableBitmap const& command)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue