servoshell(egl): Adjust WebViewRenderer size when resizing surface size (#39507)

For egl, previously, the resize function only set rendering_context
size. It needs to change webview_renderer size at the same time.

Testing: Testing the Mossel [homepage](https://www.huaweimossel.com/) on
mobile devices shows no issues when resizing.

---------

Signed-off-by: yjx <yangjingxiao1@huawei.com>
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
Co-authored-by: yjx <yangjingxiao1@huawei.com>
Co-authored-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
blueguy1 2025-09-27 13:36:12 +08:00 committed by GitHub
parent 2e8fac9395
commit 6e8ecc6a2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -565,10 +565,10 @@ impl RunningAppState {
/// Let Servo know that the window has been resized. /// Let Servo know that the window has been resized.
pub fn resize(&self, coordinates: Coordinates) { pub fn resize(&self, coordinates: Coordinates) {
info!("resize to {:?}", coordinates,); info!("resize to {:?}", coordinates,);
self.active_webview().resize(PhysicalSize::new( let size = coordinates.viewport.size;
coordinates.viewport.width() as u32, self.active_webview().move_resize(size.to_f32().into());
coordinates.viewport.height() as u32, self.active_webview()
)); .resize(PhysicalSize::new(size.width as u32, size.height as u32));
*self.callbacks.coordinates.borrow_mut() = coordinates; *self.callbacks.coordinates.borrow_mut() = coordinates;
self.perform_updates(); self.perform_updates();
} }