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