Index: cc/output/gl_renderer.cc |
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc |
index ea8031e145b51fd2be95277abefe5f0a80f00373..4997160d17964bbfb3ba5c0a08f4fb103326f859 100644 |
--- a/cc/output/gl_renderer.cc |
+++ b/cc/output/gl_renderer.cc |
@@ -348,6 +348,8 @@ GLRenderer::GLRenderer(RendererClient* client, |
capabilities_.using_partial_swap = |
settings_->partial_swap_enabled && context_caps.gpu.post_sub_buffer; |
+ capabilities_.allow_empty_swap = capabilities_.using_partial_swap || |
+ context_caps.gpu.commit_overlay_planes; |
DCHECK(!context_caps.gpu.iosurface || context_caps.gpu.texture_rectangle); |
@@ -2618,11 +2620,15 @@ void GLRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) { |
gfx::Rect(swap_buffer_rect_.x(), |
FlippedRootFramebuffer() ? flipped_y_pos_of_rect_bottom |
: swap_buffer_rect_.y(), |
- swap_buffer_rect_.width(), |
- swap_buffer_rect_.height()); |
+ swap_buffer_rect_.width(), swap_buffer_rect_.height()); |
} else { |
- compositor_frame.gl_frame_data->sub_buffer_rect = |
- gfx::Rect(output_surface_->SurfaceSize()); |
+ // Expand the swap rect to the full surface unless it's empty, and empty |
+ // swap is allowed. |
+ if (!swap_buffer_rect_.IsEmpty() || !capabilities_.allow_empty_swap) { |
+ compositor_frame.gl_frame_data->sub_buffer_rect = swap_buffer_rect_ = |
piman
2015/12/02 01:23:05
nit: only one statement per line.
I think you can
watk
2015/12/02 19:02:46
Done.
|
+ gfx::Rect(surface_size); |
+ } |
+ compositor_frame.gl_frame_data->sub_buffer_rect = swap_buffer_rect_; |
} |
output_surface_->SwapBuffers(&compositor_frame); |