1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:27:35 +00:00

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().
This commit is contained in:
Aliaksandr Kalenik 2023-11-23 15:28:51 +01:00 committed by Andreas Kling
parent cb90daadc7
commit 5f7ac559a7
8 changed files with 133 additions and 74 deletions

View file

@ -15,6 +15,7 @@
# include <GL/gl.h>
#endif
#include <LibGfx/Forward.h>
#include <LibGfx/Rect.h>
namespace AccelGfx::GL {
@ -41,6 +42,7 @@ struct Uniform {
struct Texture {
GLuint id;
Optional<Gfx::IntSize> size;
};
struct Buffer {
@ -53,7 +55,7 @@ struct VertexArray {
struct Framebuffer {
GLuint fbo_id;
GLuint texture_id;
GL::Texture texture;
};
void set_viewport(Gfx::IntRect);
@ -70,7 +72,7 @@ void delete_program(Program const&);
Texture create_texture();
void bind_texture(Texture const&);
void upload_texture_data(Texture const& texture, Gfx::Bitmap const& bitmap);
void upload_texture_data(Texture& texture, Gfx::Bitmap const& bitmap);
void delete_texture(Texture const&);
void set_uniform(Uniform const& uniform, float, float);