Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Unified Diff: cc/layers/viewport.h

Issue 1866583002: Connect LTHI::ScrollAnimated to cc::Viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/layers/viewport.h
diff --git a/cc/layers/viewport.h b/cc/layers/viewport.h
index 5052b5e2499e1480050257b299282cfb96f092df..6e13e9e948d6df95f631b8f852ce2fc8426c57d7 100644
--- a/cc/layers/viewport.h
+++ b/cc/layers/viewport.h
@@ -5,6 +5,7 @@
#ifndef CC_LAYERS_VIEWPORT_H_
#define CC_LAYERS_VIEWPORT_H_
+#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "cc/layers/layer_impl.h"
@@ -46,12 +47,19 @@ class CC_EXPORT Viewport {
bool is_wheel_scroll,
bool affect_top_controls);
+ // Scrolls the viewport, bubbling the delta between the inner and outer
+ // viewport. Only animates either of the two viewports.
+ gfx::Vector2dF ScrollAnimated(const gfx::Vector2dF& delta);
+
void PinchUpdate(float magnify_delta, const gfx::Point& anchor);
void PinchEnd();
private:
explicit Viewport(LayerTreeHostImpl* host_impl);
+ // Returns true if viewport_delta is stricly less than pendinf_delta.
bokan 2016/04/06 13:35:52 Nit: s/pendinf_delta/pending_delta
ymalik 2016/04/06 15:33:45 Done.
+ static bool ShouldAnimateViewport(const gfx::Vector2dF& viewport_delta,
+ const gfx::Vector2dF& pending_delta);
bool ShouldTopControlsConsumeScroll(const gfx::Vector2dF& scroll_delta) const;
gfx::Vector2dF AdjustOverscroll(const gfx::Vector2dF& delta) const;
@@ -74,6 +82,8 @@ class CC_EXPORT Viewport {
// is used to "snap" a pinch-zoom to the edge of the screen.
gfx::Vector2d pinch_anchor_adjustment_;
+ FRIEND_TEST_ALL_PREFIXES(ViewportTest, ShouldAnimateViewport);
+
DISALLOW_COPY_AND_ASSIGN(Viewport);
};
« no previous file with comments | « cc/input/input_handler.h ('k') | cc/layers/viewport.cc » ('j') | cc/layers/viewport.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698