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/services/surfaces/surfaces_service_application.h" | 5 #include "mojo/services/surfaces/surfaces_service_application.h" |
6 | 6 |
7 #include "cc/surfaces/display.h" | 7 #include "cc/surfaces/display.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 namespace surfaces { | 10 namespace surfaces { |
11 | 11 |
12 SurfacesServiceApplication::SurfacesServiceApplication() | 12 SurfacesServiceApplication::SurfacesServiceApplication() |
13 : next_id_namespace_(1u), display_(NULL) { | 13 : next_id_namespace_(1u), display_(NULL) { |
14 } | 14 } |
15 | 15 |
16 SurfacesServiceApplication::~SurfacesServiceApplication() { | 16 SurfacesServiceApplication::~SurfacesServiceApplication() { |
17 } | 17 } |
18 | 18 |
19 bool SurfacesServiceApplication::ConfigureIncomingConnection( | 19 bool SurfacesServiceApplication::ConfigureIncomingConnection( |
20 ApplicationConnection* connection) { | 20 ApplicationConnection* connection) { |
21 connection->AddService<SurfacesImpl, SurfacesImpl::Context>(this); | 21 connection->AddService(this); |
22 return true; | 22 return true; |
23 } | 23 } |
24 | 24 |
25 cc::SurfaceManager* SurfacesServiceApplication::Manager() { | 25 void SurfacesServiceApplication::Create(ApplicationConnection* connection, |
26 return &manager_; | 26 InterfaceRequest<Surface> request) { |
27 } | 27 BindToRequest(new SurfacesImpl(&manager_, next_id_namespace_++, this), |
28 | 28 &request); |
29 uint32_t SurfacesServiceApplication::IdNamespace() { | |
30 return next_id_namespace_++; | |
31 } | 29 } |
32 | 30 |
33 void SurfacesServiceApplication::FrameSubmitted() { | 31 void SurfacesServiceApplication::FrameSubmitted() { |
34 if (display_) | 32 if (display_) |
35 display_->Draw(); | 33 display_->Draw(); |
36 } | 34 } |
37 | 35 |
38 void SurfacesServiceApplication::SetDisplay(cc::Display* display) { | 36 void SurfacesServiceApplication::SetDisplay(cc::Display* display) { |
39 display_ = display; | 37 display_ = display; |
40 } | 38 } |
41 | 39 |
42 } // namespace surfaces | 40 } // namespace surfaces |
43 | 41 |
44 // static | 42 // static |
45 ApplicationDelegate* ApplicationDelegate::Create() { | 43 ApplicationDelegate* ApplicationDelegate::Create() { |
46 return new surfaces::SurfacesServiceApplication; | 44 return new surfaces::SurfacesServiceApplication; |
47 } | 45 } |
48 | 46 |
49 } // namespace mojo | 47 } // namespace mojo |
OLD | NEW |