mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Update webrender.
This commit is contained in:
parent
41367b01bb
commit
8842250033
15 changed files with 83 additions and 69 deletions
|
@ -25,7 +25,7 @@ cssparser = "0.27"
|
|||
embedder_traits = {path = "../embedder_traits"}
|
||||
euclid = "0.20"
|
||||
fnv = "1.0"
|
||||
gleam = "0.9"
|
||||
gleam = "0.11"
|
||||
half = "1"
|
||||
ipc-channel = "0.14"
|
||||
log = "0.4"
|
||||
|
|
|
@ -21,7 +21,7 @@ crossbeam-channel = "0.4"
|
|||
embedder_traits = {path = "../embedder_traits"}
|
||||
euclid = "0.20"
|
||||
gfx_traits = {path = "../gfx_traits"}
|
||||
gleam = {version = "0.9", optional = true}
|
||||
gleam = {version = "0.11", optional = true}
|
||||
image = "0.23"
|
||||
ipc-channel = "0.14"
|
||||
libc = "0.2"
|
||||
|
|
|
@ -43,9 +43,9 @@ ucd = "0.1.1"
|
|||
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
byteorder = "1.0"
|
||||
core-foundation = "0.6"
|
||||
core-graphics = "0.17"
|
||||
core-text = "13.0"
|
||||
core-foundation = "0.7"
|
||||
core-graphics = "0.19"
|
||||
core-text = "15.0"
|
||||
|
||||
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
|
||||
freetype = "0.4"
|
||||
|
|
|
@ -70,7 +70,7 @@ use style_traits::ToCss;
|
|||
use webrender_api::units::{LayoutRect, LayoutTransform, LayoutVector2D};
|
||||
use webrender_api::{self, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, ColorF};
|
||||
use webrender_api::{ColorU, ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LineStyle};
|
||||
use webrender_api::{NinePatchBorder, NinePatchBorderSource, NormalBorder};
|
||||
use webrender_api::{NinePatchBorder, NinePatchBorderSource, NormalBorder, PropertyBinding};
|
||||
use webrender_api::{ScrollSensitivity, StickyOffsetBounds};
|
||||
|
||||
static THREAD_TINT_COLORS: [ColorF; 8] = [
|
||||
|
@ -721,8 +721,9 @@ impl Fragment {
|
|||
state.add_display_item(DisplayItem::Rectangle(CommonDisplayItem::new(
|
||||
base,
|
||||
webrender_api::RectangleDisplayItem {
|
||||
color: background_color.to_layout(),
|
||||
color: PropertyBinding::Value(background_color.to_layout()),
|
||||
common: items::empty_common_item_properties(),
|
||||
bounds: bounds.to_layout(),
|
||||
},
|
||||
)));
|
||||
});
|
||||
|
@ -1468,7 +1469,8 @@ impl Fragment {
|
|||
base,
|
||||
webrender_api::RectangleDisplayItem {
|
||||
common: items::empty_common_item_properties(),
|
||||
color: background_color.to_layout(),
|
||||
color: PropertyBinding::Value(background_color.to_layout()),
|
||||
bounds: stacking_relative_border_box.to_layout(),
|
||||
},
|
||||
)));
|
||||
}
|
||||
|
@ -1514,7 +1516,8 @@ impl Fragment {
|
|||
base,
|
||||
webrender_api::RectangleDisplayItem {
|
||||
common: items::empty_common_item_properties(),
|
||||
color: self.style().get_inherited_text().color.to_layout(),
|
||||
color: PropertyBinding::Value(self.style().get_inherited_text().color.to_layout()),
|
||||
bounds: insertion_point_bounds.to_layout(),
|
||||
},
|
||||
)));
|
||||
}
|
||||
|
@ -1697,7 +1700,8 @@ impl Fragment {
|
|||
base,
|
||||
webrender_api::RectangleDisplayItem {
|
||||
common: items::empty_common_item_properties(),
|
||||
color: ColorF::TRANSPARENT,
|
||||
color: PropertyBinding::Value(ColorF::TRANSPARENT),
|
||||
bounds: content_size.to_layout(),
|
||||
},
|
||||
)));
|
||||
}
|
||||
|
|
|
@ -455,7 +455,6 @@ pub fn empty_common_item_properties() -> CommonItemProperties {
|
|||
spatial_id: SpatialId::root_scroll_node(wr::PipelineId::dummy()),
|
||||
hit_info: None,
|
||||
flags: PrimitiveFlags::empty(),
|
||||
item_key: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ pub use self::conversions::ToLayout;
|
|||
mod background;
|
||||
mod border;
|
||||
mod builder;
|
||||
mod conversions;
|
||||
pub(crate) mod conversions;
|
||||
mod gradient;
|
||||
pub mod items;
|
||||
mod webrender_helpers;
|
||||
|
|
|
@ -277,7 +277,6 @@ impl DisplayItem {
|
|||
},
|
||||
item_rect,
|
||||
node.clip.complex.clone(),
|
||||
None,
|
||||
);
|
||||
|
||||
state.spatial_ids[item.node_index.to_index()] = Some(parent_spatial_id);
|
||||
|
@ -293,7 +292,6 @@ impl DisplayItem {
|
|||
node.content_rect,
|
||||
node.clip.main,
|
||||
node.clip.complex.clone(),
|
||||
None,
|
||||
scroll_sensitivity,
|
||||
webrender_api::units::LayoutVector2D::zero(),
|
||||
);
|
||||
|
@ -341,6 +339,5 @@ fn build_common_item_properties(
|
|||
// TODO(gw): Make use of the WR backface visibility functionality.
|
||||
flags: PrimitiveFlags::default(),
|
||||
hit_info: tag,
|
||||
item_key: None,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
//! Implements sequential traversals over the DOM and flow trees.
|
||||
|
||||
use crate::context::LayoutContext;
|
||||
use crate::display_list::conversions::ToLayout;
|
||||
use crate::display_list::items::{self, CommonDisplayItem, DisplayItem, DisplayListSection};
|
||||
use crate::display_list::{DisplayListBuildState, StackingContextCollectionState};
|
||||
use crate::floats::SpeculatedFloatPlacement;
|
||||
|
@ -19,6 +20,7 @@ use euclid::default::{Point2D, Rect, Size2D, Vector2D};
|
|||
use servo_config::opts;
|
||||
use style::servo::restyle_damage::ServoRestyleDamage;
|
||||
use webrender_api::units::LayoutPoint;
|
||||
use webrender_api::PropertyBinding;
|
||||
|
||||
pub fn resolve_generated_content(root: &mut dyn Flow, layout_context: &LayoutContext) {
|
||||
ResolveGeneratedContent::new(&layout_context).traverse(root, 0);
|
||||
|
@ -83,8 +85,9 @@ pub fn build_display_list_for_subtree<'a>(
|
|||
|
||||
// Create a base rectangle for the page background based on the root
|
||||
// background color.
|
||||
let bounds = Rect::new(Point2D::new(Au::new(0), Au::new(0)), client_size);
|
||||
let base = state.create_base_display_item(
|
||||
Rect::new(Point2D::new(Au::new(0), Au::new(0)), client_size),
|
||||
bounds,
|
||||
flow_root.as_block().fragment.node,
|
||||
None,
|
||||
DisplayListSection::BackgroundAndBorders,
|
||||
|
@ -92,8 +95,9 @@ pub fn build_display_list_for_subtree<'a>(
|
|||
state.add_display_item(DisplayItem::Rectangle(CommonDisplayItem::new(
|
||||
base,
|
||||
webrender_api::RectangleDisplayItem {
|
||||
color: background_color,
|
||||
color: PropertyBinding::Value(background_color),
|
||||
common: items::empty_common_item_properties(),
|
||||
bounds: bounds.to_layout(),
|
||||
},
|
||||
)));
|
||||
|
||||
|
|
|
@ -341,8 +341,8 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
// “The background color is clipped according to the background-clip
|
||||
// value associated with the bottom-most background image layer.”
|
||||
let layer_index = b.background_image.0.len() - 1;
|
||||
let (_, common) = background::painting_area(self, builder, layer_index);
|
||||
builder.wr.push_rect(&common, rgba(background_color))
|
||||
let (bounds, common) = background::painting_area(self, builder, layer_index);
|
||||
builder.wr.push_rect(&common, bounds, rgba(background_color))
|
||||
}
|
||||
// Reverse because the property is top layer first, we want to paint bottom layer first.
|
||||
for (index, image) in b.background_image.0.iter().enumerate().rev() {
|
||||
|
@ -595,7 +595,6 @@ fn clip_for_radii(
|
|||
radii,
|
||||
mode: wr::ClipMode::Clip,
|
||||
}),
|
||||
None,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ embedder_traits = {path = "../embedder_traits"}
|
|||
env_logger = "0.7"
|
||||
euclid = "0.20"
|
||||
gfx = {path = "../gfx"}
|
||||
gleam = "0.9"
|
||||
gleam = "0.11"
|
||||
ipc-channel = "0.14"
|
||||
keyboard-types = "0.4"
|
||||
layout_thread_2013 = {path = "../layout_thread", optional = true}
|
||||
|
|
|
@ -400,14 +400,6 @@ where
|
|||
let viewport_size = coordinates.viewport.size.to_f32() / device_pixel_ratio;
|
||||
|
||||
let (mut webrender, webrender_api_sender) = {
|
||||
let recorder = if opts.webrender_record {
|
||||
let record_path = PathBuf::from("wr-record.bin");
|
||||
let recorder = Box::new(webrender::BinaryRecorder::new(&record_path));
|
||||
Some(recorder as Box<dyn webrender::ApiRecordingReceiver>)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let mut debug_flags = webrender::DebugFlags::empty();
|
||||
debug_flags.set(webrender::DebugFlags::PROFILER_DBG, opts.webrender_stats);
|
||||
|
||||
|
@ -424,7 +416,6 @@ where
|
|||
resource_override_path: opts.shaders_dir.clone(),
|
||||
enable_aa: opts.enable_text_antialiasing,
|
||||
debug_flags: debug_flags,
|
||||
recorder: recorder,
|
||||
precache_flags: if opts.precache_shaders {
|
||||
ShaderPrecacheFlags::FULL_COMPILE
|
||||
} else {
|
||||
|
|
|
@ -17,5 +17,5 @@ log = "0.4"
|
|||
malloc_size_of = { path = "../malloc_size_of" }
|
||||
serde = "1.0"
|
||||
servo_config = {path = "../config"}
|
||||
smallvec = "0.6"
|
||||
smallvec = { version = "0.6", features = ["serde"] }
|
||||
wgpu-core = { version = "0.1.0", git = "https://github.com/gfx-rs/wgpu", features = ["serde"] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue