mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb/WebGL: Don't crash on unknown getParameter on the context
And allow the implementation to set the error code.
This commit is contained in:
parent
af536e1192
commit
56d45282ea
Notes:
github-actions[bot]
2024-12-06 14:36:34 +00:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/56d45282eaa Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2809 Reviewed-by: https://github.com/kalenikaliaksandr ✅
3 changed files with 6 additions and 3 deletions
|
@ -73,7 +73,7 @@ private:
|
|||
|
||||
GLenum m_error { 0 };
|
||||
|
||||
void set_error(GLenum error);
|
||||
virtual void set_error(GLenum error) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ private:
|
|||
|
||||
GLenum m_error { 0 };
|
||||
|
||||
void set_error(GLenum error);
|
||||
virtual void set_error(GLenum error) override;
|
||||
};
|
||||
|
||||
void fire_webgl_context_event(HTML::HTMLCanvasElement& canvas_element, FlyString const& type);
|
||||
|
|
|
@ -231,7 +231,9 @@ static void generate_get_parameter(SourceGenerator& generator)
|
|||
|
||||
generator.appendln(R"~~~(
|
||||
default:
|
||||
TODO();
|
||||
dbgln("Unknown WebGL parameter name: {:x}", pname);
|
||||
set_error(GL_INVALID_ENUM);
|
||||
return JS::js_null();
|
||||
})~~~");
|
||||
}
|
||||
|
||||
|
@ -389,6 +391,7 @@ public:
|
|||
|
||||
virtual void present() = 0;
|
||||
virtual void needs_to_present() = 0;
|
||||
virtual void set_error(GLenum) = 0;
|
||||
)~~~");
|
||||
|
||||
for (auto const& function : interface.functions) {
|
||||
|
|
Loading…
Add table
Reference in a new issue