Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: cc/trees/layer_tree_host_common.cc

Issue 549683002: Adding blend mode to DrawProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/video_layer_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 // The opacity value is moved from the layer to its surface, so that the 1877 // The opacity value is moved from the layer to its surface, so that the
1878 // entire subtree properly inherits opacity. 1878 // entire subtree properly inherits opacity.
1879 render_surface->SetDrawOpacity(accumulated_draw_opacity); 1879 render_surface->SetDrawOpacity(accumulated_draw_opacity);
1880 render_surface->SetDrawOpacityIsAnimating(animating_opacity_to_target); 1880 render_surface->SetDrawOpacityIsAnimating(animating_opacity_to_target);
1881 animating_opacity_to_target = false; 1881 animating_opacity_to_target = false;
1882 layer_draw_properties.opacity = 1.f; 1882 layer_draw_properties.opacity = 1.f;
1883 layer_draw_properties.opacity_is_animating = animating_opacity_to_target; 1883 layer_draw_properties.opacity_is_animating = animating_opacity_to_target;
1884 layer_draw_properties.screen_space_opacity_is_animating = 1884 layer_draw_properties.screen_space_opacity_is_animating =
1885 animating_opacity_to_screen; 1885 animating_opacity_to_screen;
1886 1886
1887 // The render surface will be responsible for applying the blend mode.
1888 layer_draw_properties.blend_mode = SkXfermode::kSrcOver_Mode;
1889
1887 render_surface->SetTargetSurfaceTransformsAreAnimating( 1890 render_surface->SetTargetSurfaceTransformsAreAnimating(
1888 animating_transform_to_target); 1891 animating_transform_to_target);
1889 render_surface->SetScreenSpaceTransformsAreAnimating( 1892 render_surface->SetScreenSpaceTransformsAreAnimating(
1890 animating_transform_to_screen); 1893 animating_transform_to_screen);
1891 animating_transform_to_target = false; 1894 animating_transform_to_target = false;
1892 layer_draw_properties.target_space_transform_is_animating = 1895 layer_draw_properties.target_space_transform_is_animating =
1893 animating_transform_to_target; 1896 animating_transform_to_target;
1894 layer_draw_properties.screen_space_transform_is_animating = 1897 layer_draw_properties.screen_space_transform_is_animating =
1895 animating_transform_to_screen; 1898 animating_transform_to_screen;
1896 1899
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 DCHECK(layer->parent()); 1998 DCHECK(layer->parent());
1996 1999
1997 // Note: layer_draw_properties.target_space_transform is computed above, 2000 // Note: layer_draw_properties.target_space_transform is computed above,
1998 // before this if-else statement. 2001 // before this if-else statement.
1999 layer_draw_properties.target_space_transform_is_animating = 2002 layer_draw_properties.target_space_transform_is_animating =
2000 animating_transform_to_target; 2003 animating_transform_to_target;
2001 layer_draw_properties.screen_space_transform_is_animating = 2004 layer_draw_properties.screen_space_transform_is_animating =
2002 animating_transform_to_screen; 2005 animating_transform_to_screen;
2003 layer_draw_properties.opacity = accumulated_draw_opacity; 2006 layer_draw_properties.opacity = accumulated_draw_opacity;
2004 layer_draw_properties.opacity_is_animating = animating_opacity_to_target; 2007 layer_draw_properties.opacity_is_animating = animating_opacity_to_target;
2008 layer_draw_properties.blend_mode = layer->blend_mode();
2005 layer_draw_properties.screen_space_opacity_is_animating = 2009 layer_draw_properties.screen_space_opacity_is_animating =
2006 animating_opacity_to_screen; 2010 animating_opacity_to_screen;
2007 data_for_children.parent_matrix = combined_transform; 2011 data_for_children.parent_matrix = combined_transform;
2008 2012
2009 layer->ClearRenderSurface(); 2013 layer->ClearRenderSurface();
2010 2014
2011 // Layers without render_surfaces directly inherit the ancestor's clip 2015 // Layers without render_surfaces directly inherit the ancestor's clip
2012 // status. 2016 // status.
2013 layer_or_ancestor_clips_descendants = ancestor_clips_subtree; 2017 layer_or_ancestor_clips_descendants = ancestor_clips_subtree;
2014 if (ancestor_clips_subtree) { 2018 if (ancestor_clips_subtree) {
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 inputs->current_render_surface_layer_list_id); 2437 inputs->current_render_surface_layer_list_id);
2434 2438
2435 // The dummy layer list should not have been used. 2439 // The dummy layer list should not have been used.
2436 DCHECK_EQ(0u, dummy_layer_list.size()); 2440 DCHECK_EQ(0u, dummy_layer_list.size());
2437 // A root layer render_surface should always exist after 2441 // A root layer render_surface should always exist after
2438 // CalculateDrawProperties. 2442 // CalculateDrawProperties.
2439 DCHECK(inputs->root_layer->render_surface()); 2443 DCHECK(inputs->root_layer->render_surface());
2440 } 2444 }
2441 2445
2442 } // namespace cc 2446 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/video_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698