| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |