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" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 : public ui::CompositorObserver, | 74 : public ui::CompositorObserver, |
75 public ui::CompositorVSyncManager::Observer, | 75 public ui::CompositorVSyncManager::Observer, |
76 public ui::LayerOwnerDelegate, | 76 public ui::LayerOwnerDelegate, |
77 public ImageTransportFactoryObserver, | 77 public ImageTransportFactoryObserver, |
78 public DelegatedFrameEvictorClient, | 78 public DelegatedFrameEvictorClient, |
79 public cc::DelegatedFrameResourceCollectionClient, | 79 public cc::DelegatedFrameResourceCollectionClient, |
80 public cc::SurfaceFactoryClient, | 80 public cc::SurfaceFactoryClient, |
81 public base::SupportsWeakPtr<DelegatedFrameHost> { | 81 public base::SupportsWeakPtr<DelegatedFrameHost> { |
82 public: | 82 public: |
83 DelegatedFrameHost(DelegatedFrameHostClient* client); | 83 DelegatedFrameHost(DelegatedFrameHostClient* client); |
84 virtual ~DelegatedFrameHost(); | 84 ~DelegatedFrameHost() override; |
85 | 85 |
86 bool CanCopyToBitmap() const; | 86 bool CanCopyToBitmap() const; |
87 | 87 |
88 // Public interface exposed to RenderWidgetHostView. | 88 // Public interface exposed to RenderWidgetHostView. |
89 void SwapDelegatedFrame( | 89 void SwapDelegatedFrame( |
90 uint32 output_surface_id, | 90 uint32 output_surface_id, |
91 scoped_ptr<cc::DelegatedFrameData> frame_data, | 91 scoped_ptr<cc::DelegatedFrameData> frame_data, |
92 float frame_device_scale_factor, | 92 float frame_device_scale_factor, |
93 const std::vector<ui::LatencyInfo>& latency_info); | 93 const std::vector<ui::LatencyInfo>& latency_info); |
94 void WasHidden(); | 94 void WasHidden(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 RenderWidgetHostViewFrameSubscriber* frame_subscriber() const { | 138 RenderWidgetHostViewFrameSubscriber* frame_subscriber() const { |
139 return frame_subscriber_.get(); | 139 return frame_subscriber_.get(); |
140 } | 140 } |
141 bool ShouldCreateResizeLock(); | 141 bool ShouldCreateResizeLock(); |
142 void RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request); | 142 void RequestCopyOfOutput(scoped_ptr<cc::CopyOutputRequest> request); |
143 | 143 |
144 void LockResources(); | 144 void LockResources(); |
145 void UnlockResources(); | 145 void UnlockResources(); |
146 | 146 |
147 // Overridden from ui::CompositorObserver: | 147 // Overridden from ui::CompositorObserver: |
148 virtual void OnCompositingDidCommit(ui::Compositor* compositor) override; | 148 void OnCompositingDidCommit(ui::Compositor* compositor) override; |
149 virtual void OnCompositingStarted(ui::Compositor* compositor, | 149 void OnCompositingStarted(ui::Compositor* compositor, |
150 base::TimeTicks start_time) override; | 150 base::TimeTicks start_time) override; |
151 virtual void OnCompositingEnded(ui::Compositor* compositor) override; | 151 void OnCompositingEnded(ui::Compositor* compositor) override; |
152 virtual void OnCompositingAborted(ui::Compositor* compositor) override; | 152 void OnCompositingAborted(ui::Compositor* compositor) override; |
153 virtual void OnCompositingLockStateChanged( | 153 void OnCompositingLockStateChanged(ui::Compositor* compositor) override; |
154 ui::Compositor* compositor) override; | |
155 | 154 |
156 // Overridden from ui::CompositorVSyncManager::Observer: | 155 // Overridden from ui::CompositorVSyncManager::Observer: |
157 virtual void OnUpdateVSyncParameters(base::TimeTicks timebase, | 156 void OnUpdateVSyncParameters(base::TimeTicks timebase, |
158 base::TimeDelta interval) override; | 157 base::TimeDelta interval) override; |
159 | 158 |
160 // Overridden from ui::LayerOwnerObserver: | 159 // Overridden from ui::LayerOwnerObserver: |
161 virtual void OnLayerRecreated(ui::Layer* old_layer, | 160 void OnLayerRecreated(ui::Layer* old_layer, ui::Layer* new_layer) override; |
162 ui::Layer* new_layer) override; | |
163 | 161 |
164 // Overridden from ImageTransportFactoryObserver: | 162 // Overridden from ImageTransportFactoryObserver: |
165 virtual void OnLostResources() override; | 163 void OnLostResources() override; |
166 | 164 |
167 bool ShouldSkipFrame(gfx::Size size_in_dip) const; | 165 bool ShouldSkipFrame(gfx::Size size_in_dip) const; |
168 | 166 |
169 // Lazily grab a resize lock if the aura window size doesn't match the current | 167 // Lazily grab a resize lock if the aura window size doesn't match the current |
170 // frame size, to give time to the renderer. | 168 // frame size, to give time to the renderer. |
171 void MaybeCreateResizeLock(); | 169 void MaybeCreateResizeLock(); |
172 | 170 |
173 // Checks if the resize lock can be released because we received an new frame. | 171 // Checks if the resize lock can be released because we received an new frame. |
174 void CheckResizeLock(); | 172 void CheckResizeLock(); |
175 | 173 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 bool result); | 208 bool result); |
211 static void ReturnSubscriberTexture( | 209 static void ReturnSubscriberTexture( |
212 base::WeakPtr<DelegatedFrameHost> rwhva, | 210 base::WeakPtr<DelegatedFrameHost> rwhva, |
213 scoped_refptr<OwnedMailbox> subscriber_texture, | 211 scoped_refptr<OwnedMailbox> subscriber_texture, |
214 uint32 sync_point); | 212 uint32 sync_point); |
215 | 213 |
216 void SendDelegatedFrameAck(uint32 output_surface_id); | 214 void SendDelegatedFrameAck(uint32 output_surface_id); |
217 void SendReturnedDelegatedResources(uint32 output_surface_id); | 215 void SendReturnedDelegatedResources(uint32 output_surface_id); |
218 | 216 |
219 // DelegatedFrameEvictorClient implementation. | 217 // DelegatedFrameEvictorClient implementation. |
220 virtual void EvictDelegatedFrame() override; | 218 void EvictDelegatedFrame() override; |
221 | 219 |
222 // cc::DelegatedFrameProviderClient implementation. | 220 // cc::DelegatedFrameProviderClient implementation. |
223 virtual void UnusedResourcesAreAvailable() override; | 221 void UnusedResourcesAreAvailable() override; |
224 | 222 |
225 // cc::SurfaceFactoryClient implementation. | 223 // cc::SurfaceFactoryClient implementation. |
226 virtual void ReturnResources( | 224 void ReturnResources(const cc::ReturnedResourceArray& resources) override; |
227 const cc::ReturnedResourceArray& resources) override; | |
228 | 225 |
229 void DidReceiveFrameFromRenderer(const gfx::Rect& damage_rect); | 226 void DidReceiveFrameFromRenderer(const gfx::Rect& damage_rect); |
230 | 227 |
231 DelegatedFrameHostClient* client_; | 228 DelegatedFrameHostClient* client_; |
232 | 229 |
233 // True if this renders into a Surface, false if it renders into a delegated | 230 // True if this renders into a Surface, false if it renders into a delegated |
234 // layer. | 231 // layer. |
235 bool use_surfaces_; | 232 bool use_surfaces_; |
236 | 233 |
237 std::vector<base::Closure> on_compositing_did_commit_callbacks_; | 234 std::vector<base::Closure> on_compositing_did_commit_callbacks_; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // YUV readback pipeline. | 304 // YUV readback pipeline. |
308 scoped_ptr<content::ReadbackYUVInterface> | 305 scoped_ptr<content::ReadbackYUVInterface> |
309 yuv_readback_pipeline_; | 306 yuv_readback_pipeline_; |
310 | 307 |
311 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 308 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
312 }; | 309 }; |
313 | 310 |
314 } // namespace content | 311 } // namespace content |
315 | 312 |
316 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ | 313 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ |
OLD | NEW |