aboutsummaryrefslogtreecommitdiffstats
path: root/ports/servoshell/egl/ohos/simpleservo.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-02-25 16:03:53 +0100
committerGitHub <noreply@github.com>2025-02-25 15:03:53 +0000
commit23524a541301ca4496f6f8c8ed7e72be6ea3319e (patch)
treed15c006754eb62f00d2bf8f5d6e3600e466902d8 /ports/servoshell/egl/ohos/simpleservo.rs
parentebb19bcd607f95e6514a7ad5091cdf7853ace2f9 (diff)
downloadservo-23524a541301ca4496f6f8c8ed7e72be6ea3319e.tar.gz
servo-23524a541301ca4496f6f8c8ed7e72be6ea3319e.zip
libservo: Move size handling to `RenderContext` from `WindowMethods` (#35621)
This is the first step toward removing `WindowMethods`, which will gradually be integrated into the `WebView` and `WebViewDelegate`. Sizing of the `WebView` is now handled by the a size associated with a `RenderingContext`. `WebView`s will eventually just paint the entire size of their `RenderingContext`. Notes: - This is transitionary step so now there is a `WebView::resize` and a `WebView::move_resize`. The first is the future which will resize the `WebView` and its associated `RenderingContext`. The second is a function that the virtual `WebView`s that will soon be replaced by a the one-`WebView` per `WebView` model. - We do not need to call `WebView::move_resize` at as much any longer because the default size of the `WebView` is to take up the whole `RenderingContext`. - `SurfmanRenderingContext` is no longer exposed in the API, as a surfman context doesn't naturally have a size unless a surface is bound to it. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'ports/servoshell/egl/ohos/simpleservo.rs')
-rw-r--r--ports/servoshell/egl/ohos/simpleservo.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/ports/servoshell/egl/ohos/simpleservo.rs b/ports/servoshell/egl/ohos/simpleservo.rs
index 3b40959d4d9..5ba9ab9d6cf 100644
--- a/ports/servoshell/egl/ohos/simpleservo.rs
+++ b/ports/servoshell/egl/ohos/simpleservo.rs
@@ -7,6 +7,7 @@ use std::path::PathBuf;
use std::ptr::NonNull;
use std::rc::Rc;
+use dpi::PhysicalSize;
use log::{debug, info};
use raw_window_handle::{
DisplayHandle, OhosDisplayHandle, OhosNdkWindowHandle, RawDisplayHandle, RawWindowHandle,
@@ -66,14 +67,7 @@ pub fn init(
let Ok(window_size) = (unsafe { super::get_xcomponent_size(xcomponent, native_window) }) else {
return Err("Failed to get xcomponent size");
};
- let coordinates = Coordinates::new(
- 0,
- 0,
- window_size.width,
- window_size.height,
- window_size.width,
- window_size.height,
- );
+ let coordinates = Coordinates::new(0, 0, window_size.width, window_size.height);
let display_handle = RawDisplayHandle::Ohos(OhosDisplayHandle::new());
let display_handle = unsafe { DisplayHandle::borrow_raw(display_handle) };
@@ -86,7 +80,7 @@ pub fn init(
WindowRenderingContext::new(
display_handle,
window_handle,
- &coordinates.framebuffer_size(),
+ PhysicalSize::new(window_size.width as u32, window_size.height as u32),
)
.expect("Could not create RenderingContext"),
);