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