aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits
diff options
context:
space:
mode:
authorMukilan Thiyagarajan <mukilan@igalia.com>2023-09-14 15:00:42 +0530
committerMukilan Thiyagarajan <mukilan@igalia.com>2023-09-14 15:00:42 +0530
commitc385b3c9737c17d59cb02e520c3b68b232cb6497 (patch)
treead598ffbbdfbcecd6a4cf458abe2afc702d92c27 /components/script_traits
parent988e05a68b48c9e744bf49459faf41a1bd9b81d7 (diff)
downloadservo-revert-webrender.tar.gz
servo-revert-webrender.zip
Revert "Upgrade WebRender to e491e1ae637b2eed1e7195855d88357e5eb3ddf9 (#30323)"revert-webrender
This reverts commit a9d37cb85ac2c55fc630fccffe1ba60ff00f555b.
Diffstat (limited to 'components/script_traits')
-rw-r--r--components/script_traits/compositor.rs4
-rw-r--r--components/script_traits/lib.rs24
2 files changed, 19 insertions, 9 deletions
diff --git a/components/script_traits/compositor.rs b/components/script_traits/compositor.rs
index 43ab572e3bc..b63106d88ab 100644
--- a/components/script_traits/compositor.rs
+++ b/components/script_traits/compositor.rs
@@ -220,9 +220,6 @@ pub struct CompositorDisplayListInfo {
/// The size of the viewport that this display list renders into.
pub viewport_size: LayoutSize,
- /// The size of this display list's content.
- pub content_size: LayoutSize,
-
/// The epoch of the display list.
pub epoch: Epoch,
@@ -273,7 +270,6 @@ impl CompositorDisplayListInfo {
CompositorDisplayListInfo {
pipeline_id,
viewport_size,
- content_size,
epoch,
hit_test_info: Default::default(),
scroll_tree,
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 64c213955c2..0edf96b2d65 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -57,10 +57,13 @@ use servo_atoms::Atom;
use servo_url::{ImmutableOrigin, ServoUrl};
use style_traits::{CSSPixel, SpeculativePainter};
use webgpu::identity::WebGPUMsg;
-use webrender_api::units::{DeviceIntSize, DevicePixel, LayoutPixel, LayoutPoint, WorldPoint};
+use webrender_api::units::{
+ DeviceIntSize, DevicePixel, LayoutPixel, LayoutPoint, LayoutSize, WorldPoint,
+};
use webrender_api::{
BuiltDisplayList, BuiltDisplayListDescriptor, DocumentId, ExternalImageData, ExternalScrollId,
HitTestFlags, ImageData, ImageDescriptor, ImageKey, PipelineId as WebRenderPipelineId,
+ ScrollClamping,
};
use crate::compositor::CompositorDisplayListInfo;
@@ -1120,11 +1123,13 @@ pub enum WebrenderMsg {
/// Inform WebRender of the existence of this pipeline.
SendInitialTransaction(WebRenderPipelineId),
/// Perform a scroll operation.
- SendScrollNode(LayoutPoint, ExternalScrollId),
+ SendScrollNode(LayoutPoint, ExternalScrollId, ScrollClamping),
/// Inform WebRender of a new display list for the given pipeline.
SendDisplayList {
/// The [CompositorDisplayListInfo] that describes the display list being sent.
display_list_info: CompositorDisplayListInfo,
+ /// The content size of this display list as calculated by WebRender.
+ content_size: LayoutSize,
/// A descriptor of this display list used to construct this display list from raw data.
display_list_descriptor: BuiltDisplayListDescriptor,
/// An [ipc::IpcBytesReceiver] used to send the raw data of the display list.
@@ -1163,8 +1168,16 @@ impl WebrenderIpcSender {
}
/// Perform a scroll operation.
- pub fn send_scroll_node(&self, point: LayoutPoint, scroll_id: ExternalScrollId) {
- if let Err(e) = self.0.send(WebrenderMsg::SendScrollNode(point, scroll_id)) {
+ pub fn send_scroll_node(
+ &self,
+ point: LayoutPoint,
+ scroll_id: ExternalScrollId,
+ clamping: ScrollClamping,
+ ) {
+ if let Err(e) = self
+ .0
+ .send(WebrenderMsg::SendScrollNode(point, scroll_id, clamping))
+ {
warn!("Error sending scroll node: {}", e);
}
}
@@ -1173,12 +1186,13 @@ impl WebrenderIpcSender {
pub fn send_display_list(
&self,
display_list_info: CompositorDisplayListInfo,
- list: BuiltDisplayList,
+ (_, content_size, list): (WebRenderPipelineId, LayoutSize, BuiltDisplayList),
) {
let (display_list_data, display_list_descriptor) = list.into_data();
let (display_list_sender, display_list_receiver) = ipc::bytes_channel().unwrap();
if let Err(e) = self.0.send(WebrenderMsg::SendDisplayList {
display_list_info,
+ content_size,
display_list_descriptor,
display_list_receiver,
}) {