| 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" |
| 11 #include "content/browser/compositor/image_transport_factory.h" | 11 #include "content/browser/compositor/image_transport_factory.h" |
| 12 #include "content/browser/compositor/owned_mailbox.h" | 12 #include "content/browser/compositor/owned_mailbox.h" |
| 13 #include "content/browser/renderer_host/delegated_frame_evictor.h" | 13 #include "content/browser/renderer_host/delegated_frame_evictor.h" |
| 14 #include "content/browser/renderer_host/dip_util.h" | 14 #include "content/browser/renderer_host/dip_util.h" |
| 15 #include "content/browser/renderer_host/render_widget_host_impl.h" | 15 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 16 #include "content/common/gpu/client/gl_helper.h" | |
| 17 #include "content/public/browser/render_process_host.h" | 16 #include "content/public/browser/render_process_host.h" |
| 18 #include "ui/compositor/compositor.h" | 17 #include "ui/compositor/compositor.h" |
| 19 #include "ui/compositor/compositor_observer.h" | 18 #include "ui/compositor/compositor_observer.h" |
| 20 #include "ui/compositor/compositor_vsync_manager.h" | 19 #include "ui/compositor/compositor_vsync_manager.h" |
| 21 #include "ui/compositor/layer.h" | 20 #include "ui/compositor/layer.h" |
| 22 #include "ui/compositor/layer_owner_delegate.h" | 21 #include "ui/compositor/layer_owner_delegate.h" |
| 23 #include "ui/gfx/rect_conversions.h" | 22 #include "ui/gfx/rect_conversions.h" |
| 24 | 23 |
| 25 namespace media { | 24 namespace media { |
| 26 class VideoFrame; | 25 class VideoFrame; |
| 27 } | 26 } |
| 28 | 27 |
| 29 namespace content { | 28 namespace content { |
| 30 | 29 |
| 31 class DelegatedFrameHost; | 30 class DelegatedFrameHost; |
| 31 class ReadbackYUVInterface; |
| 32 class RenderWidgetHostViewFrameSubscriber; | 32 class RenderWidgetHostViewFrameSubscriber; |
| 33 class RenderWidgetHostImpl; | 33 class RenderWidgetHostImpl; |
| 34 class ResizeLock; | 34 class ResizeLock; |
| 35 | 35 |
| 36 // The DelegatedFrameHostClient is the interface from the DelegatedFrameHost, | 36 // The DelegatedFrameHostClient is the interface from the DelegatedFrameHost, |
| 37 // which manages delegated frames, and the ui::Compositor being used to | 37 // which manages delegated frames, and the ui::Compositor being used to |
| 38 // display them. | 38 // display them. |
| 39 class CONTENT_EXPORT DelegatedFrameHostClient { | 39 class CONTENT_EXPORT DelegatedFrameHostClient { |
| 40 public: | 40 public: |
| 41 virtual ui::Compositor* GetCompositor() const = 0; | 41 virtual ui::Compositor* GetCompositor() const = 0; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // renderer of producing a frame of the right size. | 251 // renderer of producing a frame of the right size. |
| 252 scoped_ptr<ResizeLock> resize_lock_; | 252 scoped_ptr<ResizeLock> resize_lock_; |
| 253 | 253 |
| 254 // Keeps track of the current frame size. | 254 // Keeps track of the current frame size. |
| 255 gfx::Size current_frame_size_in_dip_; | 255 gfx::Size current_frame_size_in_dip_; |
| 256 | 256 |
| 257 // This lock is for waiting for a front surface to become available to draw. | 257 // This lock is for waiting for a front surface to become available to draw. |
| 258 scoped_refptr<ui::CompositorLock> released_front_lock_; | 258 scoped_refptr<ui::CompositorLock> released_front_lock_; |
| 259 | 259 |
| 260 enum CanLockCompositorState { | 260 enum CanLockCompositorState { |
| 261 YES, | 261 YES_CAN_LOCK, |
| 262 // We locked, so at some point we'll need to kick a frame. | 262 // We locked, so at some point we'll need to kick a frame. |
| 263 YES_DID_LOCK, | 263 YES_DID_LOCK, |
| 264 // No. A lock timed out, we need to kick a new frame before locking again. | 264 // No. A lock timed out, we need to kick a new frame before locking again. |
| 265 NO_PENDING_RENDERER_FRAME, | 265 NO_PENDING_RENDERER_FRAME, |
| 266 // No. We've got a frame, but it hasn't been committed. | 266 // No. We've got a frame, but it hasn't been committed. |
| 267 NO_PENDING_COMMIT, | 267 NO_PENDING_COMMIT, |
| 268 }; | 268 }; |
| 269 CanLockCompositorState can_lock_compositor_; | 269 CanLockCompositorState can_lock_compositor_; |
| 270 | 270 |
| 271 base::TimeTicks last_draw_ended_; | 271 base::TimeTicks last_draw_ended_; |
| 272 | 272 |
| 273 // Subscriber that listens to frame presentation events. | 273 // Subscriber that listens to frame presentation events. |
| 274 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 274 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
| 275 std::vector<scoped_refptr<OwnedMailbox> > idle_frame_subscriber_textures_; | 275 std::vector<scoped_refptr<OwnedMailbox> > idle_frame_subscriber_textures_; |
| 276 std::set<OwnedMailbox*> active_frame_subscriber_textures_; | 276 std::set<OwnedMailbox*> active_frame_subscriber_textures_; |
| 277 | 277 |
| 278 // YUV readback pipeline. | 278 // YUV readback pipeline. |
| 279 scoped_ptr<content::ReadbackYUVInterface> | 279 scoped_ptr<content::ReadbackYUVInterface> |
| 280 yuv_readback_pipeline_; | 280 yuv_readback_pipeline_; |
| 281 | 281 |
| 282 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 282 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 } // namespace content | 285 } // namespace content |
| 286 | 286 |
| 287 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ | 287 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |