| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_COMPOSITOR_MANAGER_H_ | 5 #ifndef BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_COMPOSITOR_MANAGER_H_ |
| 6 #define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_COMPOSITOR_MANAGER_H_ | 6 #define BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_COMPOSITOR_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "blimp/client/feature/compositor/blimp_compositor.h" | 9 #include "blimp/client/feature/compositor/blimp_compositor.h" |
| 10 #include "blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h" | 10 #include "blimp/client/feature/compositor/blimp_gpu_memory_buffer_manager.h" |
| 11 #include "blimp/client/feature/render_widget_feature.h" | 11 #include "blimp/client/feature/render_widget_feature.h" |
| 12 #include "cc/trees/layer_tree_settings.h" | 12 #include "cc/trees/layer_tree_settings.h" |
| 13 | 13 |
| 14 namespace blimp { | 14 namespace blimp { |
| 15 namespace client { | 15 namespace client { |
| 16 | 16 |
| 17 class ClientImageSerializationProcessor; |
| 18 |
| 17 class BlimpCompositorManagerClient { | 19 class BlimpCompositorManagerClient { |
| 18 public: | 20 public: |
| 19 virtual void OnSwapBuffersCompleted() = 0; | 21 virtual void OnSwapBuffersCompleted() = 0; |
| 20 }; | 22 }; |
| 21 | 23 |
| 22 // The BlimpCompositorManager manages multiple BlimpCompositor instances, each | 24 // The BlimpCompositorManager manages multiple BlimpCompositor instances, each |
| 23 // mapped to a render widget on the engine. The compositor corresponding to | 25 // mapped to a render widget on the engine. The compositor corresponding to |
| 24 // the render widget initialized on the engine will be the |active_compositor_|. | 26 // the render widget initialized on the engine will be the |active_compositor_|. |
| 25 // Only the |active_compositor_| holds the accelerated widget and builds the | 27 // Only the |active_compositor_| holds the accelerated widget and builds the |
| 26 // output surface from this widget to draw to the view. All events from the | 28 // output surface from this widget to draw to the view. All events from the |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 85 |
| 84 bool visible_; | 86 bool visible_; |
| 85 | 87 |
| 86 gfx::AcceleratedWidget window_; | 88 gfx::AcceleratedWidget window_; |
| 87 | 89 |
| 88 std::unique_ptr<cc::LayerTreeSettings> settings_; | 90 std::unique_ptr<cc::LayerTreeSettings> settings_; |
| 89 | 91 |
| 90 std::unique_ptr<BlimpGpuMemoryBufferManager> gpu_memory_buffer_manager_; | 92 std::unique_ptr<BlimpGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| 91 | 93 |
| 92 // Provides the functionality to deserialize images in SkPicture. | 94 // Provides the functionality to deserialize images in SkPicture. |
| 93 std::unique_ptr<BlimpImageSerializationProcessor> | 95 std::unique_ptr<ClientImageSerializationProcessor> |
| 94 image_serialization_processor_; | 96 image_serialization_processor_; |
| 95 | 97 |
| 96 // A map of render_widget_ids to the BlimpCompositor instance. | 98 // A map of render_widget_ids to the BlimpCompositor instance. |
| 97 typedef std::map<int, std::unique_ptr<BlimpCompositor>> CompositorMap; | 99 typedef std::map<int, std::unique_ptr<BlimpCompositor>> CompositorMap; |
| 98 CompositorMap compositors_; | 100 CompositorMap compositors_; |
| 99 | 101 |
| 100 // The |active_compositor_| represents the compositor from the CompositorMap | 102 // The |active_compositor_| represents the compositor from the CompositorMap |
| 101 // that is currently visible and has the |window_|. It corresponds to the | 103 // that is currently visible and has the |window_|. It corresponds to the |
| 102 // render widget currently initialized on the engine. | 104 // render widget currently initialized on the engine. |
| 103 BlimpCompositor* active_compositor_; | 105 BlimpCompositor* active_compositor_; |
| 104 | 106 |
| 105 // Lazily created thread that will run the compositor rendering tasks and will | 107 // Lazily created thread that will run the compositor rendering tasks and will |
| 106 // be shared by all compositor instances. | 108 // be shared by all compositor instances. |
| 107 std::unique_ptr<base::Thread> compositor_thread_; | 109 std::unique_ptr<base::Thread> compositor_thread_; |
| 108 | 110 |
| 109 // The bridge to the network layer that does the proto/RenderWidget id work. | 111 // The bridge to the network layer that does the proto/RenderWidget id work. |
| 110 // BlimpCompositorManager does not own this and it is expected to outlive this | 112 // BlimpCompositorManager does not own this and it is expected to outlive this |
| 111 // BlimpCompositorManager instance. | 113 // BlimpCompositorManager instance. |
| 112 RenderWidgetFeature* render_widget_feature_; | 114 RenderWidgetFeature* render_widget_feature_; |
| 113 BlimpCompositorManagerClient* client_; | 115 BlimpCompositorManagerClient* client_; |
| 114 | 116 |
| 115 DISALLOW_COPY_AND_ASSIGN(BlimpCompositorManager); | 117 DISALLOW_COPY_AND_ASSIGN(BlimpCompositorManager); |
| 116 }; | 118 }; |
| 117 | 119 |
| 118 } // namespace client | 120 } // namespace client |
| 119 } // namespace blimp | 121 } // namespace blimp |
| 120 | 122 |
| 121 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_COMPOSITOR_MANAGER_H_ | 123 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_COMPOSITOR_MANAGER_H_ |
| OLD | NEW |