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 <stdint.h> |
| 9 |
8 #include <vector> | 10 #include <vector> |
9 | 11 |
10 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
11 #include "cc/layers/delegated_frame_provider.h" | 13 #include "cc/layers/delegated_frame_provider.h" |
12 #include "cc/layers/delegated_frame_resource_collection.h" | 14 #include "cc/layers/delegated_frame_resource_collection.h" |
13 #include "cc/output/copy_output_result.h" | 15 #include "cc/output/copy_output_result.h" |
14 #include "cc/surfaces/surface_factory_client.h" | 16 #include "cc/surfaces/surface_factory_client.h" |
15 #include "content/browser/compositor/image_transport_factory.h" | 17 #include "content/browser/compositor/image_transport_factory.h" |
16 #include "content/browser/compositor/owned_mailbox.h" | 18 #include "content/browser/compositor/owned_mailbox.h" |
17 #include "content/browser/renderer_host/delegated_frame_evictor.h" | 19 #include "content/browser/renderer_host/delegated_frame_evictor.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // cc::SurfaceFactoryClient implementation. | 122 // cc::SurfaceFactoryClient implementation. |
121 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 123 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
122 void WillDrawSurface(cc::SurfaceId id, const gfx::Rect& damage_rect) override; | 124 void WillDrawSurface(cc::SurfaceId id, const gfx::Rect& damage_rect) override; |
123 void SetBeginFrameSource(cc::SurfaceId surface_id, | 125 void SetBeginFrameSource(cc::SurfaceId surface_id, |
124 cc::BeginFrameSource* begin_frame_source) override; | 126 cc::BeginFrameSource* begin_frame_source) override; |
125 | 127 |
126 bool CanCopyToBitmap() const; | 128 bool CanCopyToBitmap() const; |
127 | 129 |
128 // Public interface exposed to RenderWidgetHostView. | 130 // Public interface exposed to RenderWidgetHostView. |
129 | 131 |
130 void SwapDelegatedFrame(uint32 output_surface_id, | 132 void SwapDelegatedFrame(uint32_t output_surface_id, |
131 scoped_ptr<cc::CompositorFrame> frame); | 133 scoped_ptr<cc::CompositorFrame> frame); |
132 void ClearDelegatedFrame(); | 134 void ClearDelegatedFrame(); |
133 void WasHidden(); | 135 void WasHidden(); |
134 void WasShown(const ui::LatencyInfo& latency_info); | 136 void WasShown(const ui::LatencyInfo& latency_info); |
135 void WasResized(); | 137 void WasResized(); |
136 bool HasSavedFrame(); | 138 bool HasSavedFrame(); |
137 gfx::Size GetRequestedRendererSize() const; | 139 gfx::Size GetRequestedRendererSize() const; |
138 void SetCompositor(ui::Compositor* compositor); | 140 void SetCompositor(ui::Compositor* compositor); |
139 void ResetCompositor(); | 141 void ResetCompositor(); |
140 void SetVSyncParameters(const base::TimeTicks& timebase, | 142 void SetVSyncParameters(const base::TimeTicks& timebase, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 base::WeakPtr<DelegatedFrameHost> rwhva, | 244 base::WeakPtr<DelegatedFrameHost> rwhva, |
243 const base::Callback<void(bool)>& callback, | 245 const base::Callback<void(bool)>& callback, |
244 scoped_refptr<OwnedMailbox> subscriber_texture, | 246 scoped_refptr<OwnedMailbox> subscriber_texture, |
245 scoped_ptr<cc::SingleReleaseCallback> release_callback, | 247 scoped_ptr<cc::SingleReleaseCallback> release_callback, |
246 bool result); | 248 bool result); |
247 static void ReturnSubscriberTexture( | 249 static void ReturnSubscriberTexture( |
248 base::WeakPtr<DelegatedFrameHost> rwhva, | 250 base::WeakPtr<DelegatedFrameHost> rwhva, |
249 scoped_refptr<OwnedMailbox> subscriber_texture, | 251 scoped_refptr<OwnedMailbox> subscriber_texture, |
250 const gpu::SyncToken& sync_token); | 252 const gpu::SyncToken& sync_token); |
251 | 253 |
252 void SendDelegatedFrameAck(uint32 output_surface_id); | 254 void SendDelegatedFrameAck(uint32_t output_surface_id); |
253 void SurfaceDrawn(uint32 output_surface_id, cc::SurfaceDrawStatus drawn); | 255 void SurfaceDrawn(uint32_t output_surface_id, cc::SurfaceDrawStatus drawn); |
254 void SendReturnedDelegatedResources(uint32 output_surface_id); | 256 void SendReturnedDelegatedResources(uint32_t output_surface_id); |
255 | 257 |
256 // Called to consult the current |frame_subscriber_|, to determine and maybe | 258 // Called to consult the current |frame_subscriber_|, to determine and maybe |
257 // initiate a copy-into-video-frame request. | 259 // initiate a copy-into-video-frame request. |
258 void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); | 260 void AttemptFrameSubscriberCapture(const gfx::Rect& damage_rect); |
259 | 261 |
260 DelegatedFrameHostClient* const client_; | 262 DelegatedFrameHostClient* const client_; |
261 ui::Compositor* compositor_; | 263 ui::Compositor* compositor_; |
262 | 264 |
263 // True if this renders into a Surface, false if it renders into a delegated | 265 // True if this renders into a Surface, false if it renders into a delegated |
264 // layer. | 266 // layer. |
265 bool use_surfaces_; | 267 bool use_surfaces_; |
266 | 268 |
267 std::vector<base::Closure> on_compositing_did_commit_callbacks_; | 269 std::vector<base::Closure> on_compositing_did_commit_callbacks_; |
268 | 270 |
269 // The vsync manager we are observing for changes, if any. | 271 // The vsync manager we are observing for changes, if any. |
270 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | 272 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; |
271 | 273 |
272 // The current VSync timebase and interval. These are zero until the first | 274 // The current VSync timebase and interval. These are zero until the first |
273 // call to SetVSyncParameters(). | 275 // call to SetVSyncParameters(). |
274 base::TimeTicks vsync_timebase_; | 276 base::TimeTicks vsync_timebase_; |
275 base::TimeDelta vsync_interval_; | 277 base::TimeDelta vsync_interval_; |
276 | 278 |
277 // Overridable tick clock used for testing functions using current time. | 279 // Overridable tick clock used for testing functions using current time. |
278 scoped_ptr<base::TickClock> tick_clock_; | 280 scoped_ptr<base::TickClock> tick_clock_; |
279 | 281 |
280 // With delegated renderer, this is the last output surface, used to | 282 // With delegated renderer, this is the last output surface, used to |
281 // disambiguate resources with the same id coming from different output | 283 // disambiguate resources with the same id coming from different output |
282 // surfaces. | 284 // surfaces. |
283 uint32 last_output_surface_id_; | 285 uint32_t last_output_surface_id_; |
284 | 286 |
285 // The number of delegated frame acks that are pending, to delay resource | 287 // The number of delegated frame acks that are pending, to delay resource |
286 // returns until the acks are sent. | 288 // returns until the acks are sent. |
287 int pending_delegated_ack_count_; | 289 int pending_delegated_ack_count_; |
288 | 290 |
289 // True after a delegated frame has been skipped, until a frame is not | 291 // True after a delegated frame has been skipped, until a frame is not |
290 // skipped. | 292 // skipped. |
291 bool skipped_frames_; | 293 bool skipped_frames_; |
292 std::vector<ui::LatencyInfo> skipped_latency_info_list_; | 294 std::vector<ui::LatencyInfo> skipped_latency_info_list_; |
293 | 295 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // YUV readback pipeline. | 348 // YUV readback pipeline. |
347 scoped_ptr<content::ReadbackYUVInterface> | 349 scoped_ptr<content::ReadbackYUVInterface> |
348 yuv_readback_pipeline_; | 350 yuv_readback_pipeline_; |
349 | 351 |
350 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 352 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
351 }; | 353 }; |
352 | 354 |
353 } // namespace content | 355 } // namespace content |
354 | 356 |
355 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ | 357 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ |
OLD | NEW |