Bug 1318465 - Drop local WR changes which we don't need. r=mchang?
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 17 Nov 2016 16:44:53 -0500
changeset 459777 3427f77e5e3c344bb4e83cc3262246e43d23ec8f
parent 459776 563c182ad485214af03efc41780598b402951b94
child 459778 e61d8807230203c99cce230186bd990cb8605d82
push id41343
push userkgupta@mozilla.com
push dateThu, 12 Jan 2017 20:13:44 +0000
reviewersmchang
bugs1318465
milestone53.0a1
Bug 1318465 - Drop local WR changes which we don't need. r=mchang? MozReview-Commit-ID: D67XmBxLn9x
gfx/webrender/src/bindings.rs
gfx/webrender/src/render_backend.rs
gfx/webrender/webrender.h
gfx/webrender_traits/src/api.rs
gfx/webrender_traits/src/types.rs
--- a/gfx/webrender/src/bindings.rs
+++ b/gfx/webrender/src/bindings.rs
@@ -461,25 +461,16 @@ pub extern fn wr_dp_push_iframe(state: &
                                                         Vec::new(),
                                                         None,
                                                         &mut state.frame_builder.auxiliary_lists_builder);
     let pipeline_id = PipelineId((layers_id >> 32) as u32, layers_id as u32);
     state.dl_builder.last_mut().unwrap().push_iframe(rect.to_rect(),
                                 clip_region, pipeline_id);
 }
 
-#[no_mangle]
-pub extern fn wr_set_async_scroll(window: &mut WrWindowState, state: &mut WrState, scroll_id: u64, x: f32, y: f32) {
-    let scroll_layer_id = webrender_traits::ScrollLayerId::new(
-        state.frame_builder.root_pipeline_id,
-        scroll_id as usize,
-        ServoScrollRootId(0));
-    window.api.set_scroll_offset(scroll_layer_id, Point2D::new(x, y));
-}
-
 #[repr(C)]
 pub struct WrRect
 {
     x: f32,
     y: f32,
     width: f32,
     height: f32
 }
--- a/gfx/webrender/src/render_backend.rs
+++ b/gfx/webrender/src/render_backend.rs
@@ -261,22 +261,16 @@ impl RenderBackend {
                         ApiMsg::TickScrollingBounce => {
                             let frame = profile_counters.total_time.profile(|| {
                                 self.frame.tick_scrolling_bounce_animations();
                                 self.render()
                             });
 
                             self.publish_frame_and_notify_compositor(frame, &mut profile_counters);
                         }
-                        ApiMsg::SetScrollOffset(scroll_id, offset) => {
-                            if let Some(ref mut layer) = self.frame.layers.get_mut(&scroll_id) {
-                                layer.scrolling.offset.x = offset.x;
-                                layer.scrolling.offset.y = offset.y;
-                            }
-                        }
                         ApiMsg::GenerateFrame => {
                             let frame = profile_counters.total_time.profile(|| {
                                 self.render()
                             });
                             self.publish_frame_and_notify_compositor(frame, &mut profile_counters);
                         }
                         ApiMsg::TranslatePointToLayerSpace(..) => {
                             panic!("unused api - remove from webrender_traits");
--- a/gfx/webrender/webrender.h
+++ b/gfx/webrender/webrender.h
@@ -105,21 +105,16 @@ wr_dp_push_image(wrstate* wrState, WRRec
                  const WRImageMask* mask, WRImageKey key)
 WR_FUNC;
 
 WR_INLINE void
 wr_dp_push_iframe(wrstate* wrState, WRRect bounds, WRRect clip,
                   uint64_t layers_id)
 WR_FUNC;
 
-WR_INLINE void
-wr_set_async_scroll(wrwindowstate* wrWindow, wrstate* wrState,
-                    uint64_t scroll_id, float x, float y)
-WR_FUNC;
-
 // The pointer returned by wr_readback_buffer must be freed by rust, not C.
 // After using the data, it is the responsibility of the caller to free the memory
 // by giving the pointer, out_length, out_capacity to wr_free_buffer.
 WR_INLINE const uint8_t*
 wr_readback_buffer(uint32_t width, uint32_t height, uint32_t* out_length, uint32_t* out_capacity)
 WR_FUNC;
 
 WR_INLINE void
--- a/gfx/webrender_traits/src/api.rs
+++ b/gfx/webrender_traits/src/api.rs
@@ -4,17 +4,17 @@
 
 use byteorder::{LittleEndian, WriteBytesExt};
 use euclid::{Point2D, Size2D};
 use ipc_channel::ipc::{self, IpcBytesSender, IpcSender};
 use offscreen_gl_context::{GLContextAttributes, GLLimits};
 use std::cell::Cell;
 use {ApiMsg, AuxiliaryLists, BuiltDisplayList, ColorF, DisplayListId, Epoch};
 use {FontKey, IdNamespace, ImageFormat, ImageKey, NativeFontHandle, PipelineId};
-use {RenderApiSender, ResourceId, ScrollEventPhase, ScrollLayerId, ScrollLayerState};
+use {RenderApiSender, ResourceId, ScrollEventPhase, ScrollLayerState};
 use {StackingContext, StackingContextId, WebGLContextId, WebGLCommand};
 use {GlyphKey, GlyphDimensions};
 
 impl RenderApiSender {
     pub fn new(api_sender: IpcSender<ApiMsg>,
                payload_sender: IpcBytesSender)
                -> RenderApiSender {
         RenderApiSender {
@@ -201,21 +201,16 @@ impl RenderApi {
         self.api_sender.send(msg).unwrap();
     }
 
     pub fn tick_scrolling_bounce_animations(&self) {
         let msg = ApiMsg::TickScrollingBounce;
         self.api_sender.send(msg).unwrap();
     }
 
-    pub fn set_scroll_offset(&self, scroll_id: ScrollLayerId, offset: Point2D<f32>) {
-        let msg = ApiMsg::SetScrollOffset(scroll_id, offset);
-        self.api_sender.send(msg).unwrap();
-    }
-
     pub fn generate_frame(&self) {
         let msg = ApiMsg::GenerateFrame;
         self.api_sender.send(msg).unwrap();
     }
 
     /// Translates a point from viewport coordinates to layer space
     pub fn translate_point_to_layer_space(&self, point: &Point2D<f32>)
                                           -> (Point2D<f32>, PipelineId) {
--- a/gfx/webrender_traits/src/types.rs
+++ b/gfx/webrender_traits/src/types.rs
@@ -47,17 +47,16 @@ pub enum ApiMsg {
                            PipelineId,
                            Size2D<f32>,
                            Vec<(StackingContextId, StackingContext)>,
                            Vec<(DisplayListId, BuiltDisplayListDescriptor)>,
                            AuxiliaryListsDescriptor),
     SetRootPipeline(PipelineId),
     Scroll(Point2D<f32>, Point2D<f32>, ScrollEventPhase),
     TickScrollingBounce,
-    SetScrollOffset(ScrollLayerId, Point2D<f32>),
     GenerateFrame,
     TranslatePointToLayerSpace(Point2D<f32>, IpcSender<(Point2D<f32>, PipelineId)>),
     GetScrollLayerState(IpcSender<Vec<ScrollLayerState>>),
     RequestWebGLContext(Size2D<i32>, GLContextAttributes, IpcSender<Result<(WebGLContextId, GLLimits), String>>),
     ResizeWebGLContext(WebGLContextId, Size2D<i32>),
     WebGLCommand(WebGLContextId, WebGLCommand),
 }