| 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 <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 5286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5297 LayerImpl::Create(host_impl_->pending_tree(), 2); | 5297 LayerImpl::Create(host_impl_->pending_tree(), 2); |
| 5298 LayerImpl* scrolling_layer = scoped_scrolling_layer.get(); | 5298 LayerImpl* scrolling_layer = scoped_scrolling_layer.get(); |
| 5299 root->AddChild(scoped_scrolling_layer.Pass()); | 5299 root->AddChild(scoped_scrolling_layer.Pass()); |
| 5300 | 5300 |
| 5301 gfx::Size content_layer_bounds(100000, 100); | 5301 gfx::Size content_layer_bounds(100000, 100); |
| 5302 gfx::Size pile_tile_size(3000, 3000); | 5302 gfx::Size pile_tile_size(3000, 3000); |
| 5303 scoped_refptr<FakePicturePileImpl> pile(FakePicturePileImpl::CreateFilledPile( | 5303 scoped_refptr<FakePicturePileImpl> pile(FakePicturePileImpl::CreateFilledPile( |
| 5304 pile_tile_size, content_layer_bounds)); | 5304 pile_tile_size, content_layer_bounds)); |
| 5305 | 5305 |
| 5306 scoped_ptr<FakePictureLayerImpl> scoped_content_layer = | 5306 scoped_ptr<FakePictureLayerImpl> scoped_content_layer = |
| 5307 FakePictureLayerImpl::CreateWithPile(host_impl_->pending_tree(), 3, pile); | 5307 FakePictureLayerImpl::CreateWithPile(host_impl_->pending_tree(), 3, pile, |
| 5308 content_layer_bounds); |
| 5308 LayerImpl* content_layer = scoped_content_layer.get(); | 5309 LayerImpl* content_layer = scoped_content_layer.get(); |
| 5309 scrolling_layer->AddChild(scoped_content_layer.PassAs<LayerImpl>()); | 5310 scrolling_layer->AddChild(scoped_content_layer.PassAs<LayerImpl>()); |
| 5310 content_layer->SetBounds(content_layer_bounds); | 5311 content_layer->SetBounds(content_layer_bounds); |
| 5311 content_layer->SetDrawsContent(true); | 5312 content_layer->SetDrawsContent(true); |
| 5312 | 5313 |
| 5313 root->SetBounds(root_size); | 5314 root->SetBounds(root_size); |
| 5314 | 5315 |
| 5315 gfx::Vector2d scroll_offset(100000, 0); | 5316 gfx::Vector2d scroll_offset(100000, 0); |
| 5316 scrolling_layer->SetScrollClipLayer(root->id()); | 5317 scrolling_layer->SetScrollClipLayer(root->id()); |
| 5317 scrolling_layer->SetScrollOffset(scroll_offset); | 5318 scrolling_layer->SetScrollOffset(scroll_offset); |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6264 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, | 6265 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, |
| 6265 300u * 1024u * 1024u); | 6266 300u * 1024u * 1024u); |
| 6266 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, | 6267 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, |
| 6267 150u * 1024u * 1024u); | 6268 150u * 1024u * 1024u); |
| 6268 EXPECT_EQ(host_impl_->global_tile_state().unused_memory_limit_in_bytes, | 6269 EXPECT_EQ(host_impl_->global_tile_state().unused_memory_limit_in_bytes, |
| 6269 75u * 1024u * 1024u); | 6270 75u * 1024u * 1024u); |
| 6270 } | 6271 } |
| 6271 | 6272 |
| 6272 } // namespace | 6273 } // namespace |
| 6273 } // namespace cc | 6274 } // namespace cc |
| OLD | NEW |