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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1044093005: Preliminary compositor disabling patch. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove renderpass calculation Created 5 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
« no previous file with comments | « cc/trees/damage_tracker.cc ('k') | content/browser/compositor/buffer_queue.h » ('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 32c1db514e2e1b110c271b3afdb313ebb834a045..59c733ec682b764554bdf6100a329e08295a0c0e 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -690,14 +690,16 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
// frame at all.
RenderSurfaceImpl* root_surface =
active_tree_->root_layer()->render_surface();
+ gfx::Rect damage_rect_with_overlays =
+ gfx::UnionRects(root_surface->damage_tracker()->current_damage_rect(),
+ root_surface->damage_tracker()->current_overlay_rect());
bool root_surface_has_no_visible_damage =
- !root_surface->damage_tracker()->current_damage_rect().Intersects(
- root_surface->content_rect());
- bool root_surface_has_contributing_layers =
+ !damage_rect_with_overlays.Intersects(root_surface->content_rect());
+ bool root_surface_has_no_contributing_layers =
!root_surface->layer_list().empty();
bool hud_wants_to_draw_ = active_tree_->hud_layer() &&
active_tree_->hud_layer()->IsAnimatingHUDContents();
- if (root_surface_has_contributing_layers &&
+ if (root_surface_has_no_contributing_layers &&
root_surface_has_no_visible_damage &&
active_tree_->LayersWithCopyOutputRequest().empty() &&
!output_surface_->capabilities().can_force_reclaim_resources &&
@@ -899,6 +901,15 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
}
RemoveRenderPasses(CullRenderPassesWithNoQuads(), frame);
+
+ // Only the root render pass is allowed to have overlays, so we can merge
+ // in all quad damage for the other ones now.
+ for (size_t i = 0; i < frame->render_passes.size() - 1; ++i) {
+ RenderPass* pass = frame->render_passes.at(i);
+ pass->damage_rect.Union(pass->overlay_rect);
+ pass->overlay_rect = gfx::Rect();
+ }
+
renderer_->DecideRenderPassAllocationsForFrame(frame->render_passes);
// Any copy requests left in the tree are not going to get serviced, and
« no previous file with comments | « cc/trees/damage_tracker.cc ('k') | content/browser/compositor/buffer_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698