mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
webgl: Move framebuffer initialization logic to WebGL thread.
This commit is contained in:
parent
df8e36aa78
commit
1b08dd5232
6 changed files with 238 additions and 75 deletions
|
@ -23,6 +23,7 @@ pub struct WebGLRenderbuffer {
|
|||
is_deleted: Cell<bool>,
|
||||
size: Cell<Option<(i32, i32)>>,
|
||||
internal_format: Cell<Option<u32>>,
|
||||
is_initialized: Cell<bool>,
|
||||
}
|
||||
|
||||
impl WebGLRenderbuffer {
|
||||
|
@ -34,6 +35,7 @@ impl WebGLRenderbuffer {
|
|||
is_deleted: Cell::new(false),
|
||||
internal_format: Cell::new(None),
|
||||
size: Cell::new(None),
|
||||
is_initialized: Cell::new(false),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,6 +68,14 @@ impl WebGLRenderbuffer {
|
|||
self.internal_format.get().unwrap_or(constants::RGBA4)
|
||||
}
|
||||
|
||||
pub fn mark_initialized(&self) {
|
||||
self.is_initialized.set(true);
|
||||
}
|
||||
|
||||
pub fn is_initialized(&self) -> bool {
|
||||
self.is_initialized.get()
|
||||
}
|
||||
|
||||
pub fn bind(&self, target: u32) {
|
||||
self.ever_bound.set(true);
|
||||
self.upcast::<WebGLObject>()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue