Skip to content

Commit

Permalink
Auto merge of #21182 - gw3583:update-wr-more, r=<try>
Browse files Browse the repository at this point in the history
Update WR for gradient API changes, and various dependencies.
  • Loading branch information
bors-servo committed Jul 16, 2018
2 parents 8eb2a53 + 1881a06 commit 87c3b71
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 164 deletions.
160 changes: 36 additions & 124 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/canvas/Cargo.toml
Expand Up @@ -20,7 +20,7 @@ gleam = "0.5"
ipc-channel = "0.10"
log = "0.4"
num-traits = "0.1.32"
offscreen_gl_context = {version = "0.17", features = ["serde", "osmesa"]}
offscreen_gl_context = {version = "0.18", features = ["serde", "osmesa"]}
serde_bytes = "0.10"
servo_config = {path = "../config"}
webrender = {git = "https://github.com/servo/webrender"}
Expand Down
2 changes: 1 addition & 1 deletion components/canvas_traits/Cargo.toml
Expand Up @@ -17,7 +17,7 @@ gleam = "0.5.1"
lazy_static = "1"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
offscreen_gl_context = {version = "0.17", features = ["serde"]}
offscreen_gl_context = {version = "0.18", features = ["serde"]}
serde = "1.0"
serde_bytes = "0.10"
servo_config = {path = "../config"}
Expand Down
2 changes: 1 addition & 1 deletion components/compositing/Cargo.toml
Expand Up @@ -18,7 +18,7 @@ embedder_traits = {path = "../embedder_traits"}
euclid = "0.17"
gfx_traits = {path = "../gfx_traits"}
gleam = {version = "0.5", optional = true}
image = "0.18"
image = "0.19"
ipc-channel = "0.10"
libc = "0.2"
log = "0.4"
Expand Down
3 changes: 2 additions & 1 deletion components/compositing/compositor.rs
Expand Up @@ -281,6 +281,7 @@ impl webrender_api::RenderNotifier for RenderNotifier {
_document_id: webrender_api::DocumentId,
scrolled: bool,
composite_needed: bool,
_render_time_ns: Option<u64>,
) {
if scrolled {
self.compositor_proxy.send(Msg::NewScrollFrameReady(composite_needed));
Expand Down Expand Up @@ -1268,7 +1269,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
Ok(mut file) => {
let img = gl::draw_img(gl, rt_info, width, height);
let dynamic_image = DynamicImage::ImageRgb8(img);
if let Err(e) = dynamic_image.save(&mut file, ImageFormat::PNG) {
if let Err(e) = dynamic_image.write_to(&mut file, ImageFormat::PNG) {
error!("Failed to save {} ({}).", path, e);
}
},
Expand Down
6 changes: 3 additions & 3 deletions components/gfx/Cargo.toml
Expand Up @@ -46,9 +46,9 @@ ucd = "0.1.1"

[target.'cfg(target_os = "macos")'.dependencies]
byteorder = "1.0"
core-foundation = "0.5"
core-graphics = "0.13"
core-text = "9.0"
core-foundation = "0.6"
core-graphics = "0.14"
core-text = "10.0"

[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
freetype = "0.4"
Expand Down
61 changes: 41 additions & 20 deletions components/layout/display_list/webrender_helpers.rs
Expand Up @@ -9,6 +9,7 @@

use display_list::items::{BorderDetails, ClipScrollNode, ClipScrollNodeIndex, ClipScrollNodeType};
use display_list::items::{DisplayItem, DisplayList, StackingContextType};
use euclid::SideOffsets2D;
use msg::constellation_msg::PipelineId;
use webrender_api::{self, ClipAndScrollInfo, ClipId, DisplayListBuilder, GlyphRasterSpace};
use webrender_api::LayoutPoint;
Expand Down Expand Up @@ -132,30 +133,50 @@ impl WebRenderDisplayItemConverter for DisplayItem {
BorderDetails::Normal(ref border) => {
webrender_api::BorderDetails::Normal(*border)
},
BorderDetails::Image(ref image) => webrender_api::BorderDetails::NinePatch(*image),
BorderDetails::Image(ref image) => {
webrender_api::BorderDetails::NinePatch(*image)
}
BorderDetails::Gradient(ref gradient) => {
webrender_api::BorderDetails::Gradient(webrender_api::GradientBorder {
gradient: builder.create_gradient(
gradient.gradient.start_point,
gradient.gradient.end_point,
gradient.gradient.stops.clone(),
gradient.gradient.extend_mode,
),
let wr_gradient = builder.create_gradient(
gradient.gradient.start_point,
gradient.gradient.end_point,
gradient.gradient.stops.clone(),
gradient.gradient.extend_mode,
);

let details = webrender_api::NinePatchBorder {
source: webrender_api::NinePatchBorderSource::Gradient(wr_gradient),
width: 0,
height: 0,
slice: SideOffsets2D::zero(),
fill: false,
repeat_horizontal: webrender_api::RepeatMode::Stretch,
repeat_vertical: webrender_api::RepeatMode::Stretch,
outset: gradient.outset,
})
};

webrender_api::BorderDetails::NinePatch(details)
},
BorderDetails::RadialGradient(ref gradient) => {
webrender_api::BorderDetails::RadialGradient(
webrender_api::RadialGradientBorder {
gradient: builder.create_radial_gradient(
gradient.gradient.center,
gradient.gradient.radius,
gradient.gradient.stops.clone(),
gradient.gradient.extend_mode,
),
outset: gradient.outset,
},
)
let wr_gradient = builder.create_radial_gradient(
gradient.gradient.center,
gradient.gradient.radius,
gradient.gradient.stops.clone(),
gradient.gradient.extend_mode,
);

let details = webrender_api::NinePatchBorder {
source: webrender_api::NinePatchBorderSource::RadialGradient(wr_gradient),
width: 0,
height: 0,
slice: SideOffsets2D::zero(),
fill: false,
repeat_horizontal: webrender_api::RepeatMode::Stretch,
repeat_vertical: webrender_api::RepeatMode::Stretch,
outset: gradient.outset,
};

webrender_api::BorderDetails::NinePatch(details)
},
};

Expand Down
2 changes: 1 addition & 1 deletion components/net_traits/Cargo.toml
Expand Up @@ -16,7 +16,7 @@ cookie = "0.10"
embedder_traits = { path = "../embedder_traits" }
hyper = "0.10"
hyper_serde = "0.8"
image = "0.18"
image = "0.19"
ipc-channel = "0.10"
lazy_static = "1"
log = "0.4"
Expand Down
4 changes: 2 additions & 2 deletions components/script/Cargo.toml
Expand Up @@ -52,7 +52,7 @@ half = "1.0"
html5ever = "0.22"
hyper = "0.10"
hyper_serde = "0.8"
image = "0.18"
image = "0.19"
ipc-channel = "0.10"
itertools = "0.7.6"
jstraceable_derive = {path = "../jstraceable_derive"}
Expand All @@ -69,7 +69,7 @@ mozjs = { version = "0.7.1", features = ["promises"]}
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
num-traits = "0.1.32"
offscreen_gl_context = {version = "0.17", features = ["serde"]}
offscreen_gl_context = {version = "0.18", features = ["serde"]}
parking_lot = "0.5"
phf = "0.7.18"
profile_traits = {path = "../profile_traits"}
Expand Down
2 changes: 1 addition & 1 deletion components/webdriver_server/Cargo.toml
Expand Up @@ -14,7 +14,7 @@ base64 = "0.6"
cookie = "0.10"
euclid = "0.17"
hyper = "0.10"
image = "0.18"
image = "0.19"
ipc-channel = "0.10"
log = "0.4"
msg = {path = "../msg"}
Expand Down
2 changes: 1 addition & 1 deletion components/webdriver_server/lib.rs
Expand Up @@ -836,7 +836,7 @@ impl Handler {
let rgb = RgbImage::from_raw(img.width, img.height, img.bytes.to_vec()).unwrap();

let mut png_data = Vec::new();
DynamicImage::ImageRgb8(rgb).save(&mut png_data, ImageFormat::PNG).unwrap();
DynamicImage::ImageRgb8(rgb).write_to(&mut png_data, ImageFormat::PNG).unwrap();

let encoded = base64::encode(&png_data);
Ok(WebDriverResponse::Generic(ValueResponse::new(encoded.to_json())))
Expand Down
8 changes: 0 additions & 8 deletions servo-tidy.toml
Expand Up @@ -47,14 +47,6 @@ packages = [
"syn",
"quote",
"proc-macro2",

"core-foundation",
"core-foundation-sys",
"core-graphics",
"inflate",
"image",
"gif",
"png",
]
# Files that are ignored for all tidy and lint checks.
files = [
Expand Down

0 comments on commit 87c3b71

Please sign in to comment.