Skip to content

Commit

Permalink
Bug 1733021 - Remove unused get_scroll_node_state API r=gfx-reviewers…
Browse files Browse the repository at this point in the history
…,nical

Differential Revision: https://phabricator.services.mozilla.com/D126860
  • Loading branch information
Glenn Watson committed Sep 30, 2021
1 parent e8f2c2c commit 9a6b42c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 38 deletions.
12 changes: 1 addition & 11 deletions gfx/wr/webrender/src/render_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::api::{BlobImageData, BlobImageKey, ImageData, ImageDescriptor, ImageK
use crate::api::{BlobImageParams, BlobImageRequest, BlobImageResult, AsyncBlobImageRasterizer, BlobImageHandler};
use crate::api::{DocumentId, PipelineId, PropertyBindingId, PropertyBindingKey, ExternalEvent};
use crate::api::{HitTestResult, HitTesterRequest, ApiHitTester, PropertyValue, DynamicProperties};
use crate::api::{ScrollClamping, TileSize, NotificationRequest, DebugFlags, ScrollNodeState};
use crate::api::{ScrollClamping, TileSize, NotificationRequest, DebugFlags};
use crate::api::{GlyphDimensionRequest, GlyphIndexRequest, GlyphIndex, GlyphDimensions};
use crate::api::{FontInstanceOptions, FontInstancePlatformOptions, FontVariation};
use crate::api::DEFAULT_TILE_SIZE;
Expand Down Expand Up @@ -802,8 +802,6 @@ pub enum FrameMsg {
///
ScrollNodeWithId(LayoutPoint, ExternalScrollId, ScrollClamping),
///
GetScrollNodeState(Sender<Vec<ScrollNodeState>>),
///
ResetDynamicProperties,
///
AppendDynamicProperties(DynamicProperties),
Expand Down Expand Up @@ -833,7 +831,6 @@ impl fmt::Debug for FrameMsg {
FrameMsg::HitTest(..) => "FrameMsg::HitTest",
FrameMsg::RequestHitTester(..) => "FrameMsg::RequestHitTester",
FrameMsg::ScrollNodeWithId(..) => "FrameMsg::ScrollNodeWithId",
FrameMsg::GetScrollNodeState(..) => "FrameMsg::GetScrollNodeState",
FrameMsg::ResetDynamicProperties => "FrameMsg::ResetDynamicProperties",
FrameMsg::AppendDynamicProperties(..) => "FrameMsg::AppendDynamicProperties",
FrameMsg::AppendDynamicTransformProperties(..) => "FrameMsg::AppendDynamicTransformProperties",
Expand Down Expand Up @@ -1296,13 +1293,6 @@ impl RenderApi {
HitTesterRequest { rx }
}

///
pub fn get_scroll_node_state(&self, document_id: DocumentId) -> Vec<ScrollNodeState> {
let (tx, rx) = single_msg_channel();
self.send_frame_msg(document_id, FrameMsg::GetScrollNodeState(tx));
rx.recv().unwrap()
}

// Some internal scheduling magic that leaked into the API.
// Buckle up and see APZUpdater.cpp for more info about what this is about.
#[doc(hidden)]
Expand Down
4 changes: 0 additions & 4 deletions gfx/wr/webrender/src/render_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,6 @@ impl Document {
..DocumentOps::nop()
};
}
FrameMsg::GetScrollNodeState(tx) => {
profile_scope!("GetScrollNodeState");
tx.send(self.scene.spatial_tree.get_scroll_node_state()).unwrap();
}
FrameMsg::ResetDynamicProperties => {
self.dynamic_properties.reset_properties();
}
Expand Down
15 changes: 1 addition & 14 deletions gfx/wr/webrender/src/spatial_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use api::{ExternalScrollId, PropertyBinding, ReferenceFrameKind, TransformStyle, PropertyBindingId};
use api::{PipelineId, ScrollClamping, ScrollNodeState, ScrollSensitivity, SpatialTreeItemKey};
use api::{PipelineId, ScrollClamping, ScrollSensitivity, SpatialTreeItemKey};
use api::units::*;
use euclid::Transform3D;
use crate::gpu_types::TransformPalette;
Expand Down Expand Up @@ -725,19 +725,6 @@ impl SpatialTree {
self.root_reference_frame_index
}

pub fn get_scroll_node_state(&self) -> Vec<ScrollNodeState> {
let mut result = vec![];
for node in &self.spatial_nodes {
if let SpatialNodeType::ScrollFrame(info) = node.node_type {
result.push(ScrollNodeState {
id: info.external_id,
scroll_offset: info.offset - info.external_scroll_offset,
})
}
}
result
}

pub fn drain(&mut self) -> ScrollStates {
let mut scroll_states = FastHashMap::default();
for old_node in &mut self.spatial_nodes.drain(..) {
Expand Down
9 changes: 0 additions & 9 deletions gfx/wr/webrender_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,15 +609,6 @@ pub enum PrimitiveKeyKind {
},
}

///
#[derive(Clone)]
pub struct ScrollNodeState {
///
pub id: ExternalScrollId,
///
pub scroll_offset: LayoutVector2D,
}

///
#[derive(Clone, Copy, Debug)]
pub enum ScrollLocation {
Expand Down

0 comments on commit 9a6b42c

Please sign in to comment.