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