| 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 6162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6173 LayerImpl* scrolling_layer = scoped_scrolling_layer.get(); | 6173 LayerImpl* scrolling_layer = scoped_scrolling_layer.get(); |
| 6174 root->AddChild(scoped_scrolling_layer.Pass()); | 6174 root->AddChild(scoped_scrolling_layer.Pass()); |
| 6175 | 6175 |
| 6176 gfx::Size content_layer_bounds(100000, 100); | 6176 gfx::Size content_layer_bounds(100000, 100); |
| 6177 gfx::Size pile_tile_size(3000, 3000); | 6177 gfx::Size pile_tile_size(3000, 3000); |
| 6178 scoped_refptr<FakePicturePileImpl> pile(FakePicturePileImpl::CreateFilledPile( | 6178 scoped_refptr<FakePicturePileImpl> pile(FakePicturePileImpl::CreateFilledPile( |
| 6179 pile_tile_size, content_layer_bounds)); | 6179 pile_tile_size, content_layer_bounds)); |
| 6180 | 6180 |
| 6181 scoped_ptr<FakePictureLayerImpl> scoped_content_layer = | 6181 scoped_ptr<FakePictureLayerImpl> scoped_content_layer = |
| 6182 FakePictureLayerImpl::CreateWithRasterSource(host_impl_->pending_tree(), | 6182 FakePictureLayerImpl::CreateWithRasterSource(host_impl_->pending_tree(), |
| 6183 3, pile); | 6183 3, pile, false); |
| 6184 LayerImpl* content_layer = scoped_content_layer.get(); | 6184 LayerImpl* content_layer = scoped_content_layer.get(); |
| 6185 scrolling_layer->AddChild(scoped_content_layer.Pass()); | 6185 scrolling_layer->AddChild(scoped_content_layer.Pass()); |
| 6186 content_layer->SetBounds(content_layer_bounds); | 6186 content_layer->SetBounds(content_layer_bounds); |
| 6187 content_layer->SetDrawsContent(true); | 6187 content_layer->SetDrawsContent(true); |
| 6188 | 6188 |
| 6189 root->SetBounds(root_size); | 6189 root->SetBounds(root_size); |
| 6190 | 6190 |
| 6191 gfx::ScrollOffset scroll_offset(100000, 0); | 6191 gfx::ScrollOffset scroll_offset(100000, 0); |
| 6192 scrolling_layer->SetScrollClipLayer(root->id()); | 6192 scrolling_layer->SetScrollClipLayer(root->id()); |
| 6193 scrolling_layer->SetScrollOffset(scroll_offset); | 6193 scrolling_layer->SetScrollOffset(scroll_offset); |
| (...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7842 // surface. | 7842 // surface. |
| 7843 EXPECT_EQ(0, num_lost_surfaces_); | 7843 EXPECT_EQ(0, num_lost_surfaces_); |
| 7844 host_impl_->DidLoseOutputSurface(); | 7844 host_impl_->DidLoseOutputSurface(); |
| 7845 EXPECT_EQ(1, num_lost_surfaces_); | 7845 EXPECT_EQ(1, num_lost_surfaces_); |
| 7846 host_impl_->DidLoseOutputSurface(); | 7846 host_impl_->DidLoseOutputSurface(); |
| 7847 EXPECT_LE(1, num_lost_surfaces_); | 7847 EXPECT_LE(1, num_lost_surfaces_); |
| 7848 } | 7848 } |
| 7849 | 7849 |
| 7850 } // namespace | 7850 } // namespace |
| 7851 } // namespace cc | 7851 } // namespace cc |
| OLD | NEW |