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