Removed unused in_scroll_transaction and removed import of std::time:Instant since it was only used by in_scroll_transaction.

This commit is contained in:
fabrizio8 2018-11-04 13:00:39 -05:00
parent 85fb000e89
commit b3319360b5

View file

@ -32,7 +32,6 @@ use std::fs::{File, create_dir_all};
use std::io::Write; use std::io::Write;
use std::num::NonZeroU32; use std::num::NonZeroU32;
use std::rc::Rc; use std::rc::Rc;
use std::time::Instant;
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor}; use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
use style_traits::cursor::CursorKind; use style_traits::cursor::CursorKind;
use style_traits::viewport::ViewportConstraints; use style_traits::viewport::ViewportConstraints;
@ -166,8 +165,6 @@ pub struct IOCompositor<Window: WindowMethods> {
/// image for the reftest framework. /// image for the reftest framework.
ready_to_save_state: ReadyState, ready_to_save_state: ReadyState,
in_scroll_transaction: Option<Instant>,
/// The webrender renderer. /// The webrender renderer.
webrender: webrender::Renderer, webrender: webrender::Renderer,
@ -320,7 +317,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
time_profiler_chan: state.time_profiler_chan, time_profiler_chan: state.time_profiler_chan,
last_composite_time: 0, last_composite_time: 0,
ready_to_save_state: ReadyState::Unknown, ready_to_save_state: ReadyState::Unknown,
in_scroll_transaction: None,
webrender: state.webrender, webrender: state.webrender,
webrender_document: state.webrender_document, webrender_document: state.webrender_document,
webrender_api: state.webrender_api, webrender_api: state.webrender_api,
@ -843,7 +839,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
&mut self, &mut self,
delta: ScrollLocation, delta: ScrollLocation,
cursor: DeviceIntPoint, cursor: DeviceIntPoint,
phase: TouchEventType, phase: TouchEventType
) { ) {
match phase { match phase {
TouchEventType::Move => self.on_scroll_window_event(delta, cursor), TouchEventType::Move => self.on_scroll_window_event(delta, cursor),
@ -856,8 +852,11 @@ impl<Window: WindowMethods> IOCompositor<Window> {
} }
} }
fn on_scroll_window_event(&mut self, scroll_location: ScrollLocation, cursor: DeviceIntPoint) { fn on_scroll_window_event(
self.in_scroll_transaction = Some(Instant::now()); &mut self,
scroll_location: ScrollLocation,
cursor: DeviceIntPoint
) {
self.pending_scroll_zoom_events.push(ScrollZoomEvent { self.pending_scroll_zoom_events.push(ScrollZoomEvent {
magnification: 1.0, magnification: 1.0,
scroll_location: scroll_location, scroll_location: scroll_location,