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

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 2907053004: GSB uses delta_hints to calculate scrolling chain. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 10808 matching lines...) Expand 10 before | Expand all | Expand 10 after
10819 scrolling_layer->CurrentScrollOffset()); 10819 scrolling_layer->CurrentScrollOffset());
10820 EXPECT_EQ(nullptr, host_impl_->CurrentlyScrollingNode()); 10820 EXPECT_EQ(nullptr, host_impl_->CurrentlyScrollingNode());
10821 host_impl_->DidFinishImplFrame(); 10821 host_impl_->DidFinishImplFrame();
10822 } 10822 }
10823 10823
10824 TEST_F(LayerTreeHostImplTest, SecondScrollAnimatedBeginNotIgnored) { 10824 TEST_F(LayerTreeHostImplTest, SecondScrollAnimatedBeginNotIgnored) {
10825 const gfx::Size content_size(1000, 1000); 10825 const gfx::Size content_size(1000, 1000);
10826 const gfx::Size viewport_size(50, 100); 10826 const gfx::Size viewport_size(50, 100);
10827 CreateBasicVirtualViewportLayers(viewport_size, content_size); 10827 CreateBasicVirtualViewportLayers(viewport_size, content_size);
10828 10828
10829 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, 10829 EXPECT_EQ(
10830 host_impl_->ScrollAnimatedBegin(gfx::Point()).thread); 10830 InputHandler::SCROLL_ON_IMPL_THREAD,
10831 host_impl_->ScrollAnimatedBegin(BeginState(gfx::Point()).get()).thread);
10831 10832
10832 // The second ScrollAnimatedBegin should not get ignored. 10833 // The second ScrollAnimatedBegin should not get ignored.
10833 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, 10834 EXPECT_EQ(
10834 host_impl_->ScrollAnimatedBegin(gfx::Point()).thread); 10835 InputHandler::SCROLL_ON_IMPL_THREAD,
10836 host_impl_->ScrollAnimatedBegin(BeginState(gfx::Point()).get()).thread);
10835 } 10837 }
10836 10838
10837 // Verfify that a smooth scroll animation doesn't jump when UpdateTarget gets 10839 // Verfify that a smooth scroll animation doesn't jump when UpdateTarget gets
10838 // called before the animation is started. 10840 // called before the animation is started.
10839 TEST_F(LayerTreeHostImplTest, AnimatedScrollUpdateTargetBeforeStarting) { 10841 TEST_F(LayerTreeHostImplTest, AnimatedScrollUpdateTargetBeforeStarting) {
10840 const gfx::Size content_size(1000, 1000); 10842 const gfx::Size content_size(1000, 1000);
10841 const gfx::Size viewport_size(50, 100); 10843 const gfx::Size viewport_size(50, 100);
10842 CreateBasicVirtualViewportLayers(viewport_size, content_size); 10844 CreateBasicVirtualViewportLayers(viewport_size, content_size);
10843 10845
10844 DrawFrame(); 10846 DrawFrame();
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after
12540 // layer should be prioritized over the hidden layer. 12542 // layer should be prioritized over the hidden layer.
12541 hidden_layer->set_contributes_to_drawn_render_surface(false); 12543 hidden_layer->set_contributes_to_drawn_render_surface(false);
12542 hidden_layer->set_raster_even_if_not_drawn(true); 12544 hidden_layer->set_raster_even_if_not_drawn(true);
12543 queue = host_impl_->BuildRasterQueue(TreePriority::SMOOTHNESS_TAKES_PRIORITY, 12545 queue = host_impl_->BuildRasterQueue(TreePriority::SMOOTHNESS_TAKES_PRIORITY,
12544 RasterTilePriorityQueue::Type::ALL); 12546 RasterTilePriorityQueue::Type::ALL);
12545 EXPECT_EQ(queue->Top().tile()->layer_id(), 3); 12547 EXPECT_EQ(queue->Top().tile()->layer_id(), 3);
12546 } 12548 }
12547 12549
12548 } // namespace 12550 } // namespace
12549 } // namespace cc 12551 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698