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

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

Issue 1840883002: cc : Calculate jitter without using layer hierarchy (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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 gfx::ToCeiledPoint(expected_scroll_layer_impl->position() - 632 gfx::ToCeiledPoint(expected_scroll_layer_impl->position() -
633 gfx::Vector2dF(0.5f, 0.5f)); 633 gfx::Vector2dF(0.5f, 0.5f));
634 InputHandler::ScrollStatus status = impl->ScrollBegin( 634 InputHandler::ScrollStatus status = impl->ScrollBegin(
635 BeginState(scroll_point).get(), InputHandler::TOUCHSCREEN); 635 BeginState(scroll_point).get(), InputHandler::TOUCHSCREEN);
636 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread); 636 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, status.thread);
637 impl->ScrollBy(UpdateState(gfx::Point(), scroll_amount_).get()); 637 impl->ScrollBy(UpdateState(gfx::Point(), scroll_amount_).get());
638 LayerImpl* scrolling_layer = impl->CurrentlyScrollingLayer(); 638 LayerImpl* scrolling_layer = impl->CurrentlyScrollingLayer();
639 CHECK(scrolling_layer); 639 CHECK(scrolling_layer);
640 impl->ScrollEnd(EndState().get()); 640 impl->ScrollEnd(EndState().get());
641 CHECK(!impl->CurrentlyScrollingLayer()); 641 CHECK(!impl->CurrentlyScrollingLayer());
642 EXPECT_EQ(scrolling_layer->id(), 642 EXPECT_EQ(scrolling_layer->scroll_tree_index(),
643 impl->active_tree()->LastScrolledLayerId()); 643 impl->active_tree()->LastScrolledScrollNodeId());
644 644
645 // Check the scroll is applied as a delta. 645 // Check the scroll is applied as a delta.
646 EXPECT_VECTOR_EQ(initial_offset_, 646 EXPECT_VECTOR_EQ(initial_offset_,
647 ScrollTreeForLayer(expected_scroll_layer_impl) 647 ScrollTreeForLayer(expected_scroll_layer_impl)
648 ->GetScrollOffsetBaseForTesting( 648 ->GetScrollOffsetBaseForTesting(
649 expected_scroll_layer_impl->id())); 649 expected_scroll_layer_impl->id()));
650 EXPECT_VECTOR_EQ(scroll_amount_, 650 EXPECT_VECTOR_EQ(scroll_amount_,
651 ScrollDelta(expected_scroll_layer_impl)); 651 ScrollDelta(expected_scroll_layer_impl));
652 break; 652 break;
653 } 653 }
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 RunTest(CompositorMode::THREADED, false); 1424 RunTest(CompositorMode::THREADED, false);
1425 } 1425 }
1426 1426
1427 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { 1427 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) {
1428 scroll_destroy_whole_tree_ = true; 1428 scroll_destroy_whole_tree_ = true;
1429 RunTest(CompositorMode::THREADED, false); 1429 RunTest(CompositorMode::THREADED, false);
1430 } 1430 }
1431 1431
1432 } // namespace 1432 } // namespace
1433 } // namespace cc 1433 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698