Commit graph

11 commits

Author SHA1 Message Date
Aliaksandr Kalenik
bd08b1815f LibWeb: Implement border radius corner clipping in GPU painter
It is implemented in the way identical to how it works in CPU painter:
1. SampleUnderCorners command saves pixels within corners into a
   texture.
2. BlitCornerClipping command uses the texture prepared earlier to
   restore pixels within corners.
2023-12-17 23:12:48 +01:00
Aliaksandr Kalenik
5c0cd0f484 LibAccelGfx+LibWeb: Add text shadow support in GPU painter 2023-12-05 09:09:56 +01:00
Aliaksandr Kalenik
2361ce25a0 LibAccelGfx: Set blending for alpha separately to be sum of src and dst
With this change we match blending in LibGfx and it fixes rendering on
all websites that use opacity < 1.
2023-12-04 20:51:00 +01:00
Aliaksandr Kalenik
707added91 LibAccelGfx: Premultiply linear gradient colors by alpha
With this change color blending for gradients matches CPU painter.
2023-11-29 13:53:23 +01:00
Aliaksandr Kalenik
5f7ac559a7 LibAccelGfx+LibWeb: Add support for stacking context opacity
For each stacking context with an opacity less than 1, we create a
separate framebuffer. We then blit the texture attached to this
framebuffer with the specified opacity.

To avoid the performance overhead of reading pixels from the texture
into Gfx::Bitmap, a new method that allows for direct blitting from
the texture is introduced, named blit_scaled_texture().
2023-11-24 08:39:55 +01:00
Aliaksandr Kalenik
53c015695e LibAccelGfx+LibWeb: Implement rounded corners rectangle painting
For now corners antialiasing is missing.
2023-11-20 19:35:25 +01:00
Aliaksandr Kalenik
61a2e59d87 LibAccelGfx+WebContent: Add GPU painter support on macOS
With these changes it is now possible to create OpenGL context on macOS
and run GPU-painter. For now only QT client has a CLI param that turns
it on though.
2023-11-16 15:13:16 +01:00
Aliaksandr Kalenik
01d938c77b LibAccelGfx+LibWeb: Implement SetClipRect and ClearClipRect commands 2023-11-13 19:22:27 +01:00
Aliaksandr Kalenik
6d1a1daff9 LibAccelGfx+LibWeb: Use framebuffer object instead of EGLs PBuffer
Framebuffer object is allocated using OpenGL's API and is not platform
specific which means it could be used on both macOS and Linux unlike
EGL specific PBuffer.
2023-11-11 22:19:43 +01:00
Aliaksandr Kalenik
2d12d1538d LibAccelGfx: Create VBO to pass vertices data to GPU
Before, we were using a feature of OpenGL that allows specifying a
pointer to allocated vertex data without creating VBO and VAO, but as
I found out, it does not work on macOS.
2023-11-11 22:19:43 +01:00
Aliaksandr Kalenik
048e179572 LibAccelGfx: Use wrapping functions with error check for OpenGL calls
This change introduces GL.h with error check wrappers for all the
OpenGL functions we used so far.

For now, the error check is simply:
`VERIFY(glGetError() == GL_NO_ERROR);`
but that is better than continuing execution after encounting an error.
2023-11-11 08:47:12 +01:00