Auto merge of #24153 - servo:wr-dl, r=nox

Remove layout_2020::display_list, use WebRender display lists instead

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24153)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-09-09 08:33:08 -04:00 committed by GitHub
commit 5bcb1b579c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 62 additions and 155 deletions

View file

@ -4,13 +4,10 @@
use gfx_traits::Epoch;
use ipc_channel::ipc;
use layout::display_list::items::{BaseDisplayItem, CommonDisplayItem, DisplayItem, DisplayList};
use metrics::{PaintTimeMetrics, ProfilerMetadataFactory, ProgressiveWebMetric};
use msg::constellation_msg::TEST_PIPELINE_ID;
use profile_traits::time::{ProfilerChan, TimerMetadata};
use servo_url::ServoUrl;
use webrender_api::units::{LayoutRect, LayoutSize};
use webrender_api::{AlphaType, ColorF, ImageDisplayItem, ImageKey, ImageRendering};
struct DummyProfilerMetadataFactory {}
impl ProfilerMetadataFactory for DummyProfilerMetadataFactory {
@ -49,7 +46,7 @@ fn test_paint_metrics_construction() {
);
}
fn test_common(display_list: &DisplayList, epoch: Epoch) -> PaintTimeMetrics {
fn test_common(display_list_is_contentful: bool, epoch: Epoch) -> PaintTimeMetrics {
let (sender, _) = ipc::channel().unwrap();
let profiler_chan = ProfilerChan(sender);
let (layout_sender, _) = ipc::channel().unwrap();
@ -66,7 +63,7 @@ fn test_common(display_list: &DisplayList, epoch: Epoch) -> PaintTimeMetrics {
paint_time_metrics.maybe_observe_paint_time(
&dummy_profiler_metadata_factory,
epoch,
&*display_list,
display_list_is_contentful,
);
// Should not set any metric until navigation start is set.
@ -95,12 +92,8 @@ fn test_common(display_list: &DisplayList, epoch: Epoch) -> PaintTimeMetrics {
#[test]
fn test_first_paint_setter() {
let empty_display_list = DisplayList {
list: Vec::new(),
clip_scroll_nodes: Vec::new(),
};
let epoch = Epoch(0);
let paint_time_metrics = test_common(&empty_display_list, epoch);
let paint_time_metrics = test_common(false, epoch);
let now = time::precise_time_ns();
paint_time_metrics.maybe_set_metric(epoch, now);
assert!(
@ -116,25 +109,8 @@ fn test_first_paint_setter() {
#[test]
fn test_first_contentful_paint_setter() {
let image = DisplayItem::Image(CommonDisplayItem::new(
BaseDisplayItem::empty(),
ImageDisplayItem {
bounds: LayoutRect::zero(),
common: layout::display_list::items::empty_common_item_properties(),
image_key: ImageKey::DUMMY,
stretch_size: LayoutSize::zero(),
tile_spacing: LayoutSize::zero(),
image_rendering: ImageRendering::Auto,
alpha_type: AlphaType::PremultipliedAlpha,
color: ColorF::WHITE,
},
));
let display_list = DisplayList {
list: vec![image],
clip_scroll_nodes: Vec::new(),
};
let epoch = Epoch(0);
let paint_time_metrics = test_common(&display_list, epoch);
let paint_time_metrics = test_common(true, epoch);
let now = time::precise_time_ns();
paint_time_metrics.maybe_set_metric(epoch, now);
assert!(