| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 child->render_surface()->DrawableContentRect()); | 1395 child->render_surface()->DrawableContentRect()); |
| 1396 } | 1396 } |
| 1397 | 1397 |
| 1398 TEST_F(LayerTreeHostCommonTest, RenderSurfaceForBlendMode) { | 1398 TEST_F(LayerTreeHostCommonTest, RenderSurfaceForBlendMode) { |
| 1399 LayerImpl* root = root_layer_for_testing(); | 1399 LayerImpl* root = root_layer_for_testing(); |
| 1400 LayerImpl* child = AddChild<LayerImpl>(root); | 1400 LayerImpl* child = AddChild<LayerImpl>(root); |
| 1401 | 1401 |
| 1402 root->SetBounds(gfx::Size(10, 10)); | 1402 root->SetBounds(gfx::Size(10, 10)); |
| 1403 child->SetBounds(gfx::Size(10, 10)); | 1403 child->SetBounds(gfx::Size(10, 10)); |
| 1404 child->SetDrawsContent(true); | 1404 child->SetDrawsContent(true); |
| 1405 child->SetBlendMode(SkXfermode::kMultiply_Mode); | 1405 child->test_properties()->blend_mode = SkXfermode::kMultiply_Mode; |
| 1406 child->test_properties()->opacity = 0.5f; | 1406 child->test_properties()->opacity = 0.5f; |
| 1407 child->test_properties()->force_render_surface = true; | 1407 child->test_properties()->force_render_surface = true; |
| 1408 ExecuteCalculateDrawProperties(root); | 1408 ExecuteCalculateDrawProperties(root); |
| 1409 | 1409 |
| 1410 // Since the child layer has a blend mode other than normal, it should get | 1410 // Since the child layer has a blend mode other than normal, it should get |
| 1411 // its own render surface. Also, layer's draw_properties should contain the | 1411 // its own render surface. Also, layer's draw_properties should contain the |
| 1412 // default blend mode, since the render surface becomes responsible for | 1412 // default blend mode, since the render surface becomes responsible for |
| 1413 // applying the blend mode. | 1413 // applying the blend mode. |
| 1414 ASSERT_TRUE(child->render_surface()); | 1414 ASSERT_TRUE(child->render_surface()); |
| 1415 EXPECT_EQ(1.0f, child->draw_opacity()); | 1415 EXPECT_EQ(1.0f, child->draw_opacity()); |
| (...skipping 8570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9986 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 9986 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
| 9987 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 9987 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
| 9988 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 9988 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
| 9989 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 9989 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
| 9990 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 9990 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
| 9991 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 9991 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
| 9992 } | 9992 } |
| 9993 | 9993 |
| 9994 } // namespace | 9994 } // namespace |
| 9995 } // namespace cc | 9995 } // namespace cc |
| OLD | NEW |