| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 base::TimeDelta interval) override; | 106 base::TimeDelta interval) override; |
| 107 | 107 |
| 108 // ImageTransportFactoryObserver implementation. | 108 // ImageTransportFactoryObserver implementation. |
| 109 void OnLostResources() override; | 109 void OnLostResources() override; |
| 110 | 110 |
| 111 // DelegatedFrameEvictorClient implementation. | 111 // DelegatedFrameEvictorClient implementation. |
| 112 void EvictDelegatedFrame() override; | 112 void EvictDelegatedFrame() override; |
| 113 | 113 |
| 114 // cc::SurfaceFactoryClient implementation. | 114 // cc::SurfaceFactoryClient implementation. |
| 115 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 115 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 116 void WillDrawSurface(const cc::LocalFrameId& id, | 116 void WillDrawSurface(const cc::LocalSurfaceId& id, |
| 117 const gfx::Rect& damage_rect) override; | 117 const gfx::Rect& damage_rect) override; |
| 118 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; | 118 void SetBeginFrameSource(cc::BeginFrameSource* begin_frame_source) override; |
| 119 | 119 |
| 120 bool CanCopyToBitmap() const; | 120 bool CanCopyToBitmap() const; |
| 121 | 121 |
| 122 // Public interface exposed to RenderWidgetHostView. | 122 // Public interface exposed to RenderWidgetHostView. |
| 123 | 123 |
| 124 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id, | 124 void SwapDelegatedFrame(uint32_t compositor_frame_sink_id, |
| 125 cc::CompositorFrame frame); | 125 cc::CompositorFrame frame); |
| 126 void ClearDelegatedFrame(); | 126 void ClearDelegatedFrame(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // contained within this class' Surface, find the relative transform between | 165 // contained within this class' Surface, find the relative transform between |
| 166 // the Surfaces and apply it to a point. Returns false if a Surface has not | 166 // the Surfaces and apply it to a point. Returns false if a Surface has not |
| 167 // yet been created or if |target_view| is not a descendant RWHV from our | 167 // yet been created or if |target_view| is not a descendant RWHV from our |
| 168 // client. | 168 // client. |
| 169 bool TransformPointToCoordSpaceForView(const gfx::Point& point, | 169 bool TransformPointToCoordSpaceForView(const gfx::Point& point, |
| 170 RenderWidgetHostViewBase* target_view, | 170 RenderWidgetHostViewBase* target_view, |
| 171 gfx::Point* transformed_point); | 171 gfx::Point* transformed_point); |
| 172 | 172 |
| 173 // Exposed for tests. | 173 // Exposed for tests. |
| 174 cc::SurfaceId SurfaceIdForTesting() const { | 174 cc::SurfaceId SurfaceIdForTesting() const { |
| 175 return cc::SurfaceId(frame_sink_id_, local_frame_id_); | 175 return cc::SurfaceId(frame_sink_id_, local_surface_id_); |
| 176 } | 176 } |
| 177 | 177 |
| 178 const cc::LocalFrameId& LocalFrameIdForTesting() const { | 178 const cc::LocalSurfaceId& LocalSurfaceIdForTesting() const { |
| 179 return local_frame_id_; | 179 return local_surface_id_; |
| 180 } | 180 } |
| 181 | 181 |
| 182 void OnCompositingDidCommitForTesting(ui::Compositor* compositor) { | 182 void OnCompositingDidCommitForTesting(ui::Compositor* compositor) { |
| 183 OnCompositingDidCommit(compositor); | 183 OnCompositingDidCommit(compositor); |
| 184 } | 184 } |
| 185 bool ReleasedFrontLockActiveForTesting() const { | 185 bool ReleasedFrontLockActiveForTesting() const { |
| 186 return !!released_front_lock_.get(); | 186 return !!released_front_lock_.get(); |
| 187 } | 187 } |
| 188 void SetRequestCopyOfOutputCallbackForTesting( | 188 void SetRequestCopyOfOutputCallbackForTesting( |
| 189 const base::Callback<void(std::unique_ptr<cc::CopyOutputRequest>)>& | 189 const base::Callback<void(std::unique_ptr<cc::CopyOutputRequest>)>& |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 244 |
| 245 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, | 245 void SendReclaimCompositorResources(uint32_t compositor_frame_sink_id, |
| 246 bool is_swap_ack); | 246 bool is_swap_ack); |
| 247 void SurfaceDrawn(uint32_t compositor_frame_sink_id); | 247 void SurfaceDrawn(uint32_t compositor_frame_sink_id); |
| 248 | 248 |
| 249 // Called to consult the current |frame_subscriber_|, to determine and maybe | 249 // Called to consult the current |frame_subscriber_|, to determine and maybe |
| 250 // initiate a copy-into-video-frame request. | 250 // initiate a copy-into-video-frame request. |
| 251 void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); | 251 void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); |
| 252 | 252 |
| 253 const cc::FrameSinkId frame_sink_id_; | 253 const cc::FrameSinkId frame_sink_id_; |
| 254 cc::LocalFrameId local_frame_id_; | 254 cc::LocalSurfaceId local_surface_id_; |
| 255 DelegatedFrameHostClient* const client_; | 255 DelegatedFrameHostClient* const client_; |
| 256 ui::Compositor* compositor_; | 256 ui::Compositor* compositor_; |
| 257 | 257 |
| 258 // The vsync manager we are observing for changes, if any. | 258 // The vsync manager we are observing for changes, if any. |
| 259 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | 259 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; |
| 260 | 260 |
| 261 // The current VSync timebase and interval. These are zero until the first | 261 // The current VSync timebase and interval. These are zero until the first |
| 262 // call to SetVSyncParameters(). | 262 // call to SetVSyncParameters(). |
| 263 base::TimeTicks vsync_timebase_; | 263 base::TimeTicks vsync_timebase_; |
| 264 base::TimeDelta vsync_interval_; | 264 base::TimeDelta vsync_interval_; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // YUV readback pipeline. | 332 // YUV readback pipeline. |
| 333 std::unique_ptr<display_compositor::ReadbackYUVInterface> | 333 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
| 334 yuv_readback_pipeline_; | 334 yuv_readback_pipeline_; |
| 335 | 335 |
| 336 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 336 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 337 }; | 337 }; |
| 338 | 338 |
| 339 } // namespace content | 339 } // namespace content |
| 340 | 340 |
| 341 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 341 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |