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 6512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6523 gfx::Size bounds(100000, 100); | 6523 gfx::Size bounds(100000, 100); |
6524 | 6524 |
6525 host_impl_->CreatePendingTree(); | 6525 host_impl_->CreatePendingTree(); |
6526 | 6526 |
6527 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->pending_tree(), 1); | 6527 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl_->pending_tree(), 1); |
6528 | 6528 |
6529 scoped_ptr<FakePictureLayerImpl> layer_with_mask = | 6529 scoped_ptr<FakePictureLayerImpl> layer_with_mask = |
6530 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 2); | 6530 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 2); |
6531 | 6531 |
6532 layer_with_mask->SetBounds(bounds); | 6532 layer_with_mask->SetBounds(bounds); |
| 6533 layer_with_mask->SetContentBounds(bounds); |
6533 | 6534 |
6534 scoped_ptr<FakePictureLayerImpl> mask = | 6535 scoped_ptr<FakePictureLayerImpl> mask = |
6535 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 3); | 6536 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 3); |
6536 | 6537 |
6537 mask->SetIsMask(true); | 6538 mask->SetIsMask(true); |
6538 mask->SetBounds(bounds); | 6539 mask->SetBounds(bounds); |
| 6540 mask->SetContentBounds(bounds); |
6539 | 6541 |
6540 FakePictureLayerImpl* pending_mask_content = mask.get(); | 6542 FakePictureLayerImpl* pending_mask_content = mask.get(); |
6541 layer_with_mask->SetMaskLayer(mask.PassAs<LayerImpl>()); | 6543 layer_with_mask->SetMaskLayer(mask.PassAs<LayerImpl>()); |
6542 | 6544 |
6543 scoped_ptr<FakePictureLayerImpl> child_of_layer_with_mask = | 6545 scoped_ptr<FakePictureLayerImpl> child_of_layer_with_mask = |
6544 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 4); | 6546 FakePictureLayerImpl::Create(host_impl_->pending_tree(), 4); |
6545 | 6547 |
6546 child_of_layer_with_mask->SetBounds(bounds); | 6548 child_of_layer_with_mask->SetBounds(bounds); |
| 6549 child_of_layer_with_mask->SetContentBounds(bounds); |
6547 child_of_layer_with_mask->SetDrawsContent(true); | 6550 child_of_layer_with_mask->SetDrawsContent(true); |
6548 | 6551 |
6549 layer_with_mask->AddChild(child_of_layer_with_mask.PassAs<LayerImpl>()); | 6552 layer_with_mask->AddChild(child_of_layer_with_mask.PassAs<LayerImpl>()); |
6550 | 6553 |
6551 root->AddChild(layer_with_mask.PassAs<LayerImpl>()); | 6554 root->AddChild(layer_with_mask.PassAs<LayerImpl>()); |
6552 | 6555 |
6553 host_impl_->pending_tree()->SetRootLayer(root.Pass()); | 6556 host_impl_->pending_tree()->SetRootLayer(root.Pass()); |
6554 | 6557 |
6555 gfx::Rect r1 = pending_mask_content->visible_rect_for_tile_priority(); | 6558 gfx::Rect r1 = pending_mask_content->visible_rect_for_tile_priority(); |
6556 ASSERT_EQ(0, r1.x()); | 6559 ASSERT_EQ(0, r1.x()); |
(...skipping 10 matching lines...) Expand all Loading... |
6567 FakePictureLayerImpl* active_mask_content = | 6570 FakePictureLayerImpl* active_mask_content = |
6568 static_cast<FakePictureLayerImpl*>( | 6571 static_cast<FakePictureLayerImpl*>( |
6569 host_impl_->active_tree()->root_layer()->children()[0]->mask_layer()); | 6572 host_impl_->active_tree()->root_layer()->children()[0]->mask_layer()); |
6570 gfx::Rect r2 = active_mask_content->visible_rect_for_tile_priority(); | 6573 gfx::Rect r2 = active_mask_content->visible_rect_for_tile_priority(); |
6571 | 6574 |
6572 ASSERT_TRUE(!r2.IsEmpty()); | 6575 ASSERT_TRUE(!r2.IsEmpty()); |
6573 } | 6576 } |
6574 | 6577 |
6575 } // namespace | 6578 } // namespace |
6576 } // namespace cc | 6579 } // namespace cc |
OLD | NEW |