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

Unified Diff: cc/output/gl_renderer.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::OutputSurface 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/direct_renderer.cc ('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/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 1677de1ccc083300f6b81dc0bac0e10da0dd545b..f6e1114aea362340d77d8cb3617743958a848a92 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2607,23 +2607,18 @@ void GLRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) {
compositor_frame.metadata = metadata;
compositor_frame.gl_frame_data = make_scoped_ptr(new GLFrameData);
compositor_frame.gl_frame_data->size = surface_size;
- if (capabilities_.using_partial_swap) {
- // If supported, we can save significant bandwidth by only swapping the
- // damaged/scissored region (clamped to the viewport).
- swap_buffer_rect_.Intersect(gfx::Rect(surface_size));
- int flipped_y_pos_of_rect_bottom = surface_size.height() -
- swap_buffer_rect_.y() -
- swap_buffer_rect_.height();
- compositor_frame.gl_frame_data->sub_buffer_rect =
- 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());
- } else {
- compositor_frame.gl_frame_data->sub_buffer_rect =
- gfx::Rect(output_surface_->SurfaceSize());
- }
+ // If supported, we can save significant bandwidth by only swapping the
+ // damaged/scissored region (clamped to the viewport). The surface can
+ // choose whether to do a full swap or partial swap.
piman 2015/11/19 21:22:04 If we do that we need to fix all the OutputSurface
+ swap_buffer_rect_.Intersect(gfx::Rect(surface_size));
+ int flipped_y_pos_of_rect_bottom = surface_size.height() -
+ swap_buffer_rect_.y() -
+ swap_buffer_rect_.height();
+ compositor_frame.gl_frame_data->sub_buffer_rect =
+ 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());
output_surface_->SwapBuffers(&compositor_frame);
// We always hold onto resources for an extra frame, to make sure we don't
« no previous file with comments | « cc/output/direct_renderer.cc ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698