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

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: Addressed Dana's nits 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..79b58119c60ebef6169ac700ea1d9b1aa6eb3953 100644
--- a/cc/surfaces/surface_display_output_surface.cc
+++ b/cc/surfaces/surface_display_output_surface.cc
@@ -60,9 +60,9 @@ SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() {
DetachFromClient();
}
-void SurfaceDisplayOutputSurface::SwapBuffers(CompositorFrame* frame) {
+void SurfaceDisplayOutputSurface::SwapBuffers(CompositorFrame frame) {
gfx::Size frame_size =
- frame->delegated_frame_data->render_pass_list.back()->output_rect.size();
+ frame.delegated_frame_data->render_pass_list.back()->output_rect.size();
if (frame_size.IsEmpty() || frame_size != last_swap_frame_size_) {
if (!delegated_surface_id_.is_null()) {
factory_.Destroy(delegated_surface_id_);
@@ -72,12 +72,12 @@ void SurfaceDisplayOutputSurface::SwapBuffers(CompositorFrame* frame) {
last_swap_frame_size_ = frame_size;
}
display_->SetSurfaceId(delegated_surface_id_,
- frame->metadata.device_scale_factor);
+ frame.metadata.device_scale_factor);
client_->DidSwapBuffers();
- std::unique_ptr<CompositorFrame> frame_copy(new CompositorFrame());
- frame->AssignTo(frame_copy.get());
+ std::unique_ptr<CompositorFrame> frame_copy(new CompositorFrame);
+ *frame_copy = std::move(frame);
factory_.SubmitCompositorFrame(
delegated_surface_id_, std::move(frame_copy),
base::Bind(&SurfaceDisplayOutputSurface::SwapBuffersComplete,
« no previous file with comments | « cc/surfaces/surface_display_output_surface.h ('k') | cc/surfaces/surface_display_output_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698