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

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

Issue 367833003: cc: Start using raster/eviction iterators. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: perf test fix 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 6748 matching lines...) Expand 10 before | Expand all | Expand 10 after
6759 float y = scrolling_layer->TotalScrollOffset().y(); 6759 float y = scrolling_layer->TotalScrollOffset().y();
6760 EXPECT_TRUE(y > 1 && y < 49); 6760 EXPECT_TRUE(y > 1 && y < 49);
6761 6761
6762 host_impl_->Animate(start_time + base::TimeDelta::FromMilliseconds(200)); 6762 host_impl_->Animate(start_time + base::TimeDelta::FromMilliseconds(200));
6763 host_impl_->UpdateAnimationState(true); 6763 host_impl_->UpdateAnimationState(true);
6764 6764
6765 EXPECT_EQ(gfx::Vector2dF(0, 50), scrolling_layer->TotalScrollOffset()); 6765 EXPECT_EQ(gfx::Vector2dF(0, 50), scrolling_layer->TotalScrollOffset());
6766 EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer()); 6766 EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer());
6767 } 6767 }
6768 6768
6769 TEST_F(LayerTreeHostImplTest, PairedPictureLayers) {
6770 host_impl_->CreatePendingTree();
6771 host_impl_->ActivateSyncTree();
6772 host_impl_->CreatePendingTree();
6773
6774 LayerTreeImpl* active_tree = host_impl_->active_tree();
6775 LayerTreeImpl* pending_tree = host_impl_->pending_tree();
6776 EXPECT_NE(active_tree, pending_tree);
6777
6778 scoped_ptr<FakePictureLayerImpl> active_layer =
6779 FakePictureLayerImpl::Create(active_tree, 10);
6780 scoped_ptr<FakePictureLayerImpl> pending_layer =
6781 FakePictureLayerImpl::Create(pending_tree, 10);
6782
6783 std::vector<PairedPictureLayer> paired_layers;
6784 host_impl_->GetPairedPictureLayers(&paired_layers);
6785
6786 EXPECT_EQ(2u, paired_layers.size());
6787 if (paired_layers[0].active_layer) {
6788 EXPECT_EQ(active_layer.get(), paired_layers[0].active_layer);
6789 EXPECT_EQ(NULL, paired_layers[0].pending_layer);
6790 } else {
6791 EXPECT_EQ(pending_layer.get(), paired_layers[0].pending_layer);
6792 EXPECT_EQ(NULL, paired_layers[0].active_layer);
6793 }
6794
6795 if (paired_layers[1].active_layer) {
6796 EXPECT_EQ(active_layer.get(), paired_layers[1].active_layer);
6797 EXPECT_EQ(NULL, paired_layers[1].pending_layer);
6798 } else {
6799 EXPECT_EQ(pending_layer.get(), paired_layers[1].pending_layer);
6800 EXPECT_EQ(NULL, paired_layers[1].active_layer);
6801 }
6802
6803 active_layer->set_twin_layer(pending_layer.get());
6804 pending_layer->set_twin_layer(active_layer.get());
6805
6806 host_impl_->GetPairedPictureLayers(&paired_layers);
6807 EXPECT_EQ(1u, paired_layers.size());
6808
6809 EXPECT_EQ(active_layer.get(), paired_layers[0].active_layer);
6810 EXPECT_EQ(pending_layer.get(), paired_layers[0].pending_layer);
6811 }
6812
6769 } // namespace 6813 } // namespace
6770 } // namespace cc 6814 } // namespace cc
OLDNEW
« cc/resources/tile_priority_queue.h ('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