mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use webrender_api::units::DevicePixel
rather than style_traits::DevicePixel
unless interfacing with Stylo (#34353)
* Use webrender_api::units::DevicePixel rather than style_traits::DevicePixel unless interfacing with Stylo Signed-off-by: Nico Burns <nico@nicoburns.com> * Fix OpenHarmony build Signed-off-by: Nico Burns <nico@nicoburns.com> --------- Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
parent
97154d9cf8
commit
63793ccbb7
17 changed files with 52 additions and 46 deletions
|
@ -35,11 +35,11 @@ use script_traits::{
|
|||
ScrollState, TouchEventType, TouchId, WheelDelta, WindowSizeData, WindowSizeType,
|
||||
};
|
||||
use servo_geometry::{DeviceIndependentPixel, FramebufferUintLength};
|
||||
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
|
||||
use style_traits::{CSSPixel, PinchZoomFactor};
|
||||
use webrender::{CaptureBits, RenderApi, Transaction};
|
||||
use webrender_api::units::{
|
||||
DeviceIntPoint, DeviceIntSize, DevicePoint, DeviceRect, LayoutPoint, LayoutRect, LayoutSize,
|
||||
LayoutVector2D, WorldPoint,
|
||||
DeviceIntPoint, DeviceIntSize, DevicePixel, DevicePoint, DeviceRect, LayoutPoint, LayoutRect,
|
||||
LayoutSize, LayoutVector2D, WorldPoint,
|
||||
};
|
||||
use webrender_api::{
|
||||
self, BuiltDisplayList, DirtyRect, DisplayListPayload, DocumentId, Epoch as WebRenderEpoch,
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
use euclid::{Point2D, Scale, Vector2D};
|
||||
use log::{debug, warn};
|
||||
use script_traits::{EventResult, TouchId};
|
||||
use style_traits::DevicePixel;
|
||||
use webrender_api::units::{DeviceIntPoint, LayoutVector2D};
|
||||
use webrender_api::units::{DeviceIntPoint, DevicePixel, LayoutVector2D};
|
||||
|
||||
use self::TouchState::*;
|
||||
|
||||
|
|
|
@ -19,8 +19,9 @@ use script_traits::{
|
|||
};
|
||||
use servo_geometry::{DeviceIndependentIntRect, DeviceIndependentIntSize, DeviceIndependentPixel};
|
||||
use servo_url::ServoUrl;
|
||||
use style_traits::DevicePixel;
|
||||
use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint, DeviceRect};
|
||||
use webrender_api::units::{
|
||||
DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePixel, DevicePoint, DeviceRect,
|
||||
};
|
||||
use webrender_api::ScrollLocation;
|
||||
use webrender_traits::RenderingContext;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ use bitflags::bitflags;
|
|||
use canvas_traits::canvas::{CanvasMsg, FromLayoutMsg};
|
||||
use embedder_traits::Cursor;
|
||||
use euclid::default::{Point2D, Rect, SideOffsets2D as UntypedSideOffsets2D, Size2D};
|
||||
use euclid::{rect, SideOffsets2D};
|
||||
use euclid::{rect, Scale, SideOffsets2D};
|
||||
use fnv::FnvHashMap;
|
||||
use fonts::ByteIndex;
|
||||
use ipc_channel::ipc;
|
||||
|
@ -907,7 +907,12 @@ impl Fragment {
|
|||
.filter_map(|(name, id)| id.as_shorthand().err().map(|id| (name, id)))
|
||||
.map(|(name, id)| (name.clone(), style.computed_value_to_string(id)))
|
||||
.collect();
|
||||
painter.draw_a_paint_image(size_in_px, device_pixel_ratio, properties, arguments)
|
||||
painter.draw_a_paint_image(
|
||||
size_in_px,
|
||||
Scale::new(device_pixel_ratio.get()),
|
||||
properties,
|
||||
arguments,
|
||||
)
|
||||
},
|
||||
None => {
|
||||
debug!("Worklet {} called before registration.", name);
|
||||
|
|
|
@ -32,8 +32,8 @@ use style::values::generics::NonNegative;
|
|||
use style::values::specified::text::TextDecorationLine;
|
||||
use style::values::specified::ui::CursorKind;
|
||||
use style::Zero;
|
||||
use style_traits::{CSSPixel, DevicePixel};
|
||||
use webrender_api::units::{LayoutPixel, LayoutRect, LayoutSize};
|
||||
use style_traits::CSSPixel;
|
||||
use webrender_api::units::{DevicePixel, LayoutPixel, LayoutRect, LayoutSize};
|
||||
use webrender_api::{
|
||||
self as wr, units, BorderDetails, BoxShadowClipMode, ClipChainId, CommonItemProperties,
|
||||
ImageRendering, NinePatchBorder, NinePatchBorderSource,
|
||||
|
|
|
@ -101,9 +101,10 @@ use style::traversal_flags::TraversalFlags;
|
|||
use style::values::computed::font::GenericFontFamily;
|
||||
use style::values::computed::{FontSize, Length, NonNegativeLength};
|
||||
use style::values::specified::font::KeywordInfo;
|
||||
use style_traits::{CSSPixel, DevicePixel, SpeculativePainter};
|
||||
use style_traits::{CSSPixel, SpeculativePainter};
|
||||
use time_03::Duration;
|
||||
use url::Url;
|
||||
use webrender_api::units::DevicePixel;
|
||||
use webrender_api::{units, ColorF, HitTestFlags};
|
||||
use webrender_traits::CrossProcessCompositorApi;
|
||||
|
||||
|
@ -587,7 +588,7 @@ impl LayoutThread {
|
|||
MediaType::screen(),
|
||||
QuirksMode::NoQuirks,
|
||||
window_size.initial_viewport,
|
||||
window_size.device_pixel_ratio,
|
||||
Scale::new(window_size.device_pixel_ratio.get()),
|
||||
Box::new(LayoutFontMetricsProvider),
|
||||
ComputedValues::initial_values_with_font_override(font),
|
||||
);
|
||||
|
@ -1400,7 +1401,8 @@ impl LayoutThread {
|
|||
);
|
||||
|
||||
if self.stylist.device().au_viewport_size() == au_viewport_size &&
|
||||
self.stylist.device().device_pixel_ratio() == window_size_data.device_pixel_ratio
|
||||
self.stylist.device().device_pixel_ratio().get() ==
|
||||
window_size_data.device_pixel_ratio.get()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1409,7 +1411,7 @@ impl LayoutThread {
|
|||
MediaType::screen(),
|
||||
self.stylist.quirks_mode(),
|
||||
window_size_data.initial_viewport,
|
||||
window_size_data.device_pixel_ratio,
|
||||
Scale::new(window_size_data.device_pixel_ratio.get()),
|
||||
Box::new(LayoutFontMetricsProvider),
|
||||
self.stylist.device().default_computed_values().to_arc(),
|
||||
);
|
||||
|
|
|
@ -87,9 +87,9 @@ use style::values::computed::font::GenericFontFamily;
|
|||
use style::values::computed::{CSSPixelLength, FontSize, Length, NonNegativeLength};
|
||||
use style::values::specified::font::KeywordInfo;
|
||||
use style::{driver, Zero};
|
||||
use style_traits::{CSSPixel, DevicePixel, SpeculativePainter};
|
||||
use style_traits::{CSSPixel, SpeculativePainter};
|
||||
use url::Url;
|
||||
use webrender_api::units::LayoutPixel;
|
||||
use webrender_api::units::{DevicePixel, LayoutPixel};
|
||||
use webrender_api::{units, ExternalScrollId, HitTestFlags};
|
||||
use webrender_traits::CrossProcessCompositorApi;
|
||||
|
||||
|
@ -567,7 +567,7 @@ impl LayoutThread {
|
|||
MediaType::screen(),
|
||||
QuirksMode::NoQuirks,
|
||||
window_size.initial_viewport,
|
||||
window_size.device_pixel_ratio,
|
||||
Scale::new(window_size.device_pixel_ratio.get()),
|
||||
Box::new(LayoutFontMetricsProvider(font_context.clone())),
|
||||
ComputedValues::initial_values_with_font_override(font),
|
||||
);
|
||||
|
@ -1108,7 +1108,8 @@ impl LayoutThread {
|
|||
);
|
||||
|
||||
if self.stylist.device().au_viewport_size() == au_viewport_size &&
|
||||
self.stylist.device().device_pixel_ratio() == window_size_data.device_pixel_ratio
|
||||
self.stylist.device().device_pixel_ratio().get() ==
|
||||
window_size_data.device_pixel_ratio.get()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1117,7 +1118,7 @@ impl LayoutThread {
|
|||
MediaType::screen(),
|
||||
self.stylist.quirks_mode(),
|
||||
window_size_data.initial_viewport,
|
||||
window_size_data.device_pixel_ratio,
|
||||
Scale::new(window_size_data.device_pixel_ratio.get()),
|
||||
Box::new(LayoutFontMetricsProvider(self.font_context.clone())),
|
||||
self.stylist.device().default_computed_values().to_arc(),
|
||||
);
|
||||
|
|
|
@ -9,7 +9,8 @@ use dom_struct::dom_struct;
|
|||
use euclid::{Scale, Size2D};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use servo_url::ServoUrl;
|
||||
use style_traits::{CSSPixel, DevicePixel};
|
||||
use style_traits::CSSPixel;
|
||||
use webrender_api::units::DevicePixel;
|
||||
|
||||
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::{
|
||||
CanvasFillRule, CanvasImageSource, CanvasLineCap, CanvasLineJoin,
|
||||
|
|
|
@ -28,7 +28,8 @@ use script_traits::{DrawAPaintImageResult, PaintWorkletError, Painter};
|
|||
use servo_atoms::Atom;
|
||||
use servo_config::pref;
|
||||
use servo_url::ServoUrl;
|
||||
use style_traits::{CSSPixel, DevicePixel, SpeculativePainter};
|
||||
use style_traits::{CSSPixel, SpeculativePainter};
|
||||
use webrender_api::units::DevicePixel;
|
||||
|
||||
use super::bindings::trace::HashMapTracedValues;
|
||||
use crate::dom::bindings::callback::CallbackContainer;
|
||||
|
|
|
@ -75,9 +75,9 @@ use style::properties::PropertyId;
|
|||
use style::selector_parser::PseudoElement;
|
||||
use style::str::HTML_SPACE_CHARACTERS;
|
||||
use style::stylesheets::{CssRuleType, Origin, UrlExtraData};
|
||||
use style_traits::{CSSPixel, DevicePixel, ParsingMode};
|
||||
use style_traits::{CSSPixel, ParsingMode};
|
||||
use url::Position;
|
||||
use webrender_api::units::LayoutPixel;
|
||||
use webrender_api::units::{DevicePixel, LayoutPixel};
|
||||
use webrender_api::{DocumentId, ExternalScrollId};
|
||||
use webrender_traits::CrossProcessCompositorApi;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue