Commit 7905378b authored by Kevin McNee's avatar Kevin McNee Committed by Commit Bot

DCHECK InnerViewportScrollNode in page scale snap-to-min.

Now that we no longer send gesture pinch events to OOPIF renderers,
we can remove the check for the InnerViewportScrollNode before the
snap-to-min page scale animation and have it be a DCHECK instead.

Bug: 787924, 791885
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I834a40ed6df46fa48abb3662a0331cc7bc1365c0
Reviewed-on: https://chromium-review.googlesource.com/1087399
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567088}
parent ec5e4c66
......@@ -807,7 +807,7 @@ TEST_F(PictureLayerImplTest, PinchGestureTilings) {
EXPECT_NE(LOW_RESOLUTION, low_res_tiling->resolution());
// Stop a pinch gesture.
host_impl()->PinchGestureEnd(gfx::Point(), true);
host_impl()->PinchGestureEnd(gfx::Point(), false);
// Ensure UpdateTiles won't remove any tilings.
active_layer()->MarkAllTilingsUsed();
......@@ -937,7 +937,7 @@ TEST_F(PictureLayerImplTest, CleanUpTilings) {
1.f * low_res_factor,
active_layer()->tilings()->tiling_at(1)->contents_scale_key());
host_impl()->PinchGestureEnd(gfx::Point(), true);
host_impl()->PinchGestureEnd(gfx::Point(), false);
// Create a 1.2 scale tiling. Now we have 1.0 and 1.2 tilings. Ideal = 1.2.
scale = 1.2f;
......@@ -3768,7 +3768,7 @@ TEST_F(NoLowResPictureLayerImplTest, CleanUpTilings) {
active_layer()->CleanUpTilingsOnActiveLayer(used_tilings);
ASSERT_EQ(1u, active_layer()->tilings()->num_tilings());
host_impl()->PinchGestureEnd(gfx::Point(), true);
host_impl()->PinchGestureEnd(gfx::Point(), false);
// Create a 1.2 scale tiling. Now we have 1.0 and 1.2 tilings. Ideal = 1.2.
scale /= 4.f;
......
......@@ -201,13 +201,9 @@ void Viewport::PinchUpdate(float magnify_delta, const gfx::Point& anchor) {
}
void Viewport::PinchEnd(const gfx::Point& anchor, bool snap_to_min) {
LayerTreeImpl* active_tree = host_impl_->active_tree();
// TODO(mcnee): Remove the InnerViewportScrollNode() check (and add a
// DCHECK instead), after we no longer send GesturePinch events to
// OOPIF renderers. https://crbug.com/787924
// Snap-to-min only makes sense for mainframes, so we use the lack of an
// InnerViewportScrollNode() to detect if this is an OOPIF.
if (snap_to_min && active_tree->InnerViewportScrollNode()) {
if (snap_to_min) {
LayerTreeImpl* active_tree = host_impl_->active_tree();
DCHECK(active_tree->InnerViewportScrollNode());
const float kMaxZoomForSnapToMin = 1.05f;
const base::TimeDelta kSnapToMinZoomAnimationDuration =
base::TimeDelta::FromMilliseconds(200);
......
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