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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 265883013: cc: Add a flag to layers that returns true if the layer is in RSLL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
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 655b4052a8b367f8383098c71a96960e13165a13..839735cda2f0c55c907bee9afaf48f8671f192bb 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -1423,8 +1423,8 @@ static void CalculateDrawPropertiesInternal(
const DataForRecursion<LayerType>& data_from_ancestor,
typename LayerType::RenderSurfaceListType* render_surface_layer_list,
typename LayerType::LayerListType* layer_list,
- std::vector<AccumulatedSurfaceState<LayerType> >*
- accumulated_surface_state) {
+ std::vector<AccumulatedSurfaceState<LayerType> >* accumulated_surface_state,
+ size_t current_calculate_draw_properties_count) {
// This function computes the new matrix transformations recursively for this
// layer and all its descendants. It also computes the appropriate render
// surfaces.
@@ -2072,12 +2072,14 @@ static void CalculateDrawPropertiesInternal(
child->draw_properties().index_of_first_render_surface_layer_list_addition =
render_surface_layer_list->size();
- CalculateDrawPropertiesInternal<LayerType>(child,
- globals,
- data_for_children,
- render_surface_layer_list,
- &descendants,
- accumulated_surface_state);
+ CalculateDrawPropertiesInternal<LayerType>(
+ child,
+ globals,
+ data_for_children,
+ render_surface_layer_list,
+ &descendants,
+ accumulated_surface_state,
+ current_calculate_draw_properties_count);
if (child->render_surface() &&
!child->render_surface()->layer_list().empty() &&
!child->render_surface()->content_rect().IsEmpty()) {
@@ -2262,6 +2264,24 @@ static void CalculateDrawPropertiesInternal(
layer->render_target()->render_surface()->
AddContributingDelegatedRenderPassLayer(layer);
}
+
+ // If the layer passed all of the early outs, that means it's finally in the
vmpstr 2014/05/02 23:41:22 Kind of like so?
+ // render surface layer list: mark it as a member.
+ layer_draw_properties.last_render_surface_list_membership_index =
+ current_calculate_draw_properties_count;
+ if (layer->mask_layer()) {
+ layer->mask_layer()
+ ->draw_properties()
+ .last_render_surface_list_membership_index =
+ current_calculate_draw_properties_count;
+ }
+ if (layer->replica_layer() && layer->replica_layer()->mask_layer()) {
+ layer->replica_layer()
+ ->mask_layer()
+ ->draw_properties()
+ .last_render_surface_list_membership_index =
+ current_calculate_draw_properties_count;
+ }
}
template <typename LayerType, typename RenderSurfaceLayerListType>
@@ -2328,12 +2348,14 @@ void LayerTreeHostCommon::CalculateDrawProperties(
PreCalculateMetaInformationRecursiveData recursive_data;
PreCalculateMetaInformation(inputs->root_layer, &recursive_data);
std::vector<AccumulatedSurfaceState<Layer> > accumulated_surface_state;
- CalculateDrawPropertiesInternal<Layer>(inputs->root_layer,
- globals,
- data_for_recursion,
- inputs->render_surface_layer_list,
- &dummy_layer_list,
- &accumulated_surface_state);
+ CalculateDrawPropertiesInternal<Layer>(
+ inputs->root_layer,
+ globals,
+ data_for_recursion,
+ inputs->render_surface_layer_list,
+ &dummy_layer_list,
+ &accumulated_surface_state,
+ inputs->current_calculate_draw_properties_count);
// The dummy layer list should not have been used.
DCHECK_EQ(0u, dummy_layer_list.size());
@@ -2356,12 +2378,14 @@ void LayerTreeHostCommon::CalculateDrawProperties(
PreCalculateMetaInformation(inputs->root_layer, &recursive_data);
std::vector<AccumulatedSurfaceState<LayerImpl> >
accumulated_surface_state;
- CalculateDrawPropertiesInternal<LayerImpl>(inputs->root_layer,
- globals,
- data_for_recursion,
- inputs->render_surface_layer_list,
- &dummy_layer_list,
- &accumulated_surface_state);
+ CalculateDrawPropertiesInternal<LayerImpl>(
+ inputs->root_layer,
+ globals,
+ data_for_recursion,
+ inputs->render_surface_layer_list,
+ &dummy_layer_list,
+ &accumulated_surface_state,
+ inputs->current_calculate_draw_properties_count);
// The dummy layer list should not have been used.
DCHECK_EQ(0u, dummy_layer_list.size());

Powered by Google App Engine
This is Rietveld 408576698