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

Side by Side Diff: cc/surfaces/surface_display_output_surface.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/surfaces/surface_display_output_surface.h" 5 #include "cc/surfaces/surface_display_output_surface.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/output/compositor_frame_ack.h" 9 #include "cc/output/compositor_frame_ack.h"
10 #include "cc/surfaces/display.h" 10 #include "cc/surfaces/display.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 surface_id_ = allocator_->GenerateId(); 57 surface_id_ = allocator_->GenerateId();
58 factory_.Create(surface_id_); 58 factory_.Create(surface_id_);
59 display_size_ = frame_size; 59 display_size_ = frame_size;
60 } 60 }
61 display_client_->display()->SetSurfaceId(surface_id_, 61 display_client_->display()->SetSurfaceId(surface_id_,
62 frame->metadata.device_scale_factor); 62 frame->metadata.device_scale_factor);
63 63
64 client_->DidSwapBuffers(); 64 client_->DidSwapBuffers();
65 65
66 scoped_ptr<CompositorFrame> frame_copy(new CompositorFrame()); 66 std::unique_ptr<CompositorFrame> frame_copy(new CompositorFrame());
67 frame->AssignTo(frame_copy.get()); 67 frame->AssignTo(frame_copy.get());
68 factory_.SubmitCompositorFrame( 68 factory_.SubmitCompositorFrame(
69 surface_id_, std::move(frame_copy), 69 surface_id_, std::move(frame_copy),
70 base::Bind(&SurfaceDisplayOutputSurface::SwapBuffersComplete, 70 base::Bind(&SurfaceDisplayOutputSurface::SwapBuffersComplete,
71 base::Unretained(this))); 71 base::Unretained(this)));
72 } 72 }
73 73
74 bool SurfaceDisplayOutputSurface::BindToClient(OutputSurfaceClient* client) { 74 bool SurfaceDisplayOutputSurface::BindToClient(OutputSurfaceClient* client) {
75 DCHECK(client); 75 DCHECK(client);
76 DCHECK(display_client_); 76 DCHECK(display_client_);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 BeginFrameSource* begin_frame_source) { 111 BeginFrameSource* begin_frame_source) {
112 // TODO(tansell): Hook this up. 112 // TODO(tansell): Hook this up.
113 } 113 }
114 114
115 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) { 115 void SurfaceDisplayOutputSurface::SwapBuffersComplete(SurfaceDrawStatus drawn) {
116 if (client_ && !display_client_->output_surface_lost()) 116 if (client_ && !display_client_->output_surface_lost())
117 client_->DidSwapBuffersComplete(); 117 client_->DidSwapBuffersComplete();
118 } 118 }
119 119
120 } // namespace cc 120 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_aggregator_unittest.cc ('k') | cc/surfaces/surface_display_output_surface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698