mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 01:42:54 +00:00
LibWeb: Implement GLES2 context creation
For now only macOS is supported. IOSurface is used as a backing store because it will allow us to read it from Skia and write to it from OpenGL without any extra copying: - ANGLE_metal_texture_client_buffer extension is used to create EGLSurface from IOSurface. - Then the same IOSurface is wrapped into Metal texture and passed to Skia allowing to share the same memory between Skia Metal backend and ANGLE.
This commit is contained in:
parent
d133b0aded
commit
38488b9ef3
Notes:
github-actions[bot]
2024-12-03 22:37:28 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 38488b9ef3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2688
Reviewed-by: https://github.com/ADKaster ✅
5 changed files with 223 additions and 19 deletions
|
@ -121,8 +121,8 @@ void HTMLCanvasElement::reset_context_to_default_state()
|
|||
[](GC::Ref<CanvasRenderingContext2D>& context) {
|
||||
context->reset_to_default_state();
|
||||
},
|
||||
[](GC::Ref<WebGL::WebGLRenderingContext>&) {
|
||||
TODO();
|
||||
[](GC::Ref<WebGL::WebGLRenderingContext>& context) {
|
||||
context->reset_to_default_state();
|
||||
},
|
||||
[](Empty) {
|
||||
// Do nothing.
|
||||
|
@ -135,8 +135,8 @@ void HTMLCanvasElement::notify_context_about_canvas_size_change()
|
|||
[&](GC::Ref<CanvasRenderingContext2D>& context) {
|
||||
context->set_size(bitmap_size_for_canvas());
|
||||
},
|
||||
[&](GC::Ref<WebGL::WebGLRenderingContext>&) {
|
||||
TODO();
|
||||
[&](GC::Ref<WebGL::WebGLRenderingContext>& context) {
|
||||
context->set_size(bitmap_size_for_canvas());
|
||||
},
|
||||
[](Empty) {
|
||||
// Do nothing.
|
||||
|
@ -391,8 +391,8 @@ RefPtr<Gfx::PaintingSurface> HTMLCanvasElement::surface() const
|
|||
[&](GC::Ref<CanvasRenderingContext2D> const& context) {
|
||||
return context->surface();
|
||||
},
|
||||
[&](GC::Ref<WebGL::WebGLRenderingContext> const&) -> RefPtr<Gfx::PaintingSurface> {
|
||||
TODO();
|
||||
[&](GC::Ref<WebGL::WebGLRenderingContext> const& context) -> RefPtr<Gfx::PaintingSurface> {
|
||||
return context->surface();
|
||||
},
|
||||
[](Empty) -> RefPtr<Gfx::PaintingSurface> {
|
||||
return {};
|
||||
|
@ -405,8 +405,8 @@ void HTMLCanvasElement::allocate_painting_surface_if_needed()
|
|||
[&](GC::Ref<CanvasRenderingContext2D>& context) {
|
||||
context->allocate_painting_surface_if_needed();
|
||||
},
|
||||
[&](GC::Ref<WebGL::WebGLRenderingContext>&) {
|
||||
TODO();
|
||||
[&](GC::Ref<WebGL::WebGLRenderingContext>& context) {
|
||||
context->allocate_painting_surface_if_needed();
|
||||
},
|
||||
[](Empty) {
|
||||
// Do nothing.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue