Bug 1525402 - Migrate webrender externs to a Rust 2018 compatible form. r=kvark
authorAlexis Beingessner <a.beingessner@gmail.com>
Tue, 07 May 2019 01:40:19 +0000
changeset 531636 8c7d885ae03623bf540a6d31372b5585e2aabcab
parent 531635 0c2296965b7b07a50a8b8a643de442f03f196b27
child 531637 16d8a19df81393398075c6f4695d9a55b96b55d2
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark
bugs1525402
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1525402 - Migrate webrender externs to a Rust 2018 compatible form. r=kvark Notably `extern crate foo as bar` is no longer supported (must do it in Cargo.toml). Also stopped using euclid through webrender_api, because it produces worse results in 2018. Differential Revision: https://phabricator.services.mozilla.com/D29566
Cargo.lock
gfx/wr/Cargo.lock
gfx/wr/webrender/Cargo.toml
gfx/wr/webrender/src/glyph_rasterizer/mod.rs
gfx/wr/webrender/src/lib.rs
gfx/wr/webrender_api/Cargo.toml
gfx/wr/webrender_api/src/lib.rs
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3354,16 +3354,17 @@ dependencies = [
  "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
--- a/gfx/wr/Cargo.lock
+++ b/gfx/wr/Cargo.lock
@@ -1638,16 +1638,17 @@ dependencies = [
  "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cstr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "gleam 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
--- a/gfx/wr/webrender/Cargo.toml
+++ b/gfx/wr/webrender/Cargo.toml
@@ -6,54 +6,55 @@ license = "MPL-2.0"
 repository = "https://github.com/servo/webrender"
 description = "A GPU accelerated 2D renderer for web content"
 build = "build.rs"
 
 [features]
 default = ["freetype-lib"]
 freetype-lib = ["freetype/servo-freetype-sys"]
 profiler = ["thread_profiler/thread_profiler"]
-debugger = ["ws", "serde_json", "serde", "image", "base64"]
-capture = ["webrender_api/serialize", "ron", "serde", "smallvec/serde"]
-replay = ["webrender_api/deserialize", "ron", "serde"]
-display_list_stats = ["webrender_api/display_list_stats"]
+debugger = ["ws", "serde_json", "serde", "image_loader", "base64"]
+capture = ["api/serialize", "ron", "serde", "smallvec/serde"]
+replay = ["api/deserialize", "ron", "serde"]
+display_list_stats = ["api/display_list_stats"]
 pathfinder = ["pathfinder_font_renderer", "pathfinder_gfx_utils", "pathfinder_partitioner", "pathfinder_path_utils"]
 serialize_program = ["serde", "webrender_build/serialize_program"]
 no_static_freetype = []
 
 [build-dependencies]
 webrender_build = { version = "0.0.1", path = "../webrender_build" }
 
 [dependencies]
 base64 = { optional = true, version = "0.10" }
 bincode = "1.0"
 bitflags = "1.0"
 byteorder = "1.0"
 cfg-if = "0.1.2"
 cstr = "0.1.2"
+euclid = { version = "0.19.5", features = ["serde"] }
 fxhash = "0.2.1"
 gleam = "0.6.17"
-image = { optional = true, version = "0.21", default-features = false, features = ["png_codec"] }
+image_loader = { optional = true, version = "0.21", package = "image", default-features = false, features = ["png_codec"] }
 lazy_static = "1"
 log = "0.4"
 malloc_size_of_derive = "0.1"
 num-traits = "0.2"
 plane-split = "0.13.7"
 png = { optional = true, version = "0.14" }
 rayon = "1"
 ron = { optional = true, version = "0.1.7" }
 serde = { optional = true, version = "1.0", features = ["serde_derive"] }
 serde_json = { optional = true, version = "1.0" }
 sha2 = "0.8"
 smallvec = "0.6"
 thread_profiler = "0.1.1"
 time = "0.1"
-webrender_api = { version = "0.60.0", path = "../webrender_api" }
+api = { version = "0.60.0", path = "../webrender_api", package = "webrender_api" }
 webrender_build = { version = "0.0.1", path = "../webrender_build" }
-wr_malloc_size_of = { version = "0.0.1", path = "../wr_malloc_size_of" }
+malloc_size_of = { version = "0.0.1", path = "../wr_malloc_size_of", package = "wr_malloc_size_of" }
 ws = { optional = true, version = "0.7.3" }
 svg_fmt = "0.4"
 
 [dependencies.pathfinder_font_renderer]
 git = "https://github.com/pcwalton/pathfinder"
 branch = "webrender"
 optional = true
 # Uncomment to test FreeType on macOS:
--- a/gfx/wr/webrender/src/glyph_rasterizer/mod.rs
+++ b/gfx/wr/webrender/src/glyph_rasterizer/mod.rs
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use api::{FontInstanceFlags, FontInstancePlatformOptions};
 use api::{FontKey, FontInstanceKey, FontRenderMode, FontTemplate, FontVariation};
 use api::{ColorU, GlyphIndex, GlyphDimensions, SyntheticItalics};
 use api::units::*;
 use euclid::approxeq::ApproxEq;
 use internal_types::ResourceCacheError;
-use wr_malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
+use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
 use platform::font::FontContext;
 use rayon::ThreadPool;
 use std::cmp;
 use std::hash::{Hash, Hasher};
 use std::mem;
 use std::ops::Deref;
 use std::sync::{Arc, Condvar, Mutex, MutexGuard};
 use std::sync::mpsc::{channel, Receiver, Sender};
--- a/gfx/wr/webrender/src/lib.rs
+++ b/gfx/wr/webrender/src/lib.rs
@@ -64,19 +64,18 @@ extern crate log;
 #[macro_use]
 extern crate malloc_size_of_derive;
 #[cfg(any(feature = "serde"))]
 #[macro_use]
 extern crate serde;
 #[macro_use]
 extern crate thread_profiler;
 
-extern crate wr_malloc_size_of;
+extern crate malloc_size_of;
 extern crate svg_fmt;
-use wr_malloc_size_of as malloc_size_of;
 
 #[macro_use]
 mod profiler;
 
 mod batch;
 mod border;
 mod box_shadow;
 #[cfg(any(feature = "capture", feature = "replay"))]
@@ -165,16 +164,17 @@ extern crate freetype;
 #[cfg(all(unix, not(target_os = "macos")))]
 extern crate libc;
 
 #[cfg(target_os = "windows")]
 extern crate dwrote;
 
 extern crate bincode;
 extern crate byteorder;
+pub extern crate euclid;
 extern crate fxhash;
 extern crate gleam;
 extern crate num_traits;
 #[cfg(feature = "pathfinder")]
 extern crate pathfinder_font_renderer;
 #[cfg(feature = "pathfinder")]
 extern crate pathfinder_gfx_utils;
 #[cfg(feature = "pathfinder")]
@@ -188,34 +188,33 @@ extern crate ron;
 #[cfg(feature = "debugger")]
 extern crate serde_json;
 extern crate sha2;
 extern crate smallvec;
 extern crate time;
 #[cfg(feature = "debugger")]
 extern crate ws;
 #[cfg(feature = "debugger")]
-extern crate image as image_loader;
+extern crate image_loader;
 #[cfg(feature = "debugger")]
 extern crate base64;
 #[cfg(all(feature = "capture", feature = "png"))]
 extern crate png;
 #[cfg(test)]
 extern crate rand;
 
 #[macro_use]
-pub extern crate webrender_api;
+pub extern crate api;
 extern crate webrender_build;
 
 #[doc(hidden)]
 pub use device::{build_shader_strings, UploadMethod, VertexUsageHint};
 pub use device::{ProgramBinary, ProgramCache, ProgramCacheObserver};
 pub use device::Device;
 pub use frame_builder::ChasePrimitive;
 pub use profiler::{ProfilerHooks, set_profiler_hooks};
 pub use renderer::{AsyncPropertySampler, AsyncScreenshotHandle, CpuProfile, DebugFlags};
 pub use renderer::{OutputImageHandler, RendererKind, ExternalImage, ExternalImageHandler};
 pub use renderer::{ExternalImageSource, GpuProfile, GraphicsApi, GraphicsApiInfo, PipelineInfo};
 pub use renderer::{Renderer, RendererOptions, RenderResults, RendererStats, SceneBuilderHooks};
 pub use renderer::{ThreadListener, ShaderPrecacheFlags, MAX_VERTEX_TEXTURE_WIDTH};
 pub use shade::{Shaders, WrShaders};
-pub use webrender_api as api;
-pub use webrender_api::euclid;
+pub use api as webrender_api;
--- a/gfx/wr/webrender_api/Cargo.toml
+++ b/gfx/wr/webrender_api/Cargo.toml
@@ -21,13 +21,13 @@ byteorder = "1.2.1"
 derive_more = "0.13"
 ipc-channel = {version = "0.11.0", optional = true}
 euclid = { version = "0.19.5", features = ["serde"] }
 malloc_size_of_derive = "0.1"
 serde = { version = "=1.0.88", features = ["rc"] }
 serde_derive = { version = "=1.0.88", features = ["deserialize_in_place"] }
 serde_bytes = "0.10"
 time = "0.1"
-wr_malloc_size_of = { version = "0.0.1", path = "../wr_malloc_size_of" }
+malloc_size_of = { version = "0.0.1", path = "../wr_malloc_size_of", package = "wr_malloc_size_of" }
 
 [target.'cfg(target_os = "macos")'.dependencies]
 core-foundation = "0.6"
 core-graphics = "0.17.1"
--- a/gfx/wr/webrender_api/src/lib.rs
+++ b/gfx/wr/webrender_api/src/lib.rs
@@ -32,18 +32,17 @@ pub extern crate euclid;
 extern crate ipc_channel;
 #[macro_use]
 extern crate malloc_size_of_derive;
 extern crate serde;
 #[macro_use]
 extern crate serde_derive;
 extern crate time;
 
-extern crate wr_malloc_size_of;
-use wr_malloc_size_of as malloc_size_of;
+extern crate malloc_size_of;
 
 mod api;
 pub mod channel;
 mod color;
 mod display_item;
 mod display_list;
 mod font;
 mod gradient_builder;