| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 7776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7787 host_impl_->Animate(start_time + base::TimeDelta::FromMilliseconds(250)); | 7787 host_impl_->Animate(start_time + base::TimeDelta::FromMilliseconds(250)); |
| 7788 host_impl_->UpdateAnimationState(true); | 7788 host_impl_->UpdateAnimationState(true); |
| 7789 | 7789 |
| 7790 EXPECT_VECTOR_EQ(gfx::ScrollOffset(0, 100), | 7790 EXPECT_VECTOR_EQ(gfx::ScrollOffset(0, 100), |
| 7791 scrolling_layer->TotalScrollOffset()); | 7791 scrolling_layer->TotalScrollOffset()); |
| 7792 EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer()); | 7792 EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer()); |
| 7793 } | 7793 } |
| 7794 | 7794 |
| 7795 TEST_F(LayerTreeHostImplTest, GetPictureLayerImplPairs) { | 7795 TEST_F(LayerTreeHostImplTest, GetPictureLayerImplPairs) { |
| 7796 host_impl_->CreatePendingTree(); | 7796 host_impl_->CreatePendingTree(); |
| 7797 host_impl_->pending_tree()->SetRootLayer( | 7797 |
| 7798 PictureLayerImpl::Create(host_impl_->pending_tree(), 10, false)); | 7798 scoped_ptr<PictureLayerImpl> layer = |
| 7799 PictureLayerImpl::Create(host_impl_->pending_tree(), 10, false); |
| 7800 layer->SetBounds(gfx::Size(10, 10)); |
| 7801 |
| 7802 scoped_refptr<RasterSource> pile(FakePicturePileImpl::CreateEmptyPile( |
| 7803 gfx::Size(10, 10), gfx::Size(10, 10))); |
| 7804 Region empty_invalidation; |
| 7805 const PictureLayerTilingSet* null_tiling_set = nullptr; |
| 7806 layer->UpdateRasterSource(pile, &empty_invalidation, null_tiling_set); |
| 7807 |
| 7808 host_impl_->pending_tree()->SetRootLayer(layer.Pass()); |
| 7799 | 7809 |
| 7800 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); | 7810 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); |
| 7801 LayerImpl* pending_layer = pending_tree->root_layer(); | 7811 LayerImpl* pending_layer = pending_tree->root_layer(); |
| 7802 | 7812 |
| 7803 std::vector<PictureLayerImpl::Pair> layer_pairs; | 7813 std::vector<PictureLayerImpl::Pair> layer_pairs; |
| 7804 host_impl_->GetPictureLayerImplPairs(&layer_pairs, true); | 7814 host_impl_->GetPictureLayerImplPairs(&layer_pairs, true); |
| 7805 EXPECT_EQ(1u, layer_pairs.size()); | 7815 EXPECT_EQ(1u, layer_pairs.size()); |
| 7806 EXPECT_EQ(pending_layer, layer_pairs[0].pending); | 7816 EXPECT_EQ(pending_layer, layer_pairs[0].pending); |
| 7807 EXPECT_EQ(nullptr, layer_pairs[0].active); | 7817 EXPECT_EQ(nullptr, layer_pairs[0].active); |
| 7808 | 7818 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7955 // surface. | 7965 // surface. |
| 7956 EXPECT_EQ(0, num_lost_surfaces_); | 7966 EXPECT_EQ(0, num_lost_surfaces_); |
| 7957 host_impl_->DidLoseOutputSurface(); | 7967 host_impl_->DidLoseOutputSurface(); |
| 7958 EXPECT_EQ(1, num_lost_surfaces_); | 7968 EXPECT_EQ(1, num_lost_surfaces_); |
| 7959 host_impl_->DidLoseOutputSurface(); | 7969 host_impl_->DidLoseOutputSurface(); |
| 7960 EXPECT_LE(1, num_lost_surfaces_); | 7970 EXPECT_LE(1, num_lost_surfaces_); |
| 7961 } | 7971 } |
| 7962 | 7972 |
| 7963 } // namespace | 7973 } // namespace |
| 7964 } // namespace cc | 7974 } // namespace cc |
| OLD | NEW |