diff options
-rw-r--r-- | Cargo.lock | 8 | ||||
-rw-r--r-- | components/canvas/Cargo.toml | 2 | ||||
-rw-r--r-- | components/canvas/webgl_thread.rs | 34 | ||||
-rw-r--r-- | components/webrender_surfman/Cargo.toml | 2 | ||||
-rw-r--r-- | components/webrender_surfman/lib.rs | 2 | ||||
-rw-r--r-- | ports/gstplugin/Cargo.toml | 2 |
6 files changed, 29 insertions, 21 deletions
diff --git a/Cargo.lock b/Cargo.lock index 286fb644bfa..e4e4672dfe6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5878,9 +5878,9 @@ dependencies = [ [[package]] name = "surfman-chains" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51598e1772bda3dbb1b81a9dc4b46725896948ea58d0f128e5b492a92f297af" +checksum = "d7370be9fb29386426ce52d9c3ac0501e7f71ea8218baf4bee061465f2fcec04" dependencies = [ "euclid", "fnv", @@ -6910,7 +6910,7 @@ dependencies = [ [[package]] name = "webxr" version = "0.0.1" -source = "git+https://github.com/servo/webxr#da44de55ca8c082a033787946cb59dbbd2903a15" +source = "git+https://github.com/servo/webxr#7763f4826fb04a1b48dbf502e48ca9d6ff3b6378" dependencies = [ "android_injected_glue", "bindgen", @@ -6933,7 +6933,7 @@ dependencies = [ [[package]] name = "webxr-api" version = "0.0.1" -source = "git+https://github.com/servo/webxr#da44de55ca8c082a033787946cb59dbbd2903a15" +source = "git+https://github.com/servo/webxr#7763f4826fb04a1b48dbf502e48ca9d6ff3b6378" dependencies = [ "euclid", "ipc-channel", diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml index 2281ea30242..7e3267148e6 100644 --- a/components/canvas/Cargo.toml +++ b/components/canvas/Cargo.toml @@ -40,7 +40,7 @@ style = { path = "../style" } style_traits = { path = "../style_traits" } # NOTE: the sm-angle feature only enables angle on windows, not other platforms! surfman = { version = "0.3", features = ["sm-angle","sm-angle-default"] } -surfman-chains = "0.4" +surfman-chains = "0.5" surfman-chains-api = "0.2" time = { version = "0.1.0", optional = true } webrender = { git = "https://github.com/servo/webrender" } diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs index 3c27c523866..168a7e9f070 100644 --- a/components/canvas/webgl_thread.rs +++ b/components/canvas/webgl_thread.rs @@ -827,22 +827,30 @@ impl WebGLThread { debug!("Swapping {:?}", context_id); swap_chain - .swap_buffers(&mut self.device, &mut data.ctx) + .swap_buffers( + &mut self.device, + &mut data.ctx, + if data.attributes.preserve_drawing_buffer { + surfman_chains::PreserveBuffer::Yes(&*data.gl) + } else { + surfman_chains::PreserveBuffer::No + }, + ) .unwrap(); debug_assert_eq!(data.gl.get_error(), gl::NO_ERROR); - // TODO: if preserveDrawingBuffer is true, then blit the front buffer to the back buffer - // https://github.com/servo/servo/issues/24604 - debug!("Clearing {:?}", context_id); - let alpha = data - .state - .requested_flags - .contains(ContextAttributeFlags::ALPHA); - let clear_color = [0.0, 0.0, 0.0, !alpha as i32 as f32]; - swap_chain - .clear_surface(&mut self.device, &mut data.ctx, &*data.gl, clear_color) - .unwrap(); - debug_assert_eq!(data.gl.get_error(), gl::NO_ERROR); + if !data.attributes.preserve_drawing_buffer { + debug!("Clearing {:?}", context_id); + let alpha = data + .state + .requested_flags + .contains(ContextAttributeFlags::ALPHA); + let clear_color = [0.0, 0.0, 0.0, !alpha as i32 as f32]; + swap_chain + .clear_surface(&mut self.device, &mut data.ctx, &*data.gl, clear_color) + .unwrap(); + debug_assert_eq!(data.gl.get_error(), gl::NO_ERROR); + } // Rebind framebuffers as appropriate. debug!("Rebinding {:?}", context_id); diff --git a/components/webrender_surfman/Cargo.toml b/components/webrender_surfman/Cargo.toml index 82ae827cbb7..663b30be7b1 100644 --- a/components/webrender_surfman/Cargo.toml +++ b/components/webrender_surfman/Cargo.toml @@ -13,5 +13,5 @@ path = "lib.rs" [dependencies] euclid = "0.20" surfman = "0.3" -surfman-chains = "0.4" +surfman-chains = "0.5" diff --git a/components/webrender_surfman/lib.rs b/components/webrender_surfman/lib.rs index 530ca0ebfc7..533614256c1 100644 --- a/components/webrender_surfman/lib.rs +++ b/components/webrender_surfman/lib.rs @@ -147,7 +147,7 @@ impl WebrenderSurfman { let ref mut device = self.0.device.borrow_mut(); let ref mut context = self.0.context.borrow_mut(); if let Some(ref swap_chain) = self.0.swap_chain { - return swap_chain.swap_buffers(device, context); + return swap_chain.swap_buffers(device, context, surfman_chains::PreserveBuffer::No); } let mut surface = device.unbind_surface_from_context(context)?.unwrap(); device.present_surface(context, &mut surface)?; diff --git a/ports/gstplugin/Cargo.toml b/ports/gstplugin/Cargo.toml index 05816b4e629..4ad10399c0d 100644 --- a/ports/gstplugin/Cargo.toml +++ b/ports/gstplugin/Cargo.toml @@ -30,7 +30,7 @@ log = "0.4" servo-media = { git = "https://github.com/servo/media" } sparkle = "0.1" surfman = "0.3" -surfman-chains = "0.4" +surfman-chains = "0.5" surfman-chains-api = "0.2" webxr = { git = "https://github.com/servo/webxr", features = ["glwindow"] } |