| Index: content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
|
| diff --git a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
|
| index e0464b673542e0bb869c817602abb29885aa64ba..3a0e0915ad720f2b683bc4bd1be010346c09acc9 100644
|
| --- a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
|
| +++ b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
|
| @@ -63,7 +63,7 @@ bool GpuSurfacelessBrowserCompositorOutputSurface::IsDisplayedAsOverlayPlane()
|
|
|
| unsigned GpuSurfacelessBrowserCompositorOutputSurface::GetOverlayTextureId()
|
| const {
|
| - return buffer_queue_->current_texture_id();
|
| + return buffer_queue_->GetCurrentTextureId();
|
| }
|
|
|
| void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(
|
| @@ -73,8 +73,15 @@ void GpuSurfacelessBrowserCompositorOutputSurface::SwapBuffers(
|
| // TODO(ccameron): What if a swap comes again before OnGpuSwapBuffersCompleted
|
| // happens, we'd see the wrong swap size there?
|
| swap_size_ = reshape_size_;
|
| - buffer_queue_->SwapBuffers(frame.sub_buffer_rect ? *frame.sub_buffer_rect
|
| - : gfx::Rect(swap_size_));
|
| +
|
| + gfx::Rect damage_rect =
|
| + frame.sub_buffer_rect ? *frame.sub_buffer_rect : gfx::Rect(swap_size_);
|
| + // Use previous buffer when damage rect is empty. This avoids unnecessary
|
| + // partial swap work and makes it possible to support empty swaps on devices
|
| + // where partial swaps are disabled.
|
| + if (!damage_rect.IsEmpty())
|
| + buffer_queue_->SwapBuffers(damage_rect);
|
| +
|
| GpuBrowserCompositorOutputSurface::SwapBuffers(std::move(frame));
|
| }
|
|
|
|
|