Commit fb306d26 authored by Mohsen Izadi's avatar Mohsen Izadi Committed by Commit Bot

Move gesture nav arrow to its own layer

Currently, gesture nav affordance uses a single layer that paints
everything in each frame. This CL moves the arrow to its own layer which
is drawn once and then appropriate transform and opacity are applied on
it. This is needed for implementing pull-to-refresh which needs the
arrow be rotated. Also, generally we want to decompose the affordance
into a few layers to avoid painting it on each frame.

BUG=702404,743239
TEST=none

Change-Id: I9140471d6b6edbbb84f97fd5148994fea58e5a90
Reviewed-on: https://chromium-review.googlesource.com/594840Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Mohsen Izadi <mohsen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491261}
parent bc492818
...@@ -27,9 +27,6 @@ class GestureNavSimple : public OverscrollControllerDelegate { ...@@ -27,9 +27,6 @@ class GestureNavSimple : public OverscrollControllerDelegate {
void OnAffordanceAnimationEnded(); void OnAffordanceAnimationEnded();
private: private:
void AbortGestureAnimation();
void CompleteGestureAnimation();
// OverscrollControllerDelegate: // OverscrollControllerDelegate:
gfx::Size GetDisplaySize() const override; gfx::Size GetDisplaySize() const override;
bool OnOverscrollUpdate(float delta_x, float delta_y) override; bool OnOverscrollUpdate(float delta_x, float delta_y) override;
...@@ -39,14 +36,14 @@ class GestureNavSimple : public OverscrollControllerDelegate { ...@@ -39,14 +36,14 @@ class GestureNavSimple : public OverscrollControllerDelegate {
OverscrollSource source) override; OverscrollSource source) override;
base::Optional<float> GetMaxOverscrollDelta() const override; base::Optional<float> GetMaxOverscrollDelta() const override;
WebContentsImpl* web_contents_; WebContentsImpl* web_contents_ = nullptr;
std::unique_ptr<Affordance> affordance_; std::unique_ptr<Affordance> affordance_;
float completion_threshold_; float completion_threshold_ = 0.f;
OverscrollSource source_ = OverscrollSource::NONE; OverscrollSource source_ = OverscrollSource::NONE;
// When an overscroll is active, represents the maximum overscroll delta we // When an overscroll is active, represents the maximum overscroll delta we
// expect in OnOverscrollUpdate(). // expect in OnOverscrollUpdate().
float max_delta_; float max_delta_ = 0.f;
DISALLOW_COPY_AND_ASSIGN(GestureNavSimple); DISALLOW_COPY_AND_ASSIGN(GestureNavSimple);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment