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 "mojo/cc/output_surface_mojo.h" | 5 #include "mojo/cc/output_surface_mojo.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/output_surface_client.h" | 9 #include "cc/output/output_surface_client.h" |
10 #include "mojo/converters/geometry/geometry_type_converters.h" | 10 #include "mojo/converters/geometry/geometry_type_converters.h" |
11 #include "mojo/converters/surfaces/surfaces_type_converters.h" | 11 #include "mojo/converters/surfaces/surfaces_type_converters.h" |
12 | 12 |
13 namespace mojo { | 13 namespace mojo { |
14 | 14 |
15 OutputSurfaceMojo::OutputSurfaceMojo( | 15 OutputSurfaceMojo::OutputSurfaceMojo( |
16 OutputSurfaceMojoClient* client, | 16 OutputSurfaceMojoClient* client, |
17 const scoped_refptr<cc::ContextProvider>& context_provider, | 17 const scoped_refptr<cc::ContextProvider>& context_provider, |
18 const scoped_refptr<cc::ContextProvider>& worker_context_provider, | |
19 ScopedMessagePipeHandle surface_handle) | 18 ScopedMessagePipeHandle surface_handle) |
20 : cc::OutputSurface(context_provider, worker_context_provider), | 19 : cc::OutputSurface(context_provider), |
21 output_surface_mojo_client_(client), | 20 output_surface_mojo_client_(client), |
22 surface_handle_(surface_handle.Pass()), | 21 surface_handle_(surface_handle.Pass()), |
23 id_namespace_(0u), | 22 id_namespace_(0u), |
24 local_id_(0u) { | 23 local_id_(0u) { |
25 capabilities_.delegated_rendering = true; | 24 capabilities_.delegated_rendering = true; |
26 capabilities_.max_frames_pending = 1; | 25 capabilities_.max_frames_pending = 1; |
27 } | 26 } |
28 | 27 |
29 OutputSurfaceMojo::~OutputSurfaceMojo() { | 28 OutputSurfaceMojo::~OutputSurfaceMojo() { |
30 } | 29 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 surface_size_ = frame_size; | 61 surface_size_ = frame_size; |
63 } | 62 } |
64 | 63 |
65 surface_->SubmitFrame(local_id_, Frame::From(*frame), mojo::Closure()); | 64 surface_->SubmitFrame(local_id_, Frame::From(*frame), mojo::Closure()); |
66 | 65 |
67 client_->DidSwapBuffers(); | 66 client_->DidSwapBuffers(); |
68 client_->DidSwapBuffersComplete(); | 67 client_->DidSwapBuffersComplete(); |
69 } | 68 } |
70 | 69 |
71 } // namespace mojo | 70 } // namespace mojo |
OLD | NEW |