| 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 6097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6108 LayerImpl* scroll_layer = | 6108 LayerImpl* scroll_layer = |
| 6109 host_impl_->active_tree()->LayerById(scroll_layer_id); | 6109 host_impl_->active_tree()->LayerById(scroll_layer_id); |
| 6110 scroll_layer->SetDrawsContent(true); | 6110 scroll_layer->SetDrawsContent(true); |
| 6111 | 6111 |
| 6112 int occluder_layer_id = 6; | 6112 int occluder_layer_id = 6; |
| 6113 scoped_ptr<LayerImpl> occluder_layer = | 6113 scoped_ptr<LayerImpl> occluder_layer = |
| 6114 LayerImpl::Create(host_impl_->active_tree(), occluder_layer_id); | 6114 LayerImpl::Create(host_impl_->active_tree(), occluder_layer_id); |
| 6115 occluder_layer->SetDrawsContent(true); | 6115 occluder_layer->SetDrawsContent(true); |
| 6116 occluder_layer->SetBounds(content_size); | 6116 occluder_layer->SetBounds(content_size); |
| 6117 occluder_layer->SetContentBounds(content_size); | 6117 occluder_layer->SetContentBounds(content_size); |
| 6118 occluder_layer->SetPosition(gfx::PointF()); | 6118 occluder_layer->SetPosition(gfx::PointF(-10.f, -10.f)); |
| 6119 occluder_layer->SetAnchorPoint(gfx::PointF()); | 6119 occluder_layer->SetAnchorPoint(gfx::PointF()); |
| 6120 | 6120 |
| 6121 int child_scroll_clip_layer_id = 7; | 6121 int child_scroll_clip_layer_id = 7; |
| 6122 scoped_ptr<LayerImpl> child_scroll_clip = | 6122 scoped_ptr<LayerImpl> child_scroll_clip = |
| 6123 LayerImpl::Create(host_impl_->active_tree(), child_scroll_clip_layer_id); | 6123 LayerImpl::Create(host_impl_->active_tree(), child_scroll_clip_layer_id); |
| 6124 | 6124 |
| 6125 int child_scroll_layer_id = 8; | 6125 int child_scroll_layer_id = 8; |
| 6126 scoped_ptr<LayerImpl> child_scroll = CreateScrollableLayer( | 6126 scoped_ptr<LayerImpl> child_scroll = CreateScrollableLayer( |
| 6127 child_scroll_layer_id, content_size, child_scroll_clip.get()); | 6127 child_scroll_layer_id, content_size, child_scroll_clip.get()); |
| 6128 | 6128 |
| 6129 child_scroll->SetDrawsContent(false); | 6129 child_scroll->SetPosition(gfx::PointF(10.f, 10.f)); |
| 6130 | 6130 |
| 6131 child_scroll->AddChild(occluder_layer.Pass()); | 6131 child_scroll->AddChild(occluder_layer.Pass()); |
| 6132 scroll_layer->AddChild(child_scroll.Pass()); | 6132 scroll_layer->AddChild(child_scroll.Pass()); |
| 6133 | 6133 |
| 6134 DrawFrame(); | 6134 DrawFrame(); |
| 6135 | 6135 |
| 6136 EXPECT_EQ(InputHandler::ScrollUnknown, | 6136 EXPECT_EQ(InputHandler::ScrollUnknown, |
| 6137 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel)); | 6137 host_impl_->ScrollBegin(gfx::Point(), InputHandler::Wheel)); |
| 6138 } | 6138 } |
| 6139 | 6139 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6463 // Verify implicit limits are calculated correctly with no overflows | 6463 // Verify implicit limits are calculated correctly with no overflows |
| 6464 host_impl_->SetMemoryPolicy(mem_policy); | 6464 host_impl_->SetMemoryPolicy(mem_policy); |
| 6465 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, | 6465 EXPECT_EQ(host_impl_->global_tile_state().hard_memory_limit_in_bytes, |
| 6466 300u * 1024u * 1024u); | 6466 300u * 1024u * 1024u); |
| 6467 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, | 6467 EXPECT_EQ(host_impl_->global_tile_state().soft_memory_limit_in_bytes, |
| 6468 150u * 1024u * 1024u); | 6468 150u * 1024u * 1024u); |
| 6469 } | 6469 } |
| 6470 | 6470 |
| 6471 } // namespace | 6471 } // namespace |
| 6472 } // namespace cc | 6472 } // namespace cc |
| OLD | NEW |