Index: cc/trees/layer_tree_host_common.cc |
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc |
index aa9ad5e57255c40ffad3c20b50bf134c9416d9cb..0e4d3e7893d41b260904d6a69bfc71c1d53a7b60 100644 |
--- a/cc/trees/layer_tree_host_common.cc |
+++ b/cc/trees/layer_tree_host_common.cc |
@@ -268,6 +268,17 @@ static inline void UpdateTilePrioritiesForLayer(LayerImpl* layer) { |
static inline void UpdateTilePrioritiesForLayer(Layer* layer) {} |
+static inline void SavePaintPropertiesLayer(LayerImpl* layer) {} |
+ |
+static inline void SavePaintPropertiesLayer(Layer* layer) { |
+ layer->SavePaintProperties(); |
+ |
+ if (layer->mask_layer()) |
+ layer->mask_layer()->SavePaintProperties(); |
+ if (layer->replica_layer() && layer->replica_layer()->mask_layer()) |
+ layer->replica_layer()->mask_layer()->SavePaintProperties(); |
+} |
+ |
template <typename LayerType> |
static bool SubtreeShouldRenderToSeparateSurface( |
LayerType* layer, |
@@ -767,7 +778,8 @@ static void CalculateDrawPropertiesInternal( |
float page_scale_factor, |
bool subtree_can_use_lcd_text, |
gfx::Rect* drawable_content_rect_of_subtree, |
- bool update_tile_priorities) { |
+ bool update_tile_priorities, |
+ bool save_paint_properties) { |
// This function computes the new matrix transformations recursively for this |
// layer and all its descendants. It also computes the appropriate render |
// surfaces. |
@@ -1246,7 +1258,8 @@ static void CalculateDrawPropertiesInternal( |
page_scale_factor, |
subtree_can_use_lcd_text, |
&drawable_content_rect_of_child_subtree, |
- update_tile_priorities); |
+ update_tile_priorities, |
+ save_paint_properties); |
if (!drawable_content_rect_of_child_subtree.IsEmpty()) { |
accumulated_drawable_content_rect_of_children.Union( |
drawable_content_rect_of_child_subtree); |
@@ -1409,6 +1422,9 @@ static void CalculateDrawPropertiesInternal( |
layer->render_target()->render_surface()-> |
AddContributingDelegatedRenderPassLayer(layer); |
} |
+ |
+ if (save_paint_properties) |
+ SavePaintPropertiesLayer(layer); |
} |
void LayerTreeHostCommon::CalculateDrawProperties( |
@@ -1430,6 +1446,7 @@ void LayerTreeHostCommon::CalculateDrawProperties( |
bool subtree_should_be_clipped = true; |
gfx::Rect device_viewport_rect(device_viewport_size); |
bool update_tile_priorities = false; |
+ bool save_paint_properties = true; |
// This function should have received a root layer. |
DCHECK(IsRootLayer(root_layer)); |
@@ -1454,7 +1471,8 @@ void LayerTreeHostCommon::CalculateDrawProperties( |
page_scale_factor, |
can_use_lcd_text, |
&total_drawable_content_rect, |
- update_tile_priorities); |
+ update_tile_priorities, |
+ save_paint_properties); |
// The dummy layer list should not have been used. |
DCHECK_EQ(0u, dummy_layer_list.size()); |
@@ -1483,6 +1501,7 @@ void LayerTreeHostCommon::CalculateDrawProperties( |
// initial clip rect. |
bool subtree_should_be_clipped = true; |
gfx::Rect device_viewport_rect(device_viewport_size); |
+ bool save_paint_properties = false; |
// This function should have received a root layer. |
DCHECK(IsRootLayer(root_layer)); |
@@ -1508,7 +1527,8 @@ void LayerTreeHostCommon::CalculateDrawProperties( |
page_scale_factor, |
can_use_lcd_text, |
&total_drawable_content_rect, |
- update_tile_priorities); |
+ update_tile_priorities, |
+ save_paint_properties); |
enne (OOO)
2013/04/12 23:03:22
I don't think you need this. We can just always c
reveman
2013/04/12 23:41:48
Done.
|
// The dummy layer list should not have been used. |
DCHECK_EQ(0u, dummy_layer_list.size()); |