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

Unified Diff: content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc

Issue 2699173002: cc: Make OutputSurfaceFrame::sub_buffer_rect optional (Closed)
Patch Set: Created 3 years, 10 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
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 a6e74153846a66c1dc4af81bd75b42773287d2e1..ab748723e3416f0eb148ab723fb5ebf6c0761c89 100644
--- a/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
+++ b/content/browser/compositor/gpu_surfaceless_browser_compositor_output_surface.cc
@@ -73,7 +73,11 @@ 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);
+ gfx::Rect damage(swap_size_);
+ if (frame.sub_buffer_rect) {
danakj 2017/02/22 00:36:57 no {} :)
+ damage = *frame.sub_buffer_rect;
+ }
+ buffer_queue_->SwapBuffers(damage);
danakj 2017/02/22 00:36:57 it might be more readable with a ternary buffer
halliwell 2017/02/22 14:19:28 I prefer the ternary form, yes.
GpuBrowserCompositorOutputSurface::SwapBuffers(std::move(frame));
}

Powered by Google App Engine
This is Rietveld 408576698