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 127 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 virtual void OnCompositingDidCommit(ui::Compositor* compositor) override; |
149 virtual void OnCompositingStarted(ui::Compositor* compositor, | 149 virtual 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 virtual void OnCompositingEnded(ui::Compositor* compositor) override; |
152 virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE; | 152 virtual void OnCompositingAborted(ui::Compositor* compositor) override; |
153 virtual void OnCompositingLockStateChanged( | 153 virtual void OnCompositingLockStateChanged( |
154 ui::Compositor* compositor) OVERRIDE; | 154 ui::Compositor* compositor) override; |
155 | 155 |
156 // Overridden from ui::CompositorVSyncManager::Observer: | 156 // Overridden from ui::CompositorVSyncManager::Observer: |
157 virtual void OnUpdateVSyncParameters(base::TimeTicks timebase, | 157 virtual void OnUpdateVSyncParameters(base::TimeTicks timebase, |
158 base::TimeDelta interval) OVERRIDE; | 158 base::TimeDelta interval) override; |
159 | 159 |
160 // Overridden from ui::LayerOwnerObserver: | 160 // Overridden from ui::LayerOwnerObserver: |
161 virtual void OnLayerRecreated(ui::Layer* old_layer, | 161 virtual void OnLayerRecreated(ui::Layer* old_layer, |
162 ui::Layer* new_layer) OVERRIDE; | 162 ui::Layer* new_layer) override; |
163 | 163 |
164 // Overridden from ImageTransportFactoryObserver: | 164 // Overridden from ImageTransportFactoryObserver: |
165 virtual void OnLostResources() OVERRIDE; | 165 virtual void OnLostResources() override; |
166 | 166 |
167 bool ShouldSkipFrame(gfx::Size size_in_dip) const; | 167 bool ShouldSkipFrame(gfx::Size size_in_dip) const; |
168 | 168 |
169 // Lazily grab a resize lock if the aura window size doesn't match the current | 169 // Lazily grab a resize lock if the aura window size doesn't match the current |
170 // frame size, to give time to the renderer. | 170 // frame size, to give time to the renderer. |
171 void MaybeCreateResizeLock(); | 171 void MaybeCreateResizeLock(); |
172 | 172 |
173 // Checks if the resize lock can be released because we received an new frame. | 173 // Checks if the resize lock can be released because we received an new frame. |
174 void CheckResizeLock(); | 174 void CheckResizeLock(); |
175 | 175 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 bool result); | 210 bool result); |
211 static void ReturnSubscriberTexture( | 211 static void ReturnSubscriberTexture( |
212 base::WeakPtr<DelegatedFrameHost> rwhva, | 212 base::WeakPtr<DelegatedFrameHost> rwhva, |
213 scoped_refptr<OwnedMailbox> subscriber_texture, | 213 scoped_refptr<OwnedMailbox> subscriber_texture, |
214 uint32 sync_point); | 214 uint32 sync_point); |
215 | 215 |
216 void SendDelegatedFrameAck(uint32 output_surface_id); | 216 void SendDelegatedFrameAck(uint32 output_surface_id); |
217 void SendReturnedDelegatedResources(uint32 output_surface_id); | 217 void SendReturnedDelegatedResources(uint32 output_surface_id); |
218 | 218 |
219 // DelegatedFrameEvictorClient implementation. | 219 // DelegatedFrameEvictorClient implementation. |
220 virtual void EvictDelegatedFrame() OVERRIDE; | 220 virtual void EvictDelegatedFrame() override; |
221 | 221 |
222 // cc::DelegatedFrameProviderClient implementation. | 222 // cc::DelegatedFrameProviderClient implementation. |
223 virtual void UnusedResourcesAreAvailable() OVERRIDE; | 223 virtual void UnusedResourcesAreAvailable() override; |
224 | 224 |
225 // cc::SurfaceFactoryClient implementation. | 225 // cc::SurfaceFactoryClient implementation. |
226 virtual void ReturnResources( | 226 virtual void ReturnResources( |
227 const cc::ReturnedResourceArray& resources) OVERRIDE; | 227 const cc::ReturnedResourceArray& resources) override; |
228 | 228 |
229 void DidReceiveFrameFromRenderer(const gfx::Rect& damage_rect); | 229 void DidReceiveFrameFromRenderer(const gfx::Rect& damage_rect); |
230 | 230 |
231 DelegatedFrameHostClient* client_; | 231 DelegatedFrameHostClient* client_; |
232 | 232 |
233 // True if this renders into a Surface, false if it renders into a delegated | 233 // True if this renders into a Surface, false if it renders into a delegated |
234 // layer. | 234 // layer. |
235 bool use_surfaces_; | 235 bool use_surfaces_; |
236 | 236 |
237 std::vector<base::Closure> on_compositing_did_commit_callbacks_; | 237 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. | 307 // YUV readback pipeline. |
308 scoped_ptr<content::ReadbackYUVInterface> | 308 scoped_ptr<content::ReadbackYUVInterface> |
309 yuv_readback_pipeline_; | 309 yuv_readback_pipeline_; |
310 | 310 |
311 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 311 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
312 }; | 312 }; |
313 | 313 |
314 } // namespace content | 314 } // namespace content |
315 | 315 |
316 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ | 316 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ |
OLD | NEW |