diff options
-rw-r--r-- | Cargo.lock | 33 | ||||
-rw-r--r-- | components/canvas/canvas_paint_thread.rs | 30 | ||||
-rw-r--r-- | components/canvas/webgl_paint_thread.rs | 32 | ||||
-rw-r--r-- | components/compositing/compositor.rs | 5 | ||||
-rw-r--r-- | components/gfx/Cargo.toml | 2 | ||||
-rw-r--r-- | components/gfx/font_cache_thread.rs | 8 | ||||
-rw-r--r-- | components/layout_thread/lib.rs | 3 | ||||
-rw-r--r-- | components/net/image_cache.rs | 4 | ||||
-rw-r--r-- | components/servo/lib.rs | 5 |
9 files changed, 74 insertions, 48 deletions
diff --git a/Cargo.lock b/Cargo.lock index ad7f60bedfd..4488a248398 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -108,15 +108,15 @@ dependencies = [ [[package]] name = "azure" -version = "0.20.0" -source = "git+https://github.com/servo/rust-azure#71de5aa53e7c6faf10ceadce6538856649099263" +version = "0.20.1" +source = "git+https://github.com/servo/rust-azure#ca851788b3bc1f1034d4d899da66faf78e420c5e" dependencies = [ "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "core-text 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -323,7 +323,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "canvas" version = "0.0.1" dependencies = [ - "azure 0.20.0 (git+https://github.com/servo/rust-azure)", + "azure 0.20.1 (git+https://github.com/servo/rust-azure)", "canvas_traits 0.0.1", "cssparser 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -960,7 +960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "freetype" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1058,9 +1058,9 @@ dependencies = [ "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "fontsan 0.3.2 (git+https://github.com/servo/fontsan)", - "freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "harfbuzz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "harfbuzz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1188,11 +1188,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "harfbuzz-sys" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.23 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3335,7 +3335,7 @@ name = "unicode-script" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "harfbuzz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "harfbuzz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3478,7 +3478,7 @@ dependencies = [ [[package]] name = "webrender" version = "0.48.0" -source = "git+https://github.com/servo/webrender#6dd3ddb0453697d3271f52133d88c182aa2f3b08" +source = "git+https://github.com/servo/webrender#b13a3b8f776b2ef4d5672173c9a3aa77c7b87936" dependencies = [ "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3489,7 +3489,7 @@ dependencies = [ "core-text 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "gamma-lut 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3507,7 +3507,7 @@ dependencies = [ [[package]] name = "webrender_api" version = "0.48.0" -source = "git+https://github.com/servo/webrender#6dd3ddb0453697d3271f52133d88c182aa2f3b08" +source = "git+https://github.com/servo/webrender#b13a3b8f776b2ef4d5672173c9a3aa77c7b87936" dependencies = [ "app_units 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3516,6 +3516,7 @@ dependencies = [ "core-graphics 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "dwrote 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3652,7 +3653,7 @@ dependencies = [ "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21" "checksum audio-video-metadata 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3b6ef29ee98ad95a37f34547fd7fb40724772294110ed6ca0445fc2e964c29d1" -"checksum azure 0.20.0 (git+https://github.com/servo/rust-azure)" = "<none>" +"checksum azure 0.20.1 (git+https://github.com/servo/rust-azure)" = "<none>" "checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" "checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" "checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" @@ -3728,7 +3729,7 @@ dependencies = [ "checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" "checksum fontsan 0.3.2 (git+https://github.com/servo/fontsan)" = "<none>" "checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" -"checksum freetype 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fde23272c687e4570aefec06cb71174ec0f5284b725deac4e77ba2665d635faf" +"checksum freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "398b8a11884898184d55aca9806f002b3cf68f0e860e0cbb4586f834ee39b0e7" "checksum futf 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "51f93f3de6ba1794dcd5810b3546d004600a59a98266487c8407bc4b24e398f3" "checksum futures 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "55f0008e13fc853f79ea8fc86e931486860d4c4c156cdffb59fa5f7fa833660a" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" @@ -3743,7 +3744,7 @@ dependencies = [ "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum glx 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b280007fa9c7442cfd1e0b1addb8d1a59240267110e8705f8f7e2c7bfb7e2f72" "checksum half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63d68db75012a85555434ee079e7e6337931f87a087ab2988becbadf64673a7f" -"checksum harfbuzz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "3072efe30deebdda55fcbe7c74c6d42f546fd8533488e43a692ea940ecface11" +"checksum harfbuzz-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "61e6e99c20fe855e4d3836d037e252a1b7755ef99d00126071c68604b87bd29a" "checksum heapsize 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4c7593b1522161003928c959c20a2ca421c68e940d63d75573316a009e48a6d4" "checksum heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "46f96d52fb1564059fc97b85ef6165728cc30198ab60073bf114c66c4c89bb5d" "checksum heartbeats-simple 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ad003ce233955e9d95f2c69cde84e68302ba9ba4a673d351c9bff93c738aadc" diff --git a/components/canvas/canvas_paint_thread.rs b/components/canvas/canvas_paint_thread.rs index b3433e62b50..b7e21777001 100644 --- a/components/canvas/canvas_paint_thread.rs +++ b/components/canvas/canvas_paint_thread.rs @@ -585,28 +585,32 @@ impl<'a> CanvasPaintThread<'a> { }; let data = webrender_api::ImageData::Raw(Arc::new(element.into())); + let mut updates = webrender_api::ResourceUpdates::new(); + match self.image_key { Some(image_key) => { debug!("Updating image {:?}.", image_key); - self.webrender_api.update_image(image_key, - descriptor, - data, - None); + updates.update_image(image_key, + descriptor, + data, + None); } None => { self.image_key = Some(self.webrender_api.generate_image_key()); debug!("New image {:?}.", self.image_key); - self.webrender_api.add_image(self.image_key.unwrap(), - descriptor, - data, - None); + updates.add_image(self.image_key.unwrap(), + descriptor, + data, + None); } } if let Some(image_key) = mem::replace(&mut self.very_old_image_key, self.old_image_key.take()) { - self.webrender_api.delete_image(image_key); + updates.delete_image(image_key); } + self.webrender_api.update_resources(updates); + let data = CanvasImageData { image_key: self.image_key.unwrap(), }; @@ -764,12 +768,16 @@ impl<'a> CanvasPaintThread<'a> { impl<'a> Drop for CanvasPaintThread<'a> { fn drop(&mut self) { + let mut updates = webrender_api::ResourceUpdates::new(); + if let Some(image_key) = self.old_image_key.take() { - self.webrender_api.delete_image(image_key); + updates.delete_image(image_key); } if let Some(image_key) = self.very_old_image_key.take() { - self.webrender_api.delete_image(image_key); + updates.delete_image(image_key); } + + self.webrender_api.update_resources(updates); } } diff --git a/components/canvas/webgl_paint_thread.rs b/components/canvas/webgl_paint_thread.rs index abd6e4d00a0..2b6819effba 100644 --- a/components/canvas/webgl_paint_thread.rs +++ b/components/canvas/webgl_paint_thread.rs @@ -281,26 +281,30 @@ impl WebGLPaintThread { }; let data = webrender_api::ImageData::Raw(Arc::new(pixels)); + let mut updates = webrender_api::ResourceUpdates::new(); + match *image_key { Some(image_key) => { - webrender_api.update_image(image_key, - descriptor, - data, - None); + updates.update_image(image_key, + descriptor, + data, + None); } None => { *image_key = Some(webrender_api.generate_image_key()); - webrender_api.add_image(image_key.unwrap(), - descriptor, - data, - None); + updates.add_image(image_key.unwrap(), + descriptor, + data, + None); } } if let Some(image_key) = mem::replace(very_old_image_key, old_image_key.take()) { - webrender_api.delete_image(image_key); + updates.delete_image(image_key); } + webrender_api.update_resources(updates); + let image_data = CanvasImageData { image_key: image_key.unwrap(), }; @@ -357,15 +361,19 @@ impl Drop for WebGLPaintThread { very_old_image_key, .. } = self.data { + let mut updates = webrender_api::ResourceUpdates::new(); + if let Some(image_key) = image_key { - webrender_api.delete_image(image_key); + updates.delete_image(image_key); } if let Some(image_key) = old_image_key { - webrender_api.delete_image(image_key); + updates.delete_image(image_key); } if let Some(image_key) = very_old_image_key { - webrender_api.delete_image(image_key); + updates.delete_image(image_key); } + + webrender_api.update_resources(updates); } } } diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 4dd167fa925..35ea1e2c508 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -819,8 +819,9 @@ impl<Window: WindowMethods> IOCompositor<Window> { } WindowEvent::ToggleWebRenderProfiler => { - let profiler_enabled = self.webrender.get_profiler_enabled(); - self.webrender.set_profiler_enabled(!profiler_enabled); + let mut flags = self.webrender.get_debug_flags(); + flags.toggle(webrender::renderer::PROFILER_DBG); + self.webrender.set_debug_flags(flags); self.webrender_api.generate_frame(self.webrender_document, None); } } diff --git a/components/gfx/Cargo.toml b/components/gfx/Cargo.toml index 57f74e4591b..5be6b7e1e96 100644 --- a/components/gfx/Cargo.toml +++ b/components/gfx/Cargo.toml @@ -49,7 +49,7 @@ core-graphics = "0.8" core-text = "6.0" [target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies] -freetype = "0.2" +freetype = "0.3" [target.'cfg(target_os = "linux")'.dependencies] servo-fontconfig = "0.2.1" diff --git a/components/gfx/font_cache_thread.rs b/components/gfx/font_cache_thread.rs index 9b76a22fa9c..447bff83021 100644 --- a/components/gfx/font_cache_thread.rs +++ b/components/gfx/font_cache_thread.rs @@ -348,11 +348,13 @@ impl FontCache { let webrender_fonts = &mut self.webrender_fonts; font_key = Some(*webrender_fonts.entry(template.identifier.clone()).or_insert_with(|| { let font_key = webrender_api.generate_font_key(); + let mut updates = webrender_api::ResourceUpdates::new(); match (template.bytes_if_in_memory(), template.native_font()) { - (Some(bytes), _) => webrender_api.add_raw_font(font_key, bytes, 0), - (None, Some(native_font)) => webrender_api.add_native_font(font_key, native_font), - (None, None) => webrender_api.add_raw_font(font_key, template.bytes().clone(), 0), + (Some(bytes), _) => updates.add_raw_font(font_key, bytes, 0), + (None, Some(native_font)) => updates.add_native_font(font_key, native_font), + (None, None) => updates.add_raw_font(font_key, template.bytes().clone(), 0), } + webrender_api.update_resources(updates); font_key })); } diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs index ecfa17ff1d2..e15fa4e98b4 100644 --- a/components/layout_thread/lib.rs +++ b/components/layout_thread/lib.rs @@ -1067,7 +1067,8 @@ impl LayoutThread { Some(get_root_flow_background_color(layout_root)), viewport_size, builder.finalize(), - true); + true, + webrender_api::ResourceUpdates::new()); self.webrender_api.generate_frame(self.webrender_document, None); }); } diff --git a/components/net/image_cache.rs b/components/net/image_cache.rs index 4cb5e09e2f3..920330008d1 100644 --- a/components/net/image_cache.rs +++ b/components/net/image_cache.rs @@ -79,7 +79,9 @@ fn set_webrender_image_key(webrender_api: &webrender_api::RenderApi, image: &mut }; let data = webrender_api::ImageData::new(bytes); let image_key = webrender_api.generate_image_key(); - webrender_api.add_image(image_key, descriptor, data, None); + let mut updates = webrender_api::ResourceUpdates::new(); + updates.add_image(image_key, descriptor, data, None); + webrender_api.update_resources(updates); image.id = Some(image_key); } diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 896887e2e34..7f968183d9b 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -174,11 +174,14 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { None }; + let mut debug_flags = webrender::renderer::DebugFlags::empty(); + debug_flags.set(webrender::renderer::PROFILER_DBG, opts.webrender_stats); + webrender::Renderer::new(window.gl(), webrender::RendererOptions { device_pixel_ratio: device_pixel_ratio, resource_override_path: Some(resource_path), enable_aa: opts.enable_text_antialiasing, - enable_profiler: opts.webrender_stats, + debug_flags: debug_flags, enable_batcher: opts.webrender_batch, debug: opts.webrender_debug, recorder: recorder, |