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

Unified Diff: cc/surfaces/display.cc

Issue 1454323002: Display skips swapping if overlays draw the damage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try skipping the swap at the cc::Display level 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 | « cc/output/renderer.h ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display.cc
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc
index 2cdcfcd1937e8455c55be9dfd01ae973209ddbb2..81ae2009be21beadc07dd752613b823283583012 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -239,6 +239,7 @@ bool Display::DrawAndSwap() {
should_draw = false;
}
+ DrawFrameResult draw_result = DrawFrameResult::DID_DRAW;
if (should_draw) {
gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_);
gfx::Rect device_clip_rect =
@@ -247,14 +248,20 @@ bool Display::DrawAndSwap() {
renderer_->DecideRenderPassAllocationsForFrame(
frame_data->render_pass_list);
- renderer_->DrawFrame(&frame_data->render_pass_list, device_scale_factor_,
- device_viewport_rect, device_clip_rect,
- disable_picture_quad_image_filtering);
+ draw_result = renderer_->DrawFrame(&frame_data->render_pass_list,
+ device_scale_factor_,
+ device_viewport_rect, device_clip_rect,
+ disable_picture_quad_image_filtering);
} else {
TRACE_EVENT_INSTANT0("cc", "Draw skipped.", TRACE_EVENT_SCOPE_THREAD);
}
- bool should_swap = should_draw && size_matches;
+ // If drawing was skipped because overlays removed the damage, swapping should
+ // be skipped too.
+ bool should_skip_swap =
+ have_damage && draw_result == DrawFrameResult::DAMAGE_DRAWN_BY_OVERLAYS &&
+ output_surface_->capabilities().schedules_overlays_without_swap;
+ bool should_swap = should_draw && size_matches && !should_skip_swap;
if (should_swap) {
swapped_since_resize_ = true;
for (auto& latency : frame->metadata.latency_info) {
« no previous file with comments | « cc/output/renderer.h ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698