diff options
author | Luke Wilde <lukew@serenityos.org> | 2022-06-04 04:38:22 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-06-13 21:45:27 +0100 |
commit | 528c7bea030dfb6fc94b0f301e6983bc6e268db3 (patch) | |
tree | cd383f747a70fd22f789b9c89ef2ebf767de891a /Userland | |
parent | 39a212b54fcbc8cb2b051fcbef497b1fa020b718 (diff) | |
download | serenity-528c7bea030dfb6fc94b0f301e6983bc6e268db3.zip |
LibWeb/WebGL: Add WebGLRenderingContextBase.isContextLost()
Diffstat (limited to 'Userland')
3 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp index e0594ace41..35144898f1 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp @@ -71,6 +71,12 @@ void WebGLRenderingContextBase::needs_to_present() m_canvas_element->layout_node()->set_needs_display(); } +bool WebGLRenderingContextBase::is_context_lost() const +{ + dbgln_if(WEBGL_CONTEXT_DEBUG, "WebGLRenderingContextBase::is_context_lost()"); + return m_context_lost; +} + Optional<Vector<String>> WebGLRenderingContextBase::get_supported_extensions() const { if (m_context_lost) diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.h b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.h index 9ad28aacbc..ed3adfa01e 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.h +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.h @@ -23,6 +23,8 @@ public: void present(); + bool is_context_lost() const; + Optional<Vector<String>> get_supported_extensions() const; JS::Object* get_extension(String const& name) const; diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl index 49069332d1..a850aa4af6 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl @@ -18,6 +18,8 @@ interface mixin WebGLRenderingContextBase { // IDL code generator. This also allows us to handle the return type ourselves instead of adding the complexity of the // code generator working out the return type and returning the appropriate value to return on context loss. + boolean isContextLost(); + sequence<DOMString>? getSupportedExtensions(); object? getExtension(DOMString name); |