LibWeb/WebGL: Implement getContextAttributes()

This commit is contained in:
Aliaksandr Kalenik 2024-12-05 02:59:00 +01:00 committed by Andreas Kling
commit c817eb8d2b
Notes: github-actions[bot] 2024-12-05 08:57:56 +00:00
8 changed files with 22 additions and 18 deletions

View file

@ -7,15 +7,10 @@
#pragma once
#include <LibJS/Forward.h>
#include <LibWeb/Bindings/WebGLRenderingContextPrototype.h>
namespace Web::WebGL {
enum class WebGLPowerPreference {
Default,
LowPower,
HighPerformance,
};
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#WEBGLCONTEXTATTRIBUTES
struct WebGLContextAttributes {
bool alpha { true };
@ -24,7 +19,7 @@ struct WebGLContextAttributes {
bool antialias { true };
bool premultiplied_alpha { true };
bool preserve_drawing_buffer { false };
WebGLPowerPreference power_preference { WebGLPowerPreference::Default };
Bindings::WebGLPowerPreference power_preference { Bindings::WebGLPowerPreference::Default };
bool fail_if_major_performance_caveat { false };
bool desynchronized { false };
};