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

Unified Diff: cc/surfaces/display.cc

Issue 2855723002: Don't submit frames with no render passes in cc tests (Closed)
Patch Set: c Created 3 years, 7 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/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface.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 c32dff0bcfc952015ebaea3d33a8a057307f6287..1f4c9d1abca99d3be4573db1707150fa41af6c19 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -283,19 +283,17 @@ bool Display::DrawAndSwap() {
gfx::Size surface_size;
bool have_damage = false;
- if (!frame.render_pass_list.empty()) {
- RenderPass& last_render_pass = *frame.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();
+ RenderPass& last_render_pass = *frame.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)
« no previous file with comments | « cc/surfaces/compositor_frame_sink_support_unittest.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698