| 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.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 EXPECT_FALSE(layer->DrawsContent()); | 643 EXPECT_FALSE(layer->DrawsContent()); |
| 644 } | 644 } |
| 645 | 645 |
| 646 void SetBeforeValues(Layer* layer) { | 646 void SetBeforeValues(Layer* layer) { |
| 647 layer->SetBounds(gfx::Size(10, 10)); | 647 layer->SetBounds(gfx::Size(10, 10)); |
| 648 layer->SetHideLayerAndSubtree(false); | 648 layer->SetHideLayerAndSubtree(false); |
| 649 layer->SetIsDrawable(false); | 649 layer->SetIsDrawable(false); |
| 650 } | 650 } |
| 651 | 651 |
| 652 void VerifyAfterValues(LayerImpl* layer) { | 652 void VerifyAfterValues(LayerImpl* layer) { |
| 653 EffectTree& tree = layer->layer_tree_impl()->property_trees()->effect_tree; |
| 654 EffectNode* node = tree.Node(layer->effect_tree_index()); |
| 653 switch (static_cast<Properties>(index_)) { | 655 switch (static_cast<Properties>(index_)) { |
| 654 case STARTUP: | 656 case STARTUP: |
| 655 case DONE: | 657 case DONE: |
| 656 break; | 658 break; |
| 657 case BOUNDS: | 659 case BOUNDS: |
| 658 EXPECT_EQ(gfx::Size(20, 20).ToString(), layer->bounds().ToString()); | 660 EXPECT_EQ(gfx::Size(20, 20).ToString(), layer->bounds().ToString()); |
| 659 break; | 661 break; |
| 660 case HIDE_LAYER_AND_SUBTREE: | 662 case HIDE_LAYER_AND_SUBTREE: |
| 661 EXPECT_TRUE(layer->hide_layer_and_subtree()); | 663 EXPECT_EQ(tree.EffectiveOpacity(node), 0.f); |
| 662 break; | 664 break; |
| 663 case DRAWS_CONTENT: | 665 case DRAWS_CONTENT: |
| 664 EXPECT_TRUE(layer->DrawsContent()); | 666 EXPECT_TRUE(layer->DrawsContent()); |
| 665 break; | 667 break; |
| 666 } | 668 } |
| 667 } | 669 } |
| 668 | 670 |
| 669 void SetAfterValues(Layer* layer) { | 671 void SetAfterValues(Layer* layer) { |
| 670 switch (static_cast<Properties>(index_)) { | 672 switch (static_cast<Properties>(index_)) { |
| 671 case STARTUP: | 673 case STARTUP: |
| (...skipping 5673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6345 EndTest(); | 6347 EndTest(); |
| 6346 } | 6348 } |
| 6347 | 6349 |
| 6348 void AfterTest() override {} | 6350 void AfterTest() override {} |
| 6349 }; | 6351 }; |
| 6350 | 6352 |
| 6351 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); | 6353 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); |
| 6352 | 6354 |
| 6353 } // namespace | 6355 } // namespace |
| 6354 } // namespace cc | 6356 } // namespace cc |
| OLD | NEW |