1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 09:17:45 +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

@ -43,12 +43,6 @@ PageHost::PageHost(ConnectionFromClient& client)
m_client.async_did_invalidate_content_rect({ m_invalidation_rect.x().value(), m_invalidation_rect.y().value(), m_invalidation_rect.width().value(), m_invalidation_rect.height().value() });
m_invalidation_rect = {};
});
if (s_use_gpu_painter) {
#ifdef HAS_ACCELERATED_GRAPHICS
m_accelerated_painter = AccelGfx::Painter::create();
#endif
}
}
PageHost::~PageHost() = default;
@ -164,10 +158,8 @@ void PageHost::paint(Web::DevicePixelRect const& content_rect, Gfx::Bitmap& targ
if (s_use_gpu_painter) {
#ifdef HAS_ACCELERATED_GRAPHICS
m_accelerated_painter->set_target_canvas(AccelGfx::Canvas::create(target.size()));
Web::Painting::PaintingCommandExecutorGPU painting_command_executor(*m_accelerated_painter);
Web::Painting::PaintingCommandExecutorGPU painting_command_executor(target);
recording_painter.execute(painting_command_executor);
m_accelerated_painter->flush(target);
#endif
} else {
Web::Painting::PaintingCommandExecutorCPU painting_command_executor(target);

View file

@ -143,10 +143,6 @@ private:
Web::CSS::PreferredColorScheme m_preferred_color_scheme { Web::CSS::PreferredColorScheme::Auto };
RefPtr<WebDriverConnection> m_webdriver;
#ifdef HAS_ACCELERATED_GRAPHICS
OwnPtr<AccelGfx::Painter> m_accelerated_painter;
#endif
};
}