Use more WebRender types in gfx/display_list

This uses floating-point (Layout) coordinates in where possible.
Replace NormalBorder struct with WebRender equivalent.
Remove ToPointF and ToRectF traits.
Convert border RepeatKeyword with ToLayout.
Add some definitions to malloc_size_of for WebRender types.
This commit is contained in:
Pyfisch 2018-01-12 21:24:23 +01:00
parent 8612a87ed2
commit 8c7c5f6e79
10 changed files with 181 additions and 240 deletions

View file

@ -10,7 +10,6 @@ path = "lib.rs"
doctest = false
[dependencies]
euclid = "0.16"
gfx = {path = "../../../components/gfx"}
gfx_traits = {path = "../../../components/gfx_traits"}
ipc-channel = "0.9"
@ -19,5 +18,5 @@ msg = {path = "../../../components/msg"}
net_traits = {path = "../../../components/net_traits"}
profile_traits = {path = "../../../components/profile_traits"}
servo_url = {path = "../../../components/url"}
style = {path = "../../../components/style"}
time = "0.1.12"
webrender_api = {git = "https://github.com/servo/webrender"}

View file

@ -4,7 +4,6 @@
#![cfg(test)]
extern crate euclid;
extern crate gfx;
extern crate gfx_traits;
extern crate ipc_channel;
@ -13,8 +12,8 @@ extern crate msg;
extern crate net_traits;
extern crate profile_traits;
extern crate servo_url;
extern crate style;
extern crate time;
extern crate webrender_api;
mod interactive_time;
mod paint_time;

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use euclid::Size2D;
use gfx::display_list::{BaseDisplayItem, WebRenderImageInfo};
use gfx::display_list::{DisplayItem, DisplayList, ImageDisplayItem};
use gfx_traits::Epoch;
@ -12,8 +11,8 @@ use msg::constellation_msg::TEST_PIPELINE_ID;
use net_traits::image::base::PixelFormat;
use profile_traits::time::{ProfilerChan, TimerMetadata};
use servo_url::ServoUrl;
use style::computed_values::image_rendering::T as ImageRendering;
use time;
use webrender_api::{ImageRendering, LayoutSize};
struct DummyProfilerMetadataFactory {}
impl ProfilerMetadataFactory for DummyProfilerMetadataFactory {
@ -128,8 +127,8 @@ fn test_first_contentful_paint_setter() {
key: None,
},
image_data: None,
stretch_size: Size2D::zero(),
tile_spacing: Size2D::zero(),
stretch_size: LayoutSize::zero(),
tile_spacing: LayoutSize::zero(),
image_rendering: ImageRendering::Auto,
}));
let display_list = DisplayList {