| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1876 layer->render_surface()->set_contributes_to_drawn_surface( | 1876 layer->render_surface()->set_contributes_to_drawn_surface( |
| 1877 layer_is_visible); | 1877 layer_is_visible); |
| 1878 } | 1878 } |
| 1879 | 1879 |
| 1880 // The opacity value is moved from the layer to its surface, so that the | 1880 // The opacity value is moved from the layer to its surface, so that the |
| 1881 // entire subtree properly inherits opacity. | 1881 // entire subtree properly inherits opacity. |
| 1882 render_surface->SetDrawOpacity(accumulated_draw_opacity); | 1882 render_surface->SetDrawOpacity(accumulated_draw_opacity); |
| 1883 render_surface->SetDrawOpacityIsAnimating(animating_opacity_to_target); | 1883 render_surface->SetDrawOpacityIsAnimating(animating_opacity_to_target); |
| 1884 animating_opacity_to_target = false; | 1884 animating_opacity_to_target = false; |
| 1885 layer_draw_properties.opacity = 1.f; | 1885 layer_draw_properties.opacity = 1.f; |
| 1886 layer_draw_properties.blend_mode = SkXfermode::kSrcOver_Mode; |
| 1886 layer_draw_properties.opacity_is_animating = animating_opacity_to_target; | 1887 layer_draw_properties.opacity_is_animating = animating_opacity_to_target; |
| 1887 layer_draw_properties.screen_space_opacity_is_animating = | 1888 layer_draw_properties.screen_space_opacity_is_animating = |
| 1888 animating_opacity_to_screen; | 1889 animating_opacity_to_screen; |
| 1889 | 1890 |
| 1890 render_surface->SetTargetSurfaceTransformsAreAnimating( | 1891 render_surface->SetTargetSurfaceTransformsAreAnimating( |
| 1891 animating_transform_to_target); | 1892 animating_transform_to_target); |
| 1892 render_surface->SetScreenSpaceTransformsAreAnimating( | 1893 render_surface->SetScreenSpaceTransformsAreAnimating( |
| 1893 animating_transform_to_screen); | 1894 animating_transform_to_screen); |
| 1894 animating_transform_to_target = false; | 1895 animating_transform_to_target = false; |
| 1895 layer_draw_properties.target_space_transform_is_animating = | 1896 layer_draw_properties.target_space_transform_is_animating = |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2000 } else { | 2001 } else { |
| 2001 DCHECK(layer->parent()); | 2002 DCHECK(layer->parent()); |
| 2002 | 2003 |
| 2003 // Note: layer_draw_properties.target_space_transform is computed above, | 2004 // Note: layer_draw_properties.target_space_transform is computed above, |
| 2004 // before this if-else statement. | 2005 // before this if-else statement. |
| 2005 layer_draw_properties.target_space_transform_is_animating = | 2006 layer_draw_properties.target_space_transform_is_animating = |
| 2006 animating_transform_to_target; | 2007 animating_transform_to_target; |
| 2007 layer_draw_properties.screen_space_transform_is_animating = | 2008 layer_draw_properties.screen_space_transform_is_animating = |
| 2008 animating_transform_to_screen; | 2009 animating_transform_to_screen; |
| 2009 layer_draw_properties.opacity = accumulated_draw_opacity; | 2010 layer_draw_properties.opacity = accumulated_draw_opacity; |
| 2011 layer_draw_properties.blend_mode = layer->blend_mode(); |
| 2010 layer_draw_properties.opacity_is_animating = animating_opacity_to_target; | 2012 layer_draw_properties.opacity_is_animating = animating_opacity_to_target; |
| 2011 layer_draw_properties.screen_space_opacity_is_animating = | 2013 layer_draw_properties.screen_space_opacity_is_animating = |
| 2012 animating_opacity_to_screen; | 2014 animating_opacity_to_screen; |
| 2013 data_for_children.parent_matrix = combined_transform; | 2015 data_for_children.parent_matrix = combined_transform; |
| 2014 | 2016 |
| 2015 layer->ClearRenderSurface(); | 2017 layer->ClearRenderSurface(); |
| 2016 | 2018 |
| 2017 // Layers without render_surfaces directly inherit the ancestor's clip | 2019 // Layers without render_surfaces directly inherit the ancestor's clip |
| 2018 // status. | 2020 // status. |
| 2019 layer_or_ancestor_clips_descendants = ancestor_clips_subtree; | 2021 layer_or_ancestor_clips_descendants = ancestor_clips_subtree; |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2438 inputs->current_render_surface_layer_list_id); | 2440 inputs->current_render_surface_layer_list_id); |
| 2439 | 2441 |
| 2440 // The dummy layer list should not have been used. | 2442 // The dummy layer list should not have been used. |
| 2441 DCHECK_EQ(0u, dummy_layer_list.size()); | 2443 DCHECK_EQ(0u, dummy_layer_list.size()); |
| 2442 // A root layer render_surface should always exist after | 2444 // A root layer render_surface should always exist after |
| 2443 // CalculateDrawProperties. | 2445 // CalculateDrawProperties. |
| 2444 DCHECK(inputs->root_layer->render_surface()); | 2446 DCHECK(inputs->root_layer->render_surface()); |
| 2445 } | 2447 } |
| 2446 | 2448 |
| 2447 } // namespace cc | 2449 } // namespace cc |
| OLD | NEW |