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

Unified Diff: cc/surfaces/display.cc

Issue 1426453006: Resize output_rect of aggregated CompositorFrame to enable it to be drawn when resizing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/surfaces/display_unittest.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 7cd9d6d126b566dd5547595523d92a181a2d466d..cc1b34130b4caf189744f7549127cf29b0b5661b 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -218,14 +218,22 @@ bool Display::DrawAndSwap() {
gfx::Size surface_size;
bool have_damage = false;
if (!frame_data->render_pass_list.empty()) {
- surface_size = frame_data->render_pass_list.back()->output_rect.size();
- have_damage =
- !frame_data->render_pass_list.back()->damage_rect.size().IsEmpty();
+ RenderPass& last_render_pass = *frame_data->render_pass_list.back();
+ if (last_render_pass.output_rect.size() != current_surface_size_ &&
+ last_render_pass.damage_rect == last_render_pass.output_rect &&
+ !current_surface_size_.IsEmpty()) {
+ // Resize the output rect to the current surface size so that we won't
+ // skip the draw and so that the GL swap won't stretch the output.
+ last_render_pass.output_rect.set_size(current_surface_size_);
+ last_render_pass.damage_rect = last_render_pass.output_rect;
+ }
+ surface_size = last_render_pass.output_rect.size();
+ have_damage = !last_render_pass.damage_rect.size().IsEmpty();
}
bool size_matches = surface_size == current_surface_size_;
if (!size_matches)
- TRACE_EVENT_INSTANT0("cc", "Size missmatch.", TRACE_EVENT_SCOPE_THREAD);
+ TRACE_EVENT_INSTANT0("cc", "Size mismatch.", TRACE_EVENT_SCOPE_THREAD);
brianderson 2015/11/04 01:40:25 In what cases would we hit this trace after this p
bool should_draw = !frame->metadata.latency_info.empty() ||
have_copy_requests || (have_damage && size_matches);
« no previous file with comments | « no previous file | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698