mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Remove layout_2020::display_list, use WebRender display lists instead
This commit is contained in:
parent
e9f7079c70
commit
3e6489f543
9 changed files with 22 additions and 105 deletions
|
@ -1,17 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use euclid::Vector2D;
|
||||
use std::collections::HashMap;
|
||||
use std::f32;
|
||||
use webrender_api::units::LayoutPixel;
|
||||
use webrender_api::ExternalScrollId;
|
||||
|
||||
pub use style::dom::OpaqueNode;
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct DisplayList {}
|
||||
|
||||
/// The type of the scroll offset list. This is only populated if WebRender is in use.
|
||||
pub type ScrollOffsetMap = HashMap<ExternalScrollId, Vector2D<f32, LayoutPixel>>;
|
|
@ -1,6 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
pub mod items;
|
||||
mod webrender_helpers;
|
|
@ -1,33 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::display_list::items::DisplayList;
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use webrender_api::units::LayoutSize;
|
||||
use webrender_api::{self, DisplayListBuilder};
|
||||
|
||||
/// Contentful paint, for the purpose of
|
||||
/// https://w3c.github.io/paint-timing/#first-contentful-paint
|
||||
/// (i.e. the display list contains items of type text,
|
||||
/// image, non-white canvas or SVG). Used by metrics.
|
||||
pub struct IsContentful(pub bool);
|
||||
|
||||
impl DisplayList {
|
||||
pub fn convert_to_webrender(
|
||||
&mut self,
|
||||
pipeline_id: PipelineId,
|
||||
) -> (DisplayListBuilder, IsContentful) {
|
||||
let webrender_pipeline = pipeline_id.to_webrender();
|
||||
|
||||
let builder = DisplayListBuilder::with_capacity(
|
||||
webrender_pipeline,
|
||||
LayoutSize::zero(),
|
||||
1024 * 1024, // 1 MB of space
|
||||
);
|
||||
|
||||
let is_contentful = IsContentful(false);
|
||||
|
||||
(builder, is_contentful)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue