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

Unified Diff: cc/output/direct_renderer.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/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index 0ae4179deaef141473f276f50eb503cba852f5cb..0cf7b46513b806508d9a8c114fc6810ee339906a 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -203,12 +203,20 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
UMA_HISTOGRAM_COUNTS("Renderer4.renderPassCount",
render_passes_in_draw_order->size());
- const RenderPass* root_render_pass = render_passes_in_draw_order->back();
+ RenderPass* root_render_pass = render_passes_in_draw_order->back();
DCHECK(root_render_pass);
DrawingFrame frame;
frame.render_passes_in_draw_order = render_passes_in_draw_order;
frame.root_render_pass = root_render_pass;
+
+ overlay_processor_->ProcessForOverlays(render_passes_in_draw_order,
+ &frame.overlay_list);
+
+ // Merge quad damage for the root pass.
+ root_render_pass->damage_rect.Union(root_render_pass->overlay_rect);
+ root_render_pass->overlay_rect = gfx::Rect();
+
frame.root_damage_rect = Capabilities().using_partial_swap
? root_render_pass->damage_rect
: root_render_pass->output_rect;
@@ -218,8 +226,20 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
frame.disable_picture_quad_image_filtering =
disable_picture_quad_image_filtering;
- overlay_processor_->ProcessForOverlays(render_passes_in_draw_order,
- &frame.overlay_list);
+ if (root_render_pass->damage_rect.IsEmpty()) {
+ // If we have a scene that is composed of only overlays then we can
+ // potentially avoid drawing anything. However, if there are any copy
+ // requests we must do the drawing.
+ auto copy_pass = std::find_if(
+ render_passes_in_draw_order->begin(),
+ render_passes_in_draw_order->end(),
+ [](const RenderPass* pass) { return !pass->copy_requests.empty(); });
+ if (copy_pass == render_passes_in_draw_order->end()) {
+ ScheduleOverlays(&frame);
+ render_passes_in_draw_order->clear();
+ return;
+ }
+ }
EnsureBackbuffer();
@@ -246,6 +266,7 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
}
}
FinishDrawingFrame(&frame);
+ ScheduleOverlays(&frame);
render_passes_in_draw_order->clear();
}
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698