Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Webrender #21725

Merged
merged 4 commits into from Oct 12, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Update webrender to 923ee495bd9b0fda8a4a94c5a6cf42e2f0548731.

  • Loading branch information
jdm committed Oct 9, 2018
commit 171469c27c95f7a3a41663da58320494ea63dba8

Large diffs are not rendered by default.

@@ -48,8 +48,8 @@ ucd = "0.1.1"
[target.'cfg(target_os = "macos")'.dependencies]
byteorder = "1.0"
core-foundation = "0.6"
core-graphics = "0.16"
core-text = "11.0"
core-graphics = "0.17"
core-text = "13.0"

[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
freetype = "0.4"
@@ -62,5 +62,5 @@ servo-fontconfig = "0.2.1"
xml5ever = {version = "0.12"}

[target.'cfg(target_os = "windows")'.dependencies]
dwrote = "0.4"
dwrote = "0.5"
truetype = "0.26"
@@ -235,9 +235,11 @@ impl FontHandleMethods for FontHandle {
let mut glyphs: [CGGlyph; 1] = [0 as CGGlyph];
let count: CFIndex = 1;

let result = self
.ctfont
.get_glyphs_for_characters(&characters[0], &mut glyphs[0], count);
let result = unsafe {
self
.ctfont
.get_glyphs_for_characters(&characters[0], &mut glyphs[0], count)
};

if !result {
// No glyph for this character
@@ -263,12 +265,14 @@ impl FontHandleMethods for FontHandle {

fn glyph_h_advance(&self, glyph: GlyphId) -> Option<FractionalPixel> {
let glyphs = [glyph as CGGlyph];
let advance = self.ctfont.get_advances_for_glyphs(
kCTFontDefaultOrientation,
&glyphs[0],
ptr::null_mut(),
1,
);
let advance = unsafe {
self.ctfont.get_advances_for_glyphs(
kCTFontDefaultOrientation,
&glyphs[0],
ptr::null_mut(),
1,
)
};
Some(advance as FractionalPixel)
}

@@ -24,9 +24,10 @@ where

let family_collection = core_text::font_collection::create_for_family(family_name);
if let Some(family_collection) = family_collection {
let family_descriptors = family_collection.get_descriptors();
for family_descriptor in family_descriptors.iter() {
callback(family_descriptor.font_name());
if let Some(family_descriptors) = family_collection.get_descriptors() {
for family_descriptor in family_descriptors.iter() {
callback(family_descriptor.font_name());
}
}
}
}
@@ -36,8 +36,8 @@ use style::values::generics::image::EndingShape as GenericEndingShape;
use style::values::generics::image::GradientItem as GenericGradientItem;
use style::values::specified::background::BackgroundRepeatKeyword;
use style::values::specified::position::{X, Y};
use webrender_api::{BorderRadius, BorderSide, BorderStyle, BorderWidths, ColorF};
use webrender_api::{ExtendMode, Gradient, GradientStop, LayoutSize};
use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF};
use webrender_api::{ExtendMode, Gradient, GradientStop, LayoutSize, LayoutSideOffsets};
use webrender_api::{NormalBorder, RadialGradient};

/// A helper data structure for gradients.
@@ -771,6 +771,7 @@ pub fn simple_normal_border(color: ColorF, style: BorderStyle) -> NormalBorder {
top: side,
bottom: side,
radius: BorderRadius::zero(),
do_aa: true,
}
}

@@ -834,13 +835,13 @@ fn calculate_border_image_width_side(

pub fn calculate_border_image_width(
width: &BorderImageWidth,
border: BorderWidths,
border: LayoutSideOffsets,
border_area: Size2D<Au>,
) -> BorderWidths {
BorderWidths {
left: calculate_border_image_width_side(width.3, border.left, border_area.width),
top: calculate_border_image_width_side(width.0, border.top, border_area.height),
right: calculate_border_image_width_side(width.1, border.right, border_area.width),
bottom: calculate_border_image_width_side(width.2, border.bottom, border_area.height),
}
) -> LayoutSideOffsets {
LayoutSideOffsets::new(
calculate_border_image_width_side(width.0, border.top, border_area.height),
calculate_border_image_width_side(width.1, border.right, border_area.width),
calculate_border_image_width_side(width.2, border.bottom, border_area.height),
calculate_border_image_width_side(width.3, border.left, border_area.width),
)
}
@@ -1367,6 +1367,7 @@ impl FragmentDisplayListBuilding for Fragment {
style: border_style.bottom.to_layout(),
},
radius: border_radius,
do_aa: true,
});
state.add_display_item(DisplayItem::Border(CommonDisplayItem::with_data(
base,
@@ -129,14 +129,14 @@ impl ToLayout for Rect<Au> {
}

impl ToLayout for SideOffsets2D<Au> {
type Type = wr::BorderWidths;
type Type = wr::LayoutSideOffsets;
fn to_layout(&self) -> Self::Type {
wr::BorderWidths {
left: self.left.to_f32_px(),
top: self.top.to_f32_px(),
right: self.right.to_f32_px(),
bottom: self.bottom.to_f32_px(),
}
wr::LayoutSideOffsets::new(
self.top.to_f32_px(),
self.right.to_f32_px(),
self.bottom.to_f32_px(),
self.left.to_f32_px(),
)
}
}

@@ -10,7 +10,7 @@
use display_list::items::{ClipScrollNode, ClipScrollNodeIndex, ClipScrollNodeType};
use display_list::items::{DisplayItem, DisplayList, StackingContextType};
use msg::constellation_msg::PipelineId;
use webrender_api::{self, ClipAndScrollInfo, ClipId, DisplayListBuilder, GlyphRasterSpace};
use webrender_api::{self, ClipAndScrollInfo, ClipId, DisplayListBuilder, RasterSpace};
use webrender_api::LayoutPoint;

pub trait WebRenderDisplayListConverter {
@@ -253,7 +253,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
stacking_context.transform_style,
stacking_context.mix_blend_mode,
stacking_context.filters.clone(),
GlyphRasterSpace::Screen,
RasterSpace::Screen,
);

if stacking_context.established_reference_frame.is_some() {
@@ -915,8 +915,6 @@ malloc_size_of_is_0!(webrender_api::BorderRadius);
#[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(webrender_api::BorderStyle);
#[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(webrender_api::BorderWidths);
#[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(webrender_api::BoxShadowClipMode);
#[cfg(feature = "webrender_api")]
malloc_size_of_is_0!(webrender_api::ClipAndScrollInfo);
@@ -103,7 +103,7 @@ use std::borrow::Cow;
use std::cmp::max;
use std::path::PathBuf;
use std::rc::Rc;
use webrender::RendererKind;
use webrender::{RendererKind, ShaderPrecacheFlags};
use webvr::{WebVRThread, WebVRCompositorHandler};

pub use gleam::gl;
@@ -190,12 +190,16 @@ where
enable_aa: opts.enable_text_antialiasing,
debug_flags: debug_flags,
recorder: recorder,
precache_shaders: opts.precache_shaders,
enable_scrollbars: opts.output_file.is_none(),
precache_flags: if opts.precache_shaders {
ShaderPrecacheFlags::FULL_COMPILE
} else {
ShaderPrecacheFlags::empty()
},
renderer_kind: renderer_kind,
enable_subpixel_aa: opts.enable_subpixel_text_antialiasing,
..Default::default()
},
None,
).expect("Unable to initialize webrender!")
};

@@ -33,6 +33,7 @@ rand = [
# Ignored packages with duplicated versions
packages = [
"bitflags",
"core-graphics",
"crossbeam-epoch",
"crossbeam-utils",
"log",

This file was deleted.

This file was deleted.

This file was deleted.

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.