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

Unified Diff: cc/output/direct_renderer.cc

Issue 1413763013: Avoid rendering using GL in case damage rect is composited by overlay (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test Created 5 years, 1 month 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 | « no previous file | cc/output/overlay_unittest.cc » ('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 0a66eea2ae10bab6c2007d7e50fe60ea2c94d924..43e19c39c56a333e6f3e59092ea08ea05fd26188 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -242,6 +242,25 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
overlay_processor_->ProcessForOverlays(
resource_provider_, render_passes_in_draw_order, &frame.overlay_list,
&frame.root_damage_rect);
+
+ // No need to render in case the damage rect is completely composited using
+ // overlays and dont have any copy requests.
+ if (frame.root_damage_rect.IsEmpty()) {
+ bool handle_copy_requests = false;
+ for (auto* pass : *render_passes_in_draw_order) {
+ if (!pass->copy_requests.empty()) {
+ handle_copy_requests = true;
+ break;
+ }
+ }
+
+ if (!handle_copy_requests) {
+ BindFramebufferToOutputSurface(&frame);
+ FinishDrawingFrame(&frame);
+ render_passes_in_draw_order->clear();
+ return;
+ }
+ }
}
for (size_t i = 0; i < render_passes_in_draw_order->size(); ++i) {
« no previous file with comments | « no previous file | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698