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_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include <set> | 8 #include <set> |
8 | 9 |
9 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
10 #include "cc/animation/transform_operations.h" | 11 #include "cc/animation/transform_operations.h" |
11 #include "cc/base/math_util.h" | 12 #include "cc/base/math_util.h" |
12 #include "cc/layers/content_layer.h" | 13 #include "cc/layers/content_layer.h" |
13 #include "cc/layers/content_layer_client.h" | 14 #include "cc/layers/content_layer_client.h" |
14 #include "cc/layers/layer.h" | 15 #include "cc/layers/layer.h" |
15 #include "cc/layers/layer_client.h" | 16 #include "cc/layers/layer_client.h" |
16 #include "cc/layers/layer_impl.h" | 17 #include "cc/layers/layer_impl.h" |
(...skipping 7481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7498 scoped_ptr<LayerImpl> scroll_child = | 7499 scoped_ptr<LayerImpl> scroll_child = |
7499 LayerImpl::Create(host_impl.active_tree(), 5); | 7500 LayerImpl::Create(host_impl.active_tree(), 5); |
7500 scoped_ptr<LayerImpl> bottom_content = | 7501 scoped_ptr<LayerImpl> bottom_content = |
7501 LayerImpl::Create(host_impl.active_tree(), 6); | 7502 LayerImpl::Create(host_impl.active_tree(), 6); |
7502 scoped_ptr<LayerImpl> top_content = | 7503 scoped_ptr<LayerImpl> top_content = |
7503 LayerImpl::Create(host_impl.active_tree(), 7); | 7504 LayerImpl::Create(host_impl.active_tree(), 7); |
7504 | 7505 |
7505 scroll_parent_clip->SetMasksToBounds(true); | 7506 scroll_parent_clip->SetMasksToBounds(true); |
7506 | 7507 |
7507 scroll_child->SetScrollParent(scroll_parent.get()); | 7508 scroll_child->SetScrollParent(scroll_parent.get()); |
7508 scoped_ptr<std::set<LayerImpl*> > scroll_children(new std::set<LayerImpl*>); | 7509 scoped_ptr<std::set<LayerImpl*>> scroll_children(new std::set<LayerImpl*>); |
7509 scroll_children->insert(scroll_child.get()); | 7510 scroll_children->insert(scroll_child.get()); |
7510 scroll_parent->SetScrollChildren(scroll_children.release()); | 7511 scroll_parent->SetScrollChildren(scroll_children.release()); |
7511 | 7512 |
7512 scroll_child->SetDrawsContent(true); | 7513 scroll_child->SetDrawsContent(true); |
7513 scroll_parent->SetDrawsContent(true); | 7514 scroll_parent->SetDrawsContent(true); |
7514 top_content->SetDrawsContent(true); | 7515 top_content->SetDrawsContent(true); |
7515 bottom_content->SetDrawsContent(true); | 7516 bottom_content->SetDrawsContent(true); |
7516 | 7517 |
7517 gfx::Transform identity_transform; | 7518 gfx::Transform identity_transform; |
7518 gfx::Transform top_transform; | 7519 gfx::Transform top_transform; |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8556 // by the viewport. | 8557 // by the viewport. |
8557 EXPECT_EQ(gfx::Rect(768 / 2, 582 / 2), root->visible_content_rect()); | 8558 EXPECT_EQ(gfx::Rect(768 / 2, 582 / 2), root->visible_content_rect()); |
8558 | 8559 |
8559 // Layers drawing to a child render surface should still have their visible | 8560 // Layers drawing to a child render surface should still have their visible |
8560 // content rect clipped by the viewport. | 8561 // content rect clipped by the viewport. |
8561 EXPECT_EQ(gfx::Rect(768 / 2, 582 / 2), content->visible_content_rect()); | 8562 EXPECT_EQ(gfx::Rect(768 / 2, 582 / 2), content->visible_content_rect()); |
8562 } | 8563 } |
8563 | 8564 |
8564 } // namespace | 8565 } // namespace |
8565 } // namespace cc | 8566 } // namespace cc |
OLD | NEW |