2021-10-27 23:18:09 +03:00
|
|
|
// Wrapper around 2d context and WebGL APIs
|
|
|
|
|
2021-11-03 17:54:28 +03:00
|
|
|
module jsdom
|
2021-10-27 23:18:09 +03:00
|
|
|
|
|
|
|
pub struct ContextAttributes {
|
|
|
|
pub:
|
|
|
|
alpha bool
|
|
|
|
desynchronized bool
|
|
|
|
}
|
|
|
|
|
|
|
|
pub enum PowerPreference {
|
|
|
|
default_
|
|
|
|
high_performance
|
|
|
|
low_performance
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct WebGLAttributes {
|
|
|
|
pub:
|
|
|
|
alpha bool
|
|
|
|
desynchronized bool
|
|
|
|
antialias bool
|
|
|
|
depth bool
|
|
|
|
fail_if_major_perf_caveat bool
|
|
|
|
power_preference PowerPreference
|
|
|
|
premultiplied_alpha bool
|
|
|
|
preserve_drawing_buffer bool
|
|
|
|
stencil bool
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct NoneContext {}
|
|
|
|
|
|
|
|
pub type ContextResult = CanvasRenderingContext2D | NoneContext | WebGLRenderingContext
|
2021-11-03 17:54:28 +03:00
|
|
|
|
|
|
|
pub struct JS.CanvasGradient {}
|