| Index: cc/output/gl_renderer.cc
|
| diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
|
| index 612c31564878454e01636cf365f22a615440907e..1340e9a4045d60bc01107014182115ca445939ed 100644
|
| --- a/cc/output/gl_renderer.cc
|
| +++ b/cc/output/gl_renderer.cc
|
| @@ -2447,9 +2447,9 @@ void GLRenderer::FinishDrawingFrame() {
|
| pending_sync_queries_.push_back(std::move(current_sync_query_));
|
| }
|
|
|
| - swap_buffer_rect_.Union(current_frame()->root_damage_rect);
|
| + damage_rect_.Union(current_frame()->root_damage_rect);
|
| if (overdraw_feedback_)
|
| - FlushOverdrawFeedback(swap_buffer_rect_);
|
| + FlushOverdrawFeedback(damage_rect_);
|
|
|
| if (use_swap_with_bounds_)
|
| swap_content_bounds_ = current_frame()->root_content_bounds;
|
| @@ -2617,22 +2617,24 @@ void GLRenderer::SwapBuffers(std::vector<ui::LatencyInfo> latency_info) {
|
| OutputSurfaceFrame output_frame;
|
| output_frame.latency_info = std::move(latency_info);
|
| output_frame.size = surface_size;
|
| + output_frame.damage_rect = damage_rect_;
|
| if (use_swap_with_bounds_) {
|
| output_frame.content_bounds = std::move(swap_content_bounds_);
|
| } else if (use_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));
|
| + gfx::Rect swap_buffer_rect = damage_rect_;
|
| + 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();
|
| + swap_buffer_rect.y() -
|
| + swap_buffer_rect.height();
|
| output_frame.sub_buffer_rect =
|
| - gfx::Rect(swap_buffer_rect_.x(),
|
| + 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 if (swap_buffer_rect_.IsEmpty() && allow_empty_swap_) {
|
| - output_frame.sub_buffer_rect = swap_buffer_rect_;
|
| + : swap_buffer_rect.y(),
|
| + swap_buffer_rect.width(), swap_buffer_rect.height());
|
| + } else if (damage_rect_.IsEmpty() && allow_empty_swap_) {
|
| + output_frame.sub_buffer_rect = gfx::Rect();
|
| }
|
|
|
| swapping_overlay_resources_.push_back(std::move(pending_overlay_resources_));
|
| @@ -2640,7 +2642,7 @@ void GLRenderer::SwapBuffers(std::vector<ui::LatencyInfo> latency_info) {
|
|
|
| output_surface_->SwapBuffers(std::move(output_frame));
|
|
|
| - swap_buffer_rect_ = gfx::Rect();
|
| + damage_rect_ = gfx::Rect();
|
| }
|
|
|
| void GLRenderer::SwapBuffersComplete() {
|
|
|