| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void SwapDelegatedFrame(uint32_t output_surface_id, | 132 void SwapDelegatedFrame(uint32_t output_surface_id, |
| 133 cc::CompositorFrame frame); | 133 cc::CompositorFrame frame); |
| 134 void ClearDelegatedFrame(); | 134 void ClearDelegatedFrame(); |
| 135 void WasHidden(); | 135 void WasHidden(); |
| 136 void WasShown(const ui::LatencyInfo& latency_info); | 136 void WasShown(const ui::LatencyInfo& latency_info); |
| 137 void WasResized(); | 137 void WasResized(); |
| 138 bool HasSavedFrame(); | 138 bool HasSavedFrame(); |
| 139 gfx::Size GetRequestedRendererSize() const; | 139 gfx::Size GetRequestedRendererSize() const; |
| 140 void SetCompositor(ui::Compositor* compositor); | 140 void SetCompositor(ui::Compositor* compositor); |
| 141 void ResetCompositor(); | 141 void ResetCompositor(); |
| 142 void SetVSyncParameters(const base::TimeTicks& timebase, | |
| 143 const base::TimeDelta& interval); | |
| 144 // Note: |src_subset| is specified in DIP dimensions while |output_size| | 142 // Note: |src_subset| is specified in DIP dimensions while |output_size| |
| 145 // expects pixels. | 143 // expects pixels. |
| 146 void CopyFromCompositingSurface(const gfx::Rect& src_subrect, | 144 void CopyFromCompositingSurface(const gfx::Rect& src_subrect, |
| 147 const gfx::Size& output_size, | 145 const gfx::Size& output_size, |
| 148 const ReadbackRequestCallback& callback, | 146 const ReadbackRequestCallback& callback, |
| 149 const SkColorType preferred_color_type); | 147 const SkColorType preferred_color_type); |
| 150 void CopyFromCompositingSurfaceToVideoFrame( | 148 void CopyFromCompositingSurfaceToVideoFrame( |
| 151 const gfx::Rect& src_subrect, | 149 const gfx::Rect& src_subrect, |
| 152 const scoped_refptr<media::VideoFrame>& target, | 150 const scoped_refptr<media::VideoFrame>& target, |
| 153 const base::Callback<void(const gfx::Rect&, bool)>& callback); | 151 const base::Callback<void(const gfx::Rect&, bool)>& callback); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 248 |
| 251 // Called to consult the current |frame_subscriber_|, to determine and maybe | 249 // Called to consult the current |frame_subscriber_|, to determine and maybe |
| 252 // initiate a copy-into-video-frame request. | 250 // initiate a copy-into-video-frame request. |
| 253 void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); | 251 void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); |
| 254 | 252 |
| 255 DelegatedFrameHostClient* const client_; | 253 DelegatedFrameHostClient* const client_; |
| 256 ui::Compositor* compositor_; | 254 ui::Compositor* compositor_; |
| 257 | 255 |
| 258 // The vsync manager we are observing for changes, if any. | 256 // The vsync manager we are observing for changes, if any. |
| 259 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | 257 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; |
| 258 bool using_begin_frame_scheduling_; |
| 260 | 259 |
| 261 // The current VSync timebase and interval. These are zero until the first | 260 // The current VSync timebase and interval. These are zero until the first |
| 262 // call to SetVSyncParameters(). | 261 // call to SetVSyncParameters(). |
| 263 base::TimeTicks vsync_timebase_; | 262 base::TimeTicks vsync_timebase_; |
| 264 base::TimeDelta vsync_interval_; | 263 base::TimeDelta vsync_interval_; |
| 265 | 264 |
| 266 // Overridable tick clock used for testing functions using current time. | 265 // Overridable tick clock used for testing functions using current time. |
| 267 std::unique_ptr<base::TickClock> tick_clock_; | 266 std::unique_ptr<base::TickClock> tick_clock_; |
| 268 | 267 |
| 269 // With delegated renderer, this is the last output surface, used to | 268 // With delegated renderer, this is the last output surface, used to |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // YUV readback pipeline. | 332 // YUV readback pipeline. |
| 334 std::unique_ptr<display_compositor::ReadbackYUVInterface> | 333 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
| 335 yuv_readback_pipeline_; | 334 yuv_readback_pipeline_; |
| 336 | 335 |
| 337 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 336 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 338 }; | 337 }; |
| 339 | 338 |
| 340 } // namespace content | 339 } // namespace content |
| 341 | 340 |
| 342 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 341 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |