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

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

Issue 406543003: cc: Change TileManager iterators to be queues. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 6681 matching lines...) Expand 10 before | Expand all | Expand 10 after
6692 float y = scrolling_layer->TotalScrollOffset().y(); 6692 float y = scrolling_layer->TotalScrollOffset().y();
6693 EXPECT_TRUE(y > 1 && y < 49); 6693 EXPECT_TRUE(y > 1 && y < 49);
6694 6694
6695 host_impl_->Animate(start_time + base::TimeDelta::FromMilliseconds(200)); 6695 host_impl_->Animate(start_time + base::TimeDelta::FromMilliseconds(200));
6696 host_impl_->UpdateAnimationState(true); 6696 host_impl_->UpdateAnimationState(true);
6697 6697
6698 EXPECT_EQ(gfx::Vector2dF(0, 50), scrolling_layer->TotalScrollOffset()); 6698 EXPECT_EQ(gfx::Vector2dF(0, 50), scrolling_layer->TotalScrollOffset());
6699 EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer()); 6699 EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer());
6700 } 6700 }
6701 6701
6702 TEST_F(LayerTreeHostImplTest, PairedPictureLayers) {
6703 host_impl_->CreatePendingTree();
6704 host_impl_->ActivateSyncTree();
6705 host_impl_->CreatePendingTree();
6706
6707 LayerTreeImpl* active_tree = host_impl_->active_tree();
6708 LayerTreeImpl* pending_tree = host_impl_->pending_tree();
6709 EXPECT_NE(active_tree, pending_tree);
6710
6711 scoped_ptr<FakePictureLayerImpl> active_layer =
6712 FakePictureLayerImpl::Create(active_tree, 10);
6713 scoped_ptr<FakePictureLayerImpl> pending_layer =
6714 FakePictureLayerImpl::Create(pending_tree, 10);
6715
6716 std::vector<PairedPictureLayer> paired_layers;
6717 host_impl_->GetPairedPictureLayers(&paired_layers);
6718
6719 EXPECT_EQ(2u, paired_layers.size());
6720 if (paired_layers[0].active_layer) {
6721 EXPECT_EQ(active_layer.get(), paired_layers[0].active_layer);
6722 EXPECT_EQ(NULL, paired_layers[0].pending_layer);
6723 } else {
6724 EXPECT_EQ(pending_layer.get(), paired_layers[0].pending_layer);
6725 EXPECT_EQ(NULL, paired_layers[0].active_layer);
6726 }
6727
6728 if (paired_layers[1].active_layer) {
6729 EXPECT_EQ(active_layer.get(), paired_layers[1].active_layer);
6730 EXPECT_EQ(NULL, paired_layers[1].pending_layer);
6731 } else {
6732 EXPECT_EQ(pending_layer.get(), paired_layers[1].pending_layer);
6733 EXPECT_EQ(NULL, paired_layers[1].active_layer);
6734 }
6735
6736 active_layer->set_twin_layer(pending_layer.get());
6737 pending_layer->set_twin_layer(active_layer.get());
6738
6739 host_impl_->GetPairedPictureLayers(&paired_layers);
6740 EXPECT_EQ(1u, paired_layers.size());
6741
6742 EXPECT_EQ(active_layer.get(), paired_layers[0].active_layer);
6743 EXPECT_EQ(pending_layer.get(), paired_layers[0].pending_layer);
6744 }
6745
6702 } // namespace 6746 } // namespace
6703 } // namespace cc 6747 } // namespace cc
OLDNEW
« cc/resources/tile_manager_perftest.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698