| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/property_tree_builder.h" | 5 #include "cc/trees/property_tree_builder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 // The current W3C spec on CSS transforms says that backface visibility | 1093 // The current W3C spec on CSS transforms says that backface visibility |
| 1094 // should be determined differently depending on whether the layer is in a | 1094 // should be determined differently depending on whether the layer is in a |
| 1095 // "3d rendering context" or not. For Chromium code, we can determine | 1095 // "3d rendering context" or not. For Chromium code, we can determine |
| 1096 // whether we are in a 3d rendering context by checking if the parent | 1096 // whether we are in a 3d rendering context by checking if the parent |
| 1097 // preserves 3d. | 1097 // preserves 3d. |
| 1098 const bool use_local_transform = | 1098 const bool use_local_transform = |
| 1099 !Is3dSorted(layer) || | 1099 !Is3dSorted(layer) || |
| 1100 (Is3dSorted(layer) && is_at_boundary_of_3d_rendering_context); | 1100 (Is3dSorted(layer) && is_at_boundary_of_3d_rendering_context); |
| 1101 layer->SetUseLocalTransformForBackfaceVisibility(use_local_transform); | 1101 layer->SetUseLocalTransformForBackfaceVisibility(use_local_transform); |
| 1102 | 1102 |
| 1103 // A double-sided layer's backface can been shown when its visibile. | 1103 // A double-sided layer's backface can been shown when its visible. |
| 1104 if (DoubleSided(layer)) | 1104 if (DoubleSided(layer)) |
| 1105 layer->SetShouldCheckBackfaceVisibility(false); | 1105 layer->SetShouldCheckBackfaceVisibility(false); |
| 1106 // The backface of a layer that uses local transform for backface visibility | 1106 // The backface of a layer that uses local transform for backface visibility |
| 1107 // is not visible when it does not create a transform node as its local | 1107 // is not visible when it does not create a transform node as its local |
| 1108 // transform is identity or 2d translation and is not animating. | 1108 // transform is identity or 2d translation and is not animating. |
| 1109 else if (use_local_transform && !created_transform_node) | 1109 else if (use_local_transform && !created_transform_node) |
| 1110 layer->SetShouldCheckBackfaceVisibility(false); | 1110 layer->SetShouldCheckBackfaceVisibility(false); |
| 1111 else | 1111 else |
| 1112 layer->SetShouldCheckBackfaceVisibility(true); | 1112 layer->SetShouldCheckBackfaceVisibility(true); |
| 1113 } | 1113 } |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 root_layer, page_scale_layer, inner_viewport_scroll_layer, | 1379 root_layer, page_scale_layer, inner_viewport_scroll_layer, |
| 1380 outer_viewport_scroll_layer, overscroll_elasticity_layer, | 1380 outer_viewport_scroll_layer, overscroll_elasticity_layer, |
| 1381 elastic_overscroll, page_scale_factor, device_scale_factor, viewport, | 1381 elastic_overscroll, page_scale_factor, device_scale_factor, viewport, |
| 1382 device_transform, property_trees, color); | 1382 device_transform, property_trees, color); |
| 1383 property_trees->effect_tree.CreateOrReuseRenderSurfaces( | 1383 property_trees->effect_tree.CreateOrReuseRenderSurfaces( |
| 1384 &render_surfaces, root_layer->layer_tree_impl()); | 1384 &render_surfaces, root_layer->layer_tree_impl()); |
| 1385 property_trees->ResetCachedData(); | 1385 property_trees->ResetCachedData(); |
| 1386 } | 1386 } |
| 1387 | 1387 |
| 1388 } // namespace cc | 1388 } // namespace cc |
| OLD | NEW |