Skip to content

Commit ddd39f9

Browse files
committed
Address some review comments.
1 parent c669148 commit ddd39f9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

webrender/src/frame.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use webrender_traits::{ClipRegion, ColorF, DisplayItem, StackingContext, FilterO
2222
use webrender_traits::{ScrollEventPhase, ScrollLayerInfo, SpecificDisplayItem, ScrollLayerState};
2323
use webrender_traits::{LayerRect, LayerPoint, LayerSize};
2424
use webrender_traits::{ServoScrollRootId, ScrollLayerRect, as_scroll_parent_rect, ScrollLayerPixel};
25-
use webrender_traits::WorldPoint4D;
25+
use webrender_traits::{WorldPoint, WorldPoint4D};
2626
use webrender_traits::{LayerToScrollTransform, ScrollToWorldTransform};
2727

2828
#[cfg(target_os = "macos")]
@@ -236,7 +236,7 @@ impl Frame {
236236
old_layer_scrolling_states
237237
}
238238

239-
pub fn get_scroll_layer(&self, cursor: &LayerPoint, scroll_layer_id: ScrollLayerId)
239+
pub fn get_scroll_layer(&self, cursor: &WorldPoint, scroll_layer_id: ScrollLayerId)
240240
-> Option<ScrollLayerId> {
241241
self.layers.get(&scroll_layer_id).and_then(|layer| {
242242
for child_layer_id in layer.children.iter().rev() {
@@ -332,7 +332,7 @@ impl Frame {
332332
/// Returns true if any layers actually changed position or false otherwise.
333333
pub fn scroll(&mut self,
334334
mut delta: LayerPoint,
335-
cursor: LayerPoint,
335+
cursor: WorldPoint,
336336
phase: ScrollEventPhase)
337337
-> bool {
338338
let root_scroll_layer_id = match self.root_scroll_layer_id {

webrender_traits/src/api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use {ApiMsg, ColorF, DisplayListBuilder, Epoch};
1010
use {FontKey, IdNamespace, ImageFormat, ImageKey, NativeFontHandle, PipelineId};
1111
use {RenderApiSender, ResourceId, ScrollEventPhase, ScrollLayerState, ServoScrollRootId};
1212
use {GlyphKey, GlyphDimensions, ImageData, WebGLContextId, WebGLCommand};
13-
use {DeviceIntSize, LayoutPoint, LayoutSize};
13+
use {DeviceIntSize, LayoutPoint, LayoutSize, WorldPoint};
1414

1515
impl RenderApiSender {
1616
pub fn new(api_sender: MsgSender<ApiMsg>,
@@ -188,7 +188,7 @@ impl RenderApi {
188188
///
189189
/// Webrender looks for the layer closest to the user
190190
/// which has `ScrollPolicy::Scrollable` set.
191-
pub fn scroll(&self, delta: LayoutPoint, cursor: LayoutPoint, phase: ScrollEventPhase) {
191+
pub fn scroll(&self, delta: LayoutPoint, cursor: WorldPoint, phase: ScrollEventPhase) {
192192
let msg = ApiMsg::Scroll(delta, cursor, phase);
193193
self.api_sender.send(msg).unwrap();
194194
}
@@ -207,7 +207,7 @@ impl RenderApi {
207207
}
208208

209209
/// Translates a point from viewport coordinates to layer space
210-
pub fn translate_point_to_layer_space(&self, point: &LayoutPoint)
210+
pub fn translate_point_to_layer_space(&self, point: &WorldPoint)
211211
-> (LayoutPoint, PipelineId) {
212212
let (tx, rx) = channel::msg_channel().unwrap();
213213
let msg = ApiMsg::TranslatePointToLayerSpace(*point, tx);

webrender_traits/src/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ pub enum ApiMsg {
4747
BuiltDisplayListDescriptor,
4848
AuxiliaryListsDescriptor),
4949
SetRootPipeline(PipelineId),
50-
Scroll(LayoutPoint, LayoutPoint, ScrollEventPhase),
50+
Scroll(LayoutPoint, WorldPoint, ScrollEventPhase),
5151
ScrollLayersWithScrollId(LayoutPoint, PipelineId, ServoScrollRootId),
5252
TickScrollingBounce,
53-
TranslatePointToLayerSpace(LayoutPoint, MsgSender<(LayoutPoint, PipelineId)>),
53+
TranslatePointToLayerSpace(WorldPoint, MsgSender<(LayoutPoint, PipelineId)>),
5454
GetScrollLayerState(MsgSender<Vec<ScrollLayerState>>),
5555
RequestWebGLContext(DeviceIntSize, GLContextAttributes, MsgSender<Result<(WebGLContextId, GLLimits), String>>),
5656
ResizeWebGLContext(WebGLContextId, DeviceIntSize),

0 commit comments

Comments
 (0)