Chromium Code Reviews| 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_VIEW_MANAGER_DISPLAY_MANAGER_H_ | 5 #ifndef SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_ |
| 6 #define SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_ | 6 #define SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 ~DefaultDisplayManager() override; | 60 ~DefaultDisplayManager() override; |
| 61 | 61 |
| 62 // DisplayManager: | 62 // DisplayManager: |
| 63 void Init(ConnectionManager* connection_manager) override; | 63 void Init(ConnectionManager* connection_manager) override; |
| 64 void SchedulePaint(const ServerView* view, const gfx::Rect& bounds) override; | 64 void SchedulePaint(const ServerView* view, const gfx::Rect& bounds) override; |
| 65 void SetViewportSize(const gfx::Size& size) override; | 65 void SetViewportSize(const gfx::Size& size) override; |
| 66 const mojo::ViewportMetrics& GetViewportMetrics() override; | 66 const mojo::ViewportMetrics& GetViewportMetrics() override; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 void OnCreatedNativeViewport(uint64_t native_viewport_id); | 69 void OnCreatedNativeViewport(uint64_t native_viewport_id); |
| 70 void OnSurfaceConnectionCreated(mojo::SurfacePtr surface, | |
| 71 uint32_t id_namespace); | |
| 72 void Draw(); | 70 void Draw(); |
| 73 | 71 |
| 74 // NativeViewportClient: | 72 // NativeViewportClient: |
| 75 void OnDestroyed() override; | 73 void OnDestroyed() override; |
| 76 void OnMetricsChanged(mojo::ViewportMetricsPtr metrics) override; | 74 void OnMetricsChanged(mojo::ViewportMetricsPtr metrics) override; |
| 77 | 75 |
| 78 // SurfaceClient: | 76 // SurfaceClient: |
| 79 void SetIdNamespace(uint32_t id_namespace) override; | 77 void SetIdNamespace(uint32_t id_namespace) override; |
| 80 void ReturnResources( | 78 void ReturnResources( |
| 81 mojo::Array<mojo::ReturnedResourcePtr> resources) override; | 79 mojo::Array<mojo::ReturnedResourcePtr> resources) override; |
| 82 | 80 |
| 83 mojo::ApplicationConnection* app_connection_; | 81 mojo::ApplicationConnection* app_connection_; |
| 84 ConnectionManager* connection_manager_; | 82 ConnectionManager* connection_manager_; |
| 85 | 83 |
| 86 mojo::ViewportMetrics metrics_; | 84 mojo::ViewportMetrics metrics_; |
| 87 gfx::Rect dirty_rect_; | 85 gfx::Rect dirty_rect_; |
| 88 base::Timer draw_timer_; | 86 base::Timer draw_timer_; |
| 89 | 87 |
| 90 mojo::SurfacesServicePtr surfaces_service_; | |
| 91 mojo::SurfacePtr surface_; | 88 mojo::SurfacePtr surface_; |
| 92 scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_; | 89 uint32_t id_namespace_; |
| 93 cc::SurfaceId surface_id_; | 90 uint32_t local_id_; |
|
sky
2015/01/13 18:14:27
Since local_id_ is only has two values, it seems l
jamesr
2015/01/14 01:50:30
Hmm, yeah that'd be better. Added surface_allocat
| |
| 94 mojo::NativeViewportPtr native_viewport_; | 91 mojo::NativeViewportPtr native_viewport_; |
| 95 mojo::Callback<void()> native_viewport_closed_callback_; | 92 mojo::Callback<void()> native_viewport_closed_callback_; |
| 96 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; | 93 base::WeakPtrFactory<DefaultDisplayManager> weak_factory_; |
| 97 | 94 |
| 98 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); | 95 DISALLOW_COPY_AND_ASSIGN(DefaultDisplayManager); |
| 99 }; | 96 }; |
| 100 | 97 |
| 101 } // namespace view_manager | 98 } // namespace view_manager |
| 102 | 99 |
| 103 #endif // SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_ | 100 #endif // SERVICES_VIEW_MANAGER_DISPLAY_MANAGER_H_ |
| OLD | NEW |