summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/WebGL
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/WebGL')
-rw-r--r--Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp6
-rw-r--r--Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.h2
-rw-r--r--Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl2
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);