summaryrefslogtreecommitdiffstats
path: root/cc/layer_tree_host_impl_unittest.cc
diff options
context:
space:
mode:
authorskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-04 22:47:10 +0000
committerskyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-04 22:47:10 +0000
commit1ca52a3ad58d6f7bfc3a12922491ae7908c97a02 (patch)
treeed34d980e30b3c4a0d3485d1281102f2de800d1d /cc/layer_tree_host_impl_unittest.cc
parent981bab2ab6ee2483b4b6cf57dc4bad132dd9fa20 (diff)
downloadchromium_src-1ca52a3ad58d6f7bfc3a12922491ae7908c97a02.zip
chromium_src-1ca52a3ad58d6f7bfc3a12922491ae7908c97a02.tar.gz
chromium_src-1ca52a3ad58d6f7bfc3a12922491ae7908c97a02.tar.bz2
cc: Always commit and redraw after scrolling
During the move from WebKit::IntSize to gfx::Vector2d in the compositor code an IntSize::isEmpty() got accidentally replaced with Vector2d::IsZero() in LayerTreeHostImpl::scrollBy(). This caused cases where we'd change the position of a layer during scrolling but didn't schedule a commit or a redraw. This happened for instance when diagonally scrolling a layer against its edge. This patch fixes the issue by always requesting a commit/redraw if any layer was moved while applying the scroll delta. TEST=LayerTreeHostImplTest.scrollByReturnsCorrectValue Review URL: https://chromiumcodereview.appspot.com/11348381 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layer_tree_host_impl_unittest.cc')
-rw-r--r--cc/layer_tree_host_impl_unittest.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index b13b2a9..ececd8b 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -518,6 +518,11 @@ TEST_P(LayerTreeHostImplTest, scrollByReturnsCorrectValue)
EXPECT_TRUE(m_hostImpl->scrollBy(gfx::Point(), gfx::Vector2d(0, -10)));
EXPECT_TRUE(m_hostImpl->scrollBy(gfx::Point(), gfx::Vector2d(-10, -10)));
+ // Scrolling diagonally against an edge will succeed.
+ EXPECT_TRUE(m_hostImpl->scrollBy(gfx::Point(), gfx::Vector2d(10, -10)));
+ EXPECT_TRUE(m_hostImpl->scrollBy(gfx::Point(), gfx::Vector2d(-10, 0)));
+ EXPECT_TRUE(m_hostImpl->scrollBy(gfx::Point(), gfx::Vector2d(-10, 10)));
+
// Trying to scroll more than the available space will also succeed.
EXPECT_TRUE(m_hostImpl->scrollBy(gfx::Point(), gfx::Vector2d(5000, 5000)));
}