| 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; | 17 class ClientImageSerializationProcessor; |
| 18 | 18 |
| 19 class BlimpCompositorManagerClient { | 19 class BlimpCompositorManagerClient { |
| 20 public: | 20 public: |
| 21 virtual void OnSwapBuffersCompleted() = 0; | 21 virtual void OnSwapBuffersCompleted() = 0; |
| 22 virtual void DidCommitAndDrawFrame() = 0; |
| 22 }; | 23 }; |
| 23 | 24 |
| 24 // The BlimpCompositorManager manages multiple BlimpCompositor instances, each | 25 // The BlimpCompositorManager manages multiple BlimpCompositor instances, each |
| 25 // mapped to a render widget on the engine. The compositor corresponding to | 26 // mapped to a render widget on the engine. The compositor corresponding to |
| 26 // the render widget initialized on the engine will be the |active_compositor_|. | 27 // the render widget initialized on the engine will be the |active_compositor_|. |
| 27 // Only the |active_compositor_| holds the accelerated widget and builds the | 28 // Only the |active_compositor_| holds the accelerated widget and builds the |
| 28 // output surface from this widget to draw to the view. All events from the | 29 // output surface from this widget to draw to the view. All events from the |
| 29 // native view are forwarded to this compositor. | 30 // native view are forwarded to this compositor. |
| 30 class BlimpCompositorManager | 31 class BlimpCompositorManager |
| 31 : public RenderWidgetFeature::RenderWidgetFeatureDelegate, | 32 : public RenderWidgetFeature::RenderWidgetFeatureDelegate, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // RenderWidgetFeatureDelegate implementation. | 64 // RenderWidgetFeatureDelegate implementation. |
| 64 void OnRenderWidgetCreated(int render_widget_id) override; | 65 void OnRenderWidgetCreated(int render_widget_id) override; |
| 65 void OnRenderWidgetInitialized(int render_widget_id) override; | 66 void OnRenderWidgetInitialized(int render_widget_id) override; |
| 66 void OnRenderWidgetDeleted(int render_widget_id) override; | 67 void OnRenderWidgetDeleted(int render_widget_id) override; |
| 67 void OnCompositorMessageReceived( | 68 void OnCompositorMessageReceived( |
| 68 int render_widget_id, | 69 int render_widget_id, |
| 69 std::unique_ptr<cc::proto::CompositorMessage> message) override; | 70 std::unique_ptr<cc::proto::CompositorMessage> message) override; |
| 70 | 71 |
| 71 // BlimpCompositorClient implementation. | 72 // BlimpCompositorClient implementation. |
| 72 void DidCompleteSwapBuffers() override; | 73 void DidCompleteSwapBuffers() override; |
| 74 void DidCommitAndDrawFrame() override; |
| 73 cc::LayerTreeSettings* GetLayerTreeSettings() override; | 75 cc::LayerTreeSettings* GetLayerTreeSettings() override; |
| 74 scoped_refptr<base::SingleThreadTaskRunner> | 76 scoped_refptr<base::SingleThreadTaskRunner> |
| 75 GetCompositorTaskRunner() override; | 77 GetCompositorTaskRunner() override; |
| 76 cc::TaskGraphRunner* GetTaskGraphRunner() override; | 78 cc::TaskGraphRunner* GetTaskGraphRunner() override; |
| 77 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 79 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
| 78 cc::ImageSerializationProcessor* GetImageSerializationProcessor() override; | 80 cc::ImageSerializationProcessor* GetImageSerializationProcessor() override; |
| 79 void SendWebGestureEvent( | 81 void SendWebGestureEvent( |
| 80 int render_widget_id, | 82 int render_widget_id, |
| 81 const blink::WebGestureEvent& gesture_event) override; | 83 const blink::WebGestureEvent& gesture_event) override; |
| 82 void SendCompositorMessage( | 84 void SendCompositorMessage( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 RenderWidgetFeature* render_widget_feature_; | 116 RenderWidgetFeature* render_widget_feature_; |
| 115 BlimpCompositorManagerClient* client_; | 117 BlimpCompositorManagerClient* client_; |
| 116 | 118 |
| 117 DISALLOW_COPY_AND_ASSIGN(BlimpCompositorManager); | 119 DISALLOW_COPY_AND_ASSIGN(BlimpCompositorManager); |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace client | 122 } // namespace client |
| 121 } // namespace blimp | 123 } // namespace blimp |
| 122 | 124 |
| 123 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_COMPOSITOR_MANAGER_H_ | 125 #endif // BLIMP_CLIENT_FEATURE_COMPOSITOR_BLIMP_COMPOSITOR_MANAGER_H_ |
| OLD | NEW |