aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread
diff options
context:
space:
mode:
authorNico Burns <nico@nicoburns.com>2024-11-26 12:42:04 +1300
committerGitHub <noreply@github.com>2024-11-25 23:42:04 +0000
commit63793ccbb7c0768af3f31c274df70625abacb508 (patch)
treeeab4f8cac59a5628df9f70a30028a0bbdc1aa74c /components/layout_thread
parent97154d9cf8a42564742eab9d0a8974766edd210f (diff)
downloadservo-63793ccbb7c0768af3f31c274df70625abacb508.tar.gz
servo-63793ccbb7c0768af3f31c274df70625abacb508.zip
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>
Diffstat (limited to 'components/layout_thread')
-rw-r--r--components/layout_thread/lib.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index 61e718babde..949ee05e5dc 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -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(),
);