Skip to content

Commit

Permalink
Clean up renderer fling code.
Browse files Browse the repository at this point in the history
This cl cleans up the fling handling logic on the renderer side. I've already
added DCHECKs in InputHandlerProxy::HandleGestureFlingStart and some other
functions in input_handler_proxy.cc to make sure that touchscreen and touchpad
flings are not sent to the renderer. Since Mar 28, Autoscroll fling is also
being handled in browser (https://chromium-review.googlesource.com/980965) and
it is safe to delete the dead code from renderer.

To avoid making this cl larger I'll land separate cls for the remaining clean up:
1-Convert fling related layout tests that are using event sender to use gpu
benchmarking or write browser tests instead, delete send GFS/GFC from event sender.
2-DidOvercroll and DidStopFlinging IPCs are not needed anymore.
3-git grep for "fling" and "curve" and check code coverage to remove any remaining
fling related dead code.

Bug: 249063
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ibd1db260c0b3c92c7ccf17156dd38c4865ae1926
Reviewed-on: https://chromium-review.googlesource.com/1117639
Commit-Queue: Sahel Sharify <sahel@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Reviewed-by: Lan Wei <lanwei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574244}
  • Loading branch information
Sahel Sharify authored and Commit Bot committed Jul 11, 2018
1 parent 051c824 commit 4b723c9
Show file tree
Hide file tree
Showing 51 changed files with 100 additions and 1,954 deletions.
5 changes: 0 additions & 5 deletions cc/input/input_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class CC_EXPORT InputHandlerClient {

virtual void WillShutdown() = 0;
virtual void Animate(base::TimeTicks time) = 0;
virtual void MainThreadHasStoppedFlinging() = 0;
virtual void ReconcileElasticOverscrollAndRootScroll() = 0;
virtual void UpdateRootLayerStateForSynchronousInputHandler(
const gfx::ScrollOffset& total_scroll_offset,
Expand Down Expand Up @@ -164,10 +163,6 @@ class CC_EXPORT InputHandler {
// ScrollBegin() returned SCROLL_STARTED.
virtual InputHandlerScrollResult ScrollBy(ScrollState* scroll_state) = 0;

// Returns SCROLL_STARTED if a layer was actively being scrolled,
// SCROLL_IGNORED if not.
virtual ScrollStatus FlingScrollBegin() = 0;

virtual void MouseMoveAt(const gfx::Point& mouse_position) = 0;
virtual void MouseDown() = 0;
virtual void MouseUp() = 0;
Expand Down
1 change: 0 additions & 1 deletion cc/test/fake_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class FakeProxy : public Proxy {
bool RequestedAnimatePending() override;
void NotifyInputThrottledUntilCommit() override {}
void SetDeferCommits(bool defer_commits) override {}
void MainThreadHasStoppedFlinging() override {}
bool CommitRequested() const override;
void Start() override {}
void Stop() override {}
Expand Down
4 changes: 0 additions & 4 deletions cc/trees/layer_tree_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,6 @@ void LayerTreeHost::BeginMainFrame(const viz::BeginFrameArgs& args) {
client_->BeginMainFrame(args);
}

void LayerTreeHost::DidStopFlinging() {
proxy_->MainThreadHasStoppedFlinging();
}

const LayerTreeDebugState& LayerTreeHost::GetDebugState() const {
return debug_state_;
}
Expand Down
4 changes: 0 additions & 4 deletions cc/trees/layer_tree_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,6 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
// the compositor thread.
const base::WeakPtr<InputHandler>& GetInputHandler() const;

// Informs the compositor that an active fling gesture being processed on the
// main thread has been finished.
void DidStopFlinging();

// Debugging and benchmarks ---------------------------------
void SetDebugState(const LayerTreeDebugState& debug_state);
const LayerTreeDebugState& GetDebugState() const;
Expand Down
20 changes: 0 additions & 20 deletions cc/trees/layer_tree_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1255,12 +1255,6 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) {
return draw_result;
}

void LayerTreeHostImpl::MainThreadHasStoppedFlinging() {
browser_controls_offset_manager_->MainThreadHasStoppedFlinging();
if (input_handler_client_)
input_handler_client_->MainThreadHasStoppedFlinging();
}

void LayerTreeHostImpl::DidAnimateScrollOffset() {
client_->SetNeedsCommitOnImplThread();
client_->RenewTreePriority();
Expand Down Expand Up @@ -4442,20 +4436,6 @@ void LayerTreeHostImpl::ScrollEnd(ScrollState* scroll_state, bool should_snap) {
ScrollEndImpl(scroll_state);
}

InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {
InputHandler::ScrollStatus scroll_status;
scroll_status.main_thread_scrolling_reasons =
MainThreadScrollingReason::kNotScrollingOnMain;
if (!CurrentlyScrollingNode()) {
scroll_status.thread = SCROLL_IGNORED;
scroll_status.main_thread_scrolling_reasons =
MainThreadScrollingReason::kNoScrollingLayer;
} else {
scroll_status.thread = SCROLL_ON_IMPL_THREAD;
}
return scroll_status;
}

void LayerTreeHostImpl::MouseDown() {
ScrollbarAnimationController* animation_controller =
ScrollbarAnimationControllerForElementId(
Expand Down
2 changes: 0 additions & 2 deletions cc/trees/layer_tree_host_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ class CC_EXPORT LayerTreeHostImpl
void SetSynchronousInputHandlerRootScrollOffset(
const gfx::ScrollOffset& root_offset) override;
void ScrollEnd(ScrollState* scroll_state, bool should_snap = false) override;
InputHandler::ScrollStatus FlingScrollBegin() override;

void MouseDown() override;
void MouseUp() override;
Expand Down Expand Up @@ -315,7 +314,6 @@ class CC_EXPORT LayerTreeHostImpl
void ActivateAnimations();
void Animate();
void AnimatePendingTreeAfterCommit();
void MainThreadHasStoppedFlinging();
void DidAnimateScrollOffset();
void SetFullViewportDamage();
void SetViewportDamage(const gfx::Rect& damage_rect);
Expand Down
Loading

0 comments on commit 4b723c9

Please sign in to comment.