diff options
author | yusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 08:00:31 +0000 |
---|---|---|
committer | yusufo@chromium.org <yusufo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-08 08:00:31 +0000 |
commit | df8f44f9d8203f927f2ed4f0b349e1bb7119fcf2 (patch) | |
tree | 909979afe467bb16db99cbeaae5f1a77f47f8256 /cc | |
parent | 7a8f55904af01c4233d82f8198562691013d8029 (diff) | |
download | chromium_src-df8f44f9d8203f927f2ed4f0b349e1bb7119fcf2.zip chromium_src-df8f44f9d8203f927f2ed4f0b349e1bb7119fcf2.tar.gz chromium_src-df8f44f9d8203f927f2ed4f0b349e1bb7119fcf2.tar.bz2 |
Ensure that render surface layer list is not dirty/empty before hit testing for touch events
BUG=167135
Review URL: https://chromiumcodereview.appspot.com/11776033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/layer_tree_host_impl.cc | 2 | ||||
-rw-r--r-- | cc/layer_tree_host_impl_unittest.cc | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc index 3c22180..9d42698 100644 --- a/cc/layer_tree_host_impl.cc +++ b/cc/layer_tree_host_impl.cc @@ -376,6 +376,8 @@ void LayerTreeHostImpl::scheduleAnimation() bool LayerTreeHostImpl::haveTouchEventHandlersAt(const gfx::Point& viewportPoint) { + if (!ensureRenderSurfaceLayerList()) + return false; gfx::PointF deviceViewportPoint = gfx::ScalePoint(viewportPoint, m_deviceScaleFactor); diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc index 6ceeb23..4bc8be7 100644 --- a/cc/layer_tree_host_impl_unittest.cc +++ b/cc/layer_tree_host_impl_unittest.cc @@ -550,6 +550,20 @@ TEST_P(LayerTreeHostImplTest, maxScrollOffsetChangedByDeviceScaleFactor) EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollOffset(), gfx::Vector2d(75, 75)); } +TEST_P(LayerTreeHostImplTest, clearRootRenderSurfaceAndHitTestTouchHandlerRegion) +{ + setupScrollAndContentsLayers(gfx::Size(100, 100)); + m_hostImpl->setViewportSize(gfx::Size(50, 50), gfx::Size(50, 50)); + initializeRendererAndDrawFrame(); + + // We should be able to hit test for touch event handlers even if the root layer loses + // its render surface after the most recent render. + m_hostImpl->rootLayer()->clearRenderSurface(); + m_hostImpl->setNeedsUpdateDrawProperties(); + + EXPECT_EQ(m_hostImpl->haveTouchEventHandlersAt(gfx::Point(0, 0)), false); +} + TEST_P(LayerTreeHostImplTest, implPinchZoom) { // This test is specific to the page-scale based pinch zoom. |