| 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 #ifndef SERVICES_SURFACES_SURFACES_IMPL_H_ | 5 #ifndef SERVICES_SURFACES_SURFACES_IMPL_H_ |
| 6 #define SERVICES_SURFACES_SURFACES_IMPL_H_ | 6 #define SERVICES_SURFACES_SURFACES_IMPL_H_ |
| 7 | 7 |
| 8 #include "cc/surfaces/display_client.h" | 8 #include "cc/surfaces/display_client.h" |
| 9 #include "cc/surfaces/surface_factory.h" | 9 #include "cc/surfaces/surface_factory.h" |
| 10 #include "cc/surfaces/surface_factory_client.h" | 10 #include "cc/surfaces/surface_factory_client.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 mojo::InterfaceRequest<mojo::Surface> request); | 47 mojo::InterfaceRequest<mojo::Surface> request); |
| 48 | 48 |
| 49 SurfacesImpl(cc::SurfaceManager* manager, | 49 SurfacesImpl(cc::SurfaceManager* manager, |
| 50 uint32_t id_namespace, | 50 uint32_t id_namespace, |
| 51 Client* client, | 51 Client* client, |
| 52 mojo::SurfacePtr* surface); | 52 mojo::SurfacePtr* surface); |
| 53 | 53 |
| 54 ~SurfacesImpl() override; | 54 ~SurfacesImpl() override; |
| 55 | 55 |
| 56 // Surface implementation. | 56 // Surface implementation. |
| 57 void CreateSurface(mojo::SurfaceIdPtr id) override; | 57 void CreateSurface(uint32_t local_id) override; |
| 58 void SubmitFrame(mojo::SurfaceIdPtr id, | 58 void SubmitFrame(uint32_t local_id, |
| 59 mojo::FramePtr frame, | 59 mojo::FramePtr frame, |
| 60 const mojo::Closure& callback) override; | 60 const mojo::Closure& callback) override; |
| 61 void DestroySurface(mojo::SurfaceIdPtr id) override; | 61 void DestroySurface(uint32_t local_id) override; |
| 62 void CreateGLES2BoundSurface( | 62 void CreateGLES2BoundSurface( |
| 63 mojo::CommandBufferPtr gles2_client, | 63 mojo::CommandBufferPtr gles2_client, |
| 64 mojo::SurfaceIdPtr id, | 64 uint32_t local_id, |
| 65 mojo::SizePtr size, | 65 mojo::SizePtr size, |
| 66 mojo::InterfaceRequest<mojo::ViewportParameterListener> listener_request) | 66 mojo::InterfaceRequest<mojo::ViewportParameterListener> listener_request) |
| 67 override; | 67 override; |
| 68 | 68 |
| 69 // SurfaceFactoryClient implementation. | 69 // SurfaceFactoryClient implementation. |
| 70 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 70 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 71 | 71 |
| 72 // DisplayClient implementation. | 72 // DisplayClient implementation. |
| 73 void DisplayDamaged() override; | 73 void DisplayDamaged() override; |
| 74 void DidSwapBuffers() override; | 74 void DidSwapBuffers() override; |
| 75 void DidSwapBuffersComplete() override; | 75 void DidSwapBuffersComplete() override; |
| 76 void CommitVSyncParameters(base::TimeTicks timebase, | 76 void CommitVSyncParameters(base::TimeTicks timebase, |
| 77 base::TimeDelta interval) override; | 77 base::TimeDelta interval) override; |
| 78 void OutputSurfaceLost() override; | 78 void OutputSurfaceLost() override; |
| 79 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; | 79 void SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) override; |
| 80 | 80 |
| 81 // ViewportParameterListener | 81 // ViewportParameterListener |
| 82 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override; | 82 void OnVSyncParametersUpdated(int64_t timebase, int64_t interval) override; |
| 83 | 83 |
| 84 cc::SurfaceFactory* factory() { return &factory_; } | 84 cc::SurfaceFactory* factory() { return &factory_; } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 SurfacesImpl(cc::SurfaceManager* manager, | 87 SurfacesImpl(cc::SurfaceManager* manager, |
| 88 uint32_t id_namespace, | 88 uint32_t id_namespace, |
| 89 Client* client); | 89 Client* client); |
| 90 | 90 |
| 91 cc::SurfaceId QualifyIdentifier(uint32_t local_id); |
| 92 |
| 91 cc::SurfaceManager* manager_; | 93 cc::SurfaceManager* manager_; |
| 92 cc::SurfaceFactory factory_; | 94 cc::SurfaceFactory factory_; |
| 93 uint32_t id_namespace_; | 95 uint32_t id_namespace_; |
| 94 Client* client_; | 96 Client* client_; |
| 95 scoped_ptr<cc::Display> display_; | 97 scoped_ptr<cc::Display> display_; |
| 96 mojo::ScopedMessagePipeHandle command_buffer_handle_; | 98 mojo::ScopedMessagePipeHandle command_buffer_handle_; |
| 97 mojo::WeakBindingSet<ViewportParameterListener> parameter_listeners_; | 99 mojo::WeakBindingSet<ViewportParameterListener> parameter_listeners_; |
| 98 mojo::StrongBinding<Surface> binding_; | 100 mojo::StrongBinding<Surface> binding_; |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); | 102 DISALLOW_COPY_AND_ASSIGN(SurfacesImpl); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace surfaces | 105 } // namespace surfaces |
| 104 | 106 |
| 105 #endif // SERVICES_SURFACES_SURFACES_IMPL_H_ | 107 #endif // SERVICES_SURFACES_SURFACES_IMPL_H_ |
| OLD | NEW |