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

Unified Diff: cc/surfaces/surface_display_output_surface.cc

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix reflector Created 4 years, 6 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: cc/surfaces/surface_display_output_surface.cc
diff --git a/cc/surfaces/surface_display_output_surface.cc b/cc/surfaces/surface_display_output_surface.cc
index 397cf2fddd2c9a6e5f8af0029f05e573dab8ce33..dd89c521d1dfc07adcec726c67d8f0a4d7036e94 100644
--- a/cc/surfaces/surface_display_output_surface.cc
+++ b/cc/surfaces/surface_display_output_surface.cc
@@ -60,7 +60,8 @@ SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() {
DetachFromClient();
}
-void SurfaceDisplayOutputSurface::SwapBuffers(CompositorFrame* frame) {
+void SurfaceDisplayOutputSurface::SwapBuffers(
+ std::unique_ptr<CompositorFrame> frame) {
gfx::Size frame_size =
frame->delegated_frame_data->render_pass_list.back()->output_rect.size();
if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) {
@@ -76,10 +77,8 @@ void SurfaceDisplayOutputSurface::SwapBuffers(CompositorFrame* frame) {
client_->DidSwapBuffers();
- std::unique_ptr<CompositorFrame> frame_copy(new CompositorFrame());
- frame->AssignTo(frame_copy.get());
factory_.SubmitCompositorFrame(
- delegated_surface_id_, std::move(frame_copy),
+ delegated_surface_id_, std::move(frame),
base::Bind(&SurfaceDisplayOutputSurface::SwapBuffersComplete,
base::Unretained(this)));
}

Powered by Google App Engine
This is Rietveld 408576698