| 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_COMPOSITOR_DELEGATED_FRAME_HOST_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ |
| 6 #define CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ |
| 7 | 7 |
| 8 #include "cc/layers/delegated_frame_provider.h" | 8 #include "cc/layers/delegated_frame_provider.h" |
| 9 #include "cc/layers/delegated_frame_resource_collection.h" | 9 #include "cc/layers/delegated_frame_resource_collection.h" |
| 10 #include "cc/output/copy_output_result.h" | 10 #include "cc/output/copy_output_result.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 int output_surface_id, | 58 int output_surface_id, |
| 59 const cc::CompositorFrameAck& ack) = 0; | 59 const cc::CompositorFrameAck& ack) = 0; |
| 60 virtual void DelegatedFrameHostSendReclaimCompositorResources( | 60 virtual void DelegatedFrameHostSendReclaimCompositorResources( |
| 61 int output_surface_id, | 61 int output_surface_id, |
| 62 const cc::CompositorFrameAck& ack) = 0; | 62 const cc::CompositorFrameAck& ack) = 0; |
| 63 virtual void DelegatedFrameHostOnLostCompositorResources() = 0; | 63 virtual void DelegatedFrameHostOnLostCompositorResources() = 0; |
| 64 | 64 |
| 65 virtual void DelegatedFrameHostUpdateVSyncParameters( | 65 virtual void DelegatedFrameHostUpdateVSyncParameters( |
| 66 const base::TimeTicks& timebase, | 66 const base::TimeTicks& timebase, |
| 67 const base::TimeDelta& interval) = 0; | 67 const base::TimeDelta& interval) = 0; |
| 68 |
| 69 virtual void DelegatedFrameHostUpdateSurfaceIdNamespace( |
| 70 uint32_t surface_id_namespace) = 0; |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state | 73 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state |
| 71 // and functionality that is associated with delegated frames being sent from | 74 // and functionality that is associated with delegated frames being sent from |
| 72 // the RenderWidget. The DelegatedFrameHost will push these changes through to | 75 // the RenderWidget. The DelegatedFrameHost will push these changes through to |
| 73 // the ui::Compositor associated with its DelegatedFrameHostClient. | 76 // the ui::Compositor associated with its DelegatedFrameHostClient. |
| 74 class CONTENT_EXPORT DelegatedFrameHost | 77 class CONTENT_EXPORT DelegatedFrameHost |
| 75 : public ui::CompositorObserver, | 78 : public ui::CompositorObserver, |
| 76 public ui::CompositorVSyncManager::Observer, | 79 public ui::CompositorVSyncManager::Observer, |
| 77 public ui::LayerOwnerDelegate, | 80 public ui::LayerOwnerDelegate, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 108 void CopyFromCompositingSurfaceToVideoFrame( | 111 void CopyFromCompositingSurfaceToVideoFrame( |
| 109 const gfx::Rect& src_subrect, | 112 const gfx::Rect& src_subrect, |
| 110 const scoped_refptr<media::VideoFrame>& target, | 113 const scoped_refptr<media::VideoFrame>& target, |
| 111 const base::Callback<void(bool)>& callback); | 114 const base::Callback<void(bool)>& callback); |
| 112 bool CanCopyToVideoFrame() const; | 115 bool CanCopyToVideoFrame() const; |
| 113 bool CanSubscribeFrame() const; | 116 bool CanSubscribeFrame() const; |
| 114 void BeginFrameSubscription( | 117 void BeginFrameSubscription( |
| 115 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber); | 118 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber); |
| 116 void EndFrameSubscription(); | 119 void EndFrameSubscription(); |
| 117 bool HasFrameSubscriber() const { return frame_subscriber_; } | 120 bool HasFrameSubscriber() const { return frame_subscriber_; } |
| 121 uint32_t GetSurfaceIdNamespace(); |
| 118 | 122 |
| 119 // Exposed for tests. | 123 // Exposed for tests. |
| 120 cc::DelegatedFrameProvider* FrameProviderForTesting() const { | 124 cc::DelegatedFrameProvider* FrameProviderForTesting() const { |
| 121 return frame_provider_.get(); | 125 return frame_provider_.get(); |
| 122 } | 126 } |
| 123 cc::SurfaceId SurfaceIdForTesting() const { return surface_id_; } | 127 cc::SurfaceId SurfaceIdForTesting() const { return surface_id_; } |
| 124 void OnCompositingDidCommitForTesting(ui::Compositor* compositor) { | 128 void OnCompositingDidCommitForTesting(ui::Compositor* compositor) { |
| 125 OnCompositingDidCommit(compositor); | 129 OnCompositingDidCommit(compositor); |
| 126 } | 130 } |
| 127 bool ReleasedFrontLockActiveForTesting() const { | 131 bool ReleasedFrontLockActiveForTesting() const { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // YUV readback pipeline. | 324 // YUV readback pipeline. |
| 321 scoped_ptr<content::ReadbackYUVInterface> | 325 scoped_ptr<content::ReadbackYUVInterface> |
| 322 yuv_readback_pipeline_; | 326 yuv_readback_pipeline_; |
| 323 | 327 |
| 324 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 328 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 325 }; | 329 }; |
| 326 | 330 |
| 327 } // namespace content | 331 } // namespace content |
| 328 | 332 |
| 329 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ | 333 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |