| 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 CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // the ui::Compositor associated with its DelegatedFrameHostClient. | 84 // the ui::Compositor associated with its DelegatedFrameHostClient. |
| 85 class CONTENT_EXPORT DelegatedFrameHost | 85 class CONTENT_EXPORT DelegatedFrameHost |
| 86 : public ui::CompositorObserver, | 86 : public ui::CompositorObserver, |
| 87 public ui::CompositorVSyncManager::Observer, | 87 public ui::CompositorVSyncManager::Observer, |
| 88 public ui::LayerOwnerDelegate, | 88 public ui::LayerOwnerDelegate, |
| 89 public ui::ContextFactoryObserver, | 89 public ui::ContextFactoryObserver, |
| 90 public DelegatedFrameEvictorClient, | 90 public DelegatedFrameEvictorClient, |
| 91 public cc::SurfaceFactoryClient, | 91 public cc::SurfaceFactoryClient, |
| 92 public base::SupportsWeakPtr<DelegatedFrameHost> { | 92 public base::SupportsWeakPtr<DelegatedFrameHost> { |
| 93 public: | 93 public: |
| 94 explicit DelegatedFrameHost(DelegatedFrameHostClient* client); | 94 DelegatedFrameHost(const cc::FrameSinkId& frame_sink_id, |
| 95 DelegatedFrameHostClient* client); |
| 95 ~DelegatedFrameHost() override; | 96 ~DelegatedFrameHost() override; |
| 96 | 97 |
| 97 // ui::CompositorObserver implementation. | 98 // ui::CompositorObserver implementation. |
| 98 void OnCompositingDidCommit(ui::Compositor* compositor) override; | 99 void OnCompositingDidCommit(ui::Compositor* compositor) override; |
| 99 void OnCompositingStarted(ui::Compositor* compositor, | 100 void OnCompositingStarted(ui::Compositor* compositor, |
| 100 base::TimeTicks start_time) override; | 101 base::TimeTicks start_time) override; |
| 101 void OnCompositingEnded(ui::Compositor* compositor) override; | 102 void OnCompositingEnded(ui::Compositor* compositor) override; |
| 102 void OnCompositingAborted(ui::Compositor* compositor) override; | 103 void OnCompositingAborted(ui::Compositor* compositor) override; |
| 103 void OnCompositingLockStateChanged(ui::Compositor* compositor) override; | 104 void OnCompositingLockStateChanged(ui::Compositor* compositor) override; |
| 104 void OnCompositingShuttingDown(ui::Compositor* compositor) override; | 105 void OnCompositingShuttingDown(ui::Compositor* compositor) override; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 const gpu::SyncToken& sync_token); | 241 const gpu::SyncToken& sync_token); |
| 241 | 242 |
| 242 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, | 243 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, |
| 243 bool is_swap_ack); | 244 bool is_swap_ack); |
| 244 void SurfaceDrawn(uint32_t compositor_frame_sink_id); | 245 void SurfaceDrawn(uint32_t compositor_frame_sink_id); |
| 245 | 246 |
| 246 // Called to consult the current |frame_subscriber_|, to determine and maybe | 247 // Called to consult the current |frame_subscriber_|, to determine and maybe |
| 247 // initiate a copy-into-video-frame request. | 248 // initiate a copy-into-video-frame request. |
| 248 void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); | 249 void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); |
| 249 | 250 |
| 251 const cc::FrameSinkId frame_sink_id_; |
| 250 DelegatedFrameHostClient* const client_; | 252 DelegatedFrameHostClient* const client_; |
| 251 ui::Compositor* compositor_; | 253 ui::Compositor* compositor_; |
| 252 | 254 |
| 253 // The vsync manager we are observing for changes, if any. | 255 // The vsync manager we are observing for changes, if any. |
| 254 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | 256 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; |
| 255 | 257 |
| 256 // The current VSync timebase and interval. These are zero until the first | 258 // The current VSync timebase and interval. These are zero until the first |
| 257 // call to SetVSyncParameters(). | 259 // call to SetVSyncParameters(). |
| 258 base::TimeTicks vsync_timebase_; | 260 base::TimeTicks vsync_timebase_; |
| 259 base::TimeDelta vsync_interval_; | 261 base::TimeDelta vsync_interval_; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 // YUV readback pipeline. | 330 // YUV readback pipeline. |
| 329 std::unique_ptr<display_compositor::ReadbackYUVInterface> | 331 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
| 330 yuv_readback_pipeline_; | 332 yuv_readback_pipeline_; |
| 331 | 333 |
| 332 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 334 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 333 }; | 335 }; |
| 334 | 336 |
| 335 } // namespace content | 337 } // namespace content |
| 336 | 338 |
| 337 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 339 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |