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

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

Issue 2144303002: Made layout viewport scroll updates from compositor work like ordinary layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rootScrollerOnCompositor
Patch Set: Initialize ScrollUpdateInfo's layer id in constructor Created 4 years, 5 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
« no previous file with comments | « cc/trees/property_tree.cc ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/tree_synchronizer.h" 5 #include "cc/trees/tree_synchronizer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 // Set ScrollOffset active delta: gfx::ScrollOffset(10, 10) 620 // Set ScrollOffset active delta: gfx::ScrollOffset(10, 10)
621 LayerImpl* scroll_layer_impl = 621 LayerImpl* scroll_layer_impl =
622 host_impl->active_tree()->LayerById(scroll_layer->id()); 622 host_impl->active_tree()->LayerById(scroll_layer->id());
623 ScrollTree& scroll_tree = 623 ScrollTree& scroll_tree =
624 host_impl->active_tree()->property_trees()->scroll_tree; 624 host_impl->active_tree()->property_trees()->scroll_tree;
625 scroll_tree.SetScrollOffset(scroll_layer_impl->id(), 625 scroll_tree.SetScrollOffset(scroll_layer_impl->id(),
626 gfx::ScrollOffset(20, 30)); 626 gfx::ScrollOffset(20, 30));
627 627
628 // Pull ScrollOffset delta for main thread, and change offset on main thread 628 // Pull ScrollOffset delta for main thread, and change offset on main thread
629 std::unique_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); 629 std::unique_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
630 scroll_tree.CollectScrollDeltas(scroll_info.get()); 630 scroll_tree.CollectScrollDeltas(scroll_info.get(), Layer::INVALID_ID);
631 host_->proxy()->SetNeedsCommit(); 631 host_->proxy()->SetNeedsCommit();
632 host_->ApplyScrollAndScale(scroll_info.get()); 632 host_->ApplyScrollAndScale(scroll_info.get());
633 EXPECT_EQ(gfx::ScrollOffset(20, 30), scroll_layer->scroll_offset()); 633 EXPECT_EQ(gfx::ScrollOffset(20, 30), scroll_layer->scroll_offset());
634 scroll_layer->SetScrollOffset(gfx::ScrollOffset(100, 100)); 634 scroll_layer->SetScrollOffset(gfx::ScrollOffset(100, 100));
635 635
636 // More update to ScrollOffset active delta: gfx::ScrollOffset(20, 20) 636 // More update to ScrollOffset active delta: gfx::ScrollOffset(20, 20)
637 scroll_tree.SetScrollOffset(scroll_layer_impl->id(), 637 scroll_tree.SetScrollOffset(scroll_layer_impl->id(),
638 gfx::ScrollOffset(40, 50)); 638 gfx::ScrollOffset(40, 50));
639 host_impl->active_tree()->SetCurrentlyScrollingLayer(scroll_layer_impl); 639 host_impl->active_tree()->SetCurrentlyScrollingLayer(scroll_layer_impl);
640 640
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 host_->CommitAndCreatePendingTree(); 699 host_->CommitAndCreatePendingTree();
700 host_impl->ActivateSyncTree(); 700 host_impl->ActivateSyncTree();
701 EXPECT_EQ( 701 EXPECT_EQ(
702 CombinedAnimationScale(0.f, 0.f), 702 CombinedAnimationScale(0.f, 0.f),
703 host_impl->active_tree()->property_trees()->GetAnimationScales( 703 host_impl->active_tree()->property_trees()->GetAnimationScales(
704 transform_layer->transform_tree_index(), host_impl->active_tree())); 704 transform_layer->transform_tree_index(), host_impl->active_tree()));
705 } 705 }
706 706
707 } // namespace 707 } // namespace
708 } // namespace cc 708 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree.cc ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698