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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2017263002: cc: Move copy requests from layers to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in comment Created 4 years, 7 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 5c81223191013df75bb431a674d0a0c5ab8b6b15..36e4d488249b86b56b7028dda83cbdb795bd09dd 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -792,7 +792,7 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
active_tree_->hud_layer()->IsAnimatingHUDContents();
if (root_surface_has_contributing_layers &&
root_surface_has_no_visible_damage &&
- active_tree_->LayersWithCopyOutputRequest().empty() &&
+ !active_tree_->property_trees()->effect_tree.HasCopyRequests() &&
!output_surface_->capabilities().can_force_reclaim_resources &&
!hud_wants_to_draw_) {
TRACE_EVENT0("cc",
@@ -820,7 +820,7 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
bool should_draw_into_render_pass =
active_tree_->IsRootLayer(render_surface_layer) ||
render_surface->contributes_to_drawn_surface() ||
- render_surface_layer->HasCopyRequest();
+ render_surface->HasCopyRequest();
if (should_draw_into_render_pass)
render_surface->AppendRenderPasses(frame);
}
@@ -843,13 +843,6 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
root_pass->damage_rect = root_pass->output_rect;
}
- // Because the active tree could be drawn again if this fails for some reason,
- // clear all of the copy request flags so that sanity checks for the counts
- // succeed.
- if (!active_tree_->LayersWithCopyOutputRequest().empty()) {
- active_tree()->property_trees()->effect_tree.ClearCopyRequests();
- }
-
// Grab this region here before iterating layers. Taking copy requests from
// the layers while constructing the render passes will dirty the render
// surface layer list and this unoccluded region, flipping the dirty bit to
@@ -873,7 +866,8 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
int num_incomplete_tiles = 0;
int64_t checkerboarded_no_recording_content_area = 0;
int64_t checkerboarded_needs_raster_content_area = 0;
- bool have_copy_request = false;
+ bool have_copy_request =
+ active_tree()->property_trees()->effect_tree.HasCopyRequests();
bool have_missing_animated_tiles = false;
LayerIterator end = LayerIterator::End(frame->render_surface_layer_list);
@@ -888,10 +882,12 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
AppendQuadsData append_quads_data;
if (it.represents_target_render_surface()) {
- if (it->HasCopyRequest()) {
- have_copy_request = true;
- it->TakeCopyRequestsAndTransformToTarget(
- &target_render_pass->copy_requests);
+ if (it->render_surface()->HasCopyRequest()) {
+ active_tree()
+ ->property_trees()
+ ->effect_tree.TakeCopyRequestsAndTransformToSurface(
+ it->render_surface()->EffectTreeIndex(),
+ &target_render_pass->copy_requests);
}
} else if (it.represents_contributing_render_surface() &&
it->render_surface()->contributes_to_drawn_surface()) {
@@ -986,15 +982,14 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
RemoveRenderPasses(frame);
renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes);
- // Any copy requests left in the tree are not going to get serviced, and
- // should be aborted.
- std::vector<std::unique_ptr<CopyOutputRequest>> requests_to_abort;
- while (!active_tree_->LayersWithCopyOutputRequest().empty()) {
- LayerImpl* layer = active_tree_->LayersWithCopyOutputRequest().back();
- layer->TakeCopyRequestsAndTransformToTarget(&requests_to_abort);
+ if (have_copy_request) {
+ // Any copy requests left in the tree are not going to get serviced, and
+ // should be aborted.
+ active_tree()->property_trees()->effect_tree.ClearCopyRequests();
+
+ // Draw properties depend on copy requests.
+ active_tree()->set_needs_update_draw_properties();
}
- for (size_t i = 0; i < requests_to_abort.size(); ++i)
- requests_to_abort[i]->SendEmptyResult();
// If we're making a frame to draw, it better have at least one render pass.
DCHECK(!frame->render_passes.empty());
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698