| 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> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "cc/output/copy_output_result.h" | 13 #include "cc/output/copy_output_result.h" |
| 14 #include "cc/surfaces/surface_factory_client.h" | 14 #include "cc/surfaces/surface_factory_client.h" |
| 15 #include "content/browser/compositor/image_transport_factory.h" | 15 #include "content/browser/compositor/image_transport_factory.h" |
| 16 #include "content/browser/compositor/owned_mailbox.h" | 16 #include "content/browser/compositor/owned_mailbox.h" |
| 17 #include "content/browser/renderer_host/delegated_frame_evictor.h" | 17 #include "content/browser/renderer_host/delegated_frame_evictor.h" |
| 18 #include "content/browser/renderer_host/dip_util.h" | 18 #include "content/browser/renderer_host/dip_util.h" |
| 19 #include "content/browser/renderer_host/render_widget_host_impl.h" | 19 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 20 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 20 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 21 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
| 22 #include "ui/compositor/compositor.h" | 22 #include "ui/compositor/compositor.h" |
| 23 #include "ui/compositor/compositor_observer.h" | 23 #include "ui/compositor/compositor_observer.h" |
| 24 #include "ui/compositor/compositor_vsync_manager.h" | 24 #include "ui/compositor/compositor_vsync_manager.h" |
| 25 #include "ui/compositor/layer.h" | 25 #include "ui/compositor/layer.h" |
| 26 #include "ui/compositor/layer_owner_delegate.h" |
| 26 #include "ui/events/event.h" | 27 #include "ui/events/event.h" |
| 27 #include "ui/gfx/geometry/rect_conversions.h" | 28 #include "ui/gfx/geometry/rect_conversions.h" |
| 28 | 29 |
| 29 namespace base { | 30 namespace base { |
| 30 class TickClock; | 31 class TickClock; |
| 31 } | 32 } |
| 32 | 33 |
| 33 namespace cc { | 34 namespace cc { |
| 34 class SurfaceFactory; | 35 class SurfaceFactory; |
| 35 } | 36 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 virtual bool IsAutoResizeEnabled() const = 0; | 78 virtual bool IsAutoResizeEnabled() const = 0; |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state | 81 // The DelegatedFrameHost is used to host all of the RenderWidgetHostView state |
| 81 // and functionality that is associated with delegated frames being sent from | 82 // and functionality that is associated with delegated frames being sent from |
| 82 // the RenderWidget. The DelegatedFrameHost will push these changes through to | 83 // the RenderWidget. The DelegatedFrameHost will push these changes through to |
| 83 // the ui::Compositor associated with its DelegatedFrameHostClient. | 84 // the ui::Compositor associated with its DelegatedFrameHostClient. |
| 84 class CONTENT_EXPORT DelegatedFrameHost | 85 class CONTENT_EXPORT DelegatedFrameHost |
| 85 : public ui::CompositorObserver, | 86 : public ui::CompositorObserver, |
| 86 public ui::CompositorVSyncManager::Observer, | 87 public ui::CompositorVSyncManager::Observer, |
| 88 public ui::LayerOwnerDelegate, |
| 87 public ui::ContextFactoryObserver, | 89 public ui::ContextFactoryObserver, |
| 88 public DelegatedFrameEvictorClient, | 90 public DelegatedFrameEvictorClient, |
| 89 public cc::SurfaceFactoryClient, | 91 public cc::SurfaceFactoryClient, |
| 90 public base::SupportsWeakPtr<DelegatedFrameHost> { | 92 public base::SupportsWeakPtr<DelegatedFrameHost> { |
| 91 public: | 93 public: |
| 92 DelegatedFrameHost(const cc::FrameSinkId& frame_sink_id, | 94 DelegatedFrameHost(const cc::FrameSinkId& frame_sink_id, |
| 93 DelegatedFrameHostClient* client); | 95 DelegatedFrameHostClient* client); |
| 94 ~DelegatedFrameHost() override; | 96 ~DelegatedFrameHost() override; |
| 95 | 97 |
| 96 // ui::CompositorObserver implementation. | 98 // ui::CompositorObserver implementation. |
| 97 void OnCompositingDidCommit(ui::Compositor* compositor) override; | 99 void OnCompositingDidCommit(ui::Compositor* compositor) override; |
| 98 void OnCompositingStarted(ui::Compositor* compositor, | 100 void OnCompositingStarted(ui::Compositor* compositor, |
| 99 base::TimeTicks start_time) override; | 101 base::TimeTicks start_time) override; |
| 100 void OnCompositingEnded(ui::Compositor* compositor) override; | 102 void OnCompositingEnded(ui::Compositor* compositor) override; |
| 101 void OnCompositingAborted(ui::Compositor* compositor) override; | 103 void OnCompositingAborted(ui::Compositor* compositor) override; |
| 102 void OnCompositingLockStateChanged(ui::Compositor* compositor) override; | 104 void OnCompositingLockStateChanged(ui::Compositor* compositor) override; |
| 103 void OnCompositingShuttingDown(ui::Compositor* compositor) override; | 105 void OnCompositingShuttingDown(ui::Compositor* compositor) override; |
| 104 | 106 |
| 105 // ui::CompositorVSyncManager::Observer implementation. | 107 // ui::CompositorVSyncManager::Observer implementation. |
| 106 void OnUpdateVSyncParameters(base::TimeTicks timebase, | 108 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
| 107 base::TimeDelta interval) override; | 109 base::TimeDelta interval) override; |
| 108 | 110 |
| 111 // ui::LayerOwnerObserver implementation. |
| 112 void OnLayerRecreated(ui::Layer* old_layer, ui::Layer* new_layer) override; |
| 113 |
| 109 // ImageTransportFactoryObserver implementation. | 114 // ImageTransportFactoryObserver implementation. |
| 110 void OnLostResources() override; | 115 void OnLostResources() override; |
| 111 | 116 |
| 112 // DelegatedFrameEvictorClient implementation. | 117 // DelegatedFrameEvictorClient implementation. |
| 113 void EvictDelegatedFrame() override; | 118 void EvictDelegatedFrame() override; |
| 114 | 119 |
| 115 // cc::SurfaceFactoryClient implementation. | 120 // cc::SurfaceFactoryClient implementation. |
| 116 void ReturnResources(const cc::ReturnedResourceArray& resources) override; | 121 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
| 117 void WillDrawSurface(const cc::LocalFrameId& id, | 122 void WillDrawSurface(const cc::LocalFrameId& id, |
| 118 const gfx::Rect& damage_rect) override; | 123 const gfx::Rect& damage_rect) override; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 // YUV readback pipeline. | 337 // YUV readback pipeline. |
| 333 std::unique_ptr<display_compositor::ReadbackYUVInterface> | 338 std::unique_ptr<display_compositor::ReadbackYUVInterface> |
| 334 yuv_readback_pipeline_; | 339 yuv_readback_pipeline_; |
| 335 | 340 |
| 336 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 341 std::unique_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 337 }; | 342 }; |
| 338 | 343 |
| 339 } // namespace content | 344 } // namespace content |
| 340 | 345 |
| 341 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ | 346 #endif // CONTENT_BROWSER_RENDERER_HOST_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |