| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 bool ShouldSkipFrame(gfx::Size size_in_dip) const; | 197 bool ShouldSkipFrame(gfx::Size size_in_dip) const; |
| 198 | 198 |
| 199 // Lazily grab a resize lock if the aura window size doesn't match the current | 199 // Lazily grab a resize lock if the aura window size doesn't match the current |
| 200 // frame size, to give time to the renderer. | 200 // frame size, to give time to the renderer. |
| 201 void MaybeCreateResizeLock(); | 201 void MaybeCreateResizeLock(); |
| 202 | 202 |
| 203 // Checks if the resize lock can be released because we received an new frame. | 203 // Checks if the resize lock can be released because we received an new frame. |
| 204 void CheckResizeLock(); | 204 void CheckResizeLock(); |
| 205 | 205 |
| 206 // Update the layers for the resize gutters to the right and bottom of the |
| 207 // surface layer. |
| 208 void UpdateGutters(); |
| 209 |
| 206 // Called after async thumbnailer task completes. Scales and crops the result | 210 // Called after async thumbnailer task completes. Scales and crops the result |
| 207 // of the copy. | 211 // of the copy. |
| 208 static void CopyFromCompositingSurfaceHasResultForVideo( | 212 static void CopyFromCompositingSurfaceHasResultForVideo( |
| 209 base::WeakPtr<DelegatedFrameHost> rwhva, | 213 base::WeakPtr<DelegatedFrameHost> rwhva, |
| 210 scoped_refptr<OwnedMailbox> subscriber_texture, | 214 scoped_refptr<OwnedMailbox> subscriber_texture, |
| 211 scoped_refptr<media::VideoFrame> video_frame, | 215 scoped_refptr<media::VideoFrame> video_frame, |
| 212 const base::Callback<void(const gfx::Rect&, bool)>& callback, | 216 const base::Callback<void(const gfx::Rect&, bool)>& callback, |
| 213 scoped_ptr<cc::CopyOutputResult> result); | 217 scoped_ptr<cc::CopyOutputResult> result); |
| 214 static void CopyFromCompositingSurfaceFinishedForVideo( | 218 static void CopyFromCompositingSurfaceFinishedForVideo( |
| 215 base::WeakPtr<DelegatedFrameHost> rwhva, | 219 base::WeakPtr<DelegatedFrameHost> rwhva, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 255 |
| 252 // The number of delegated frame acks that are pending, to delay resource | 256 // The number of delegated frame acks that are pending, to delay resource |
| 253 // returns until the acks are sent. | 257 // returns until the acks are sent. |
| 254 int pending_delegated_ack_count_; | 258 int pending_delegated_ack_count_; |
| 255 | 259 |
| 256 // True after a delegated frame has been skipped, until a frame is not | 260 // True after a delegated frame has been skipped, until a frame is not |
| 257 // skipped. | 261 // skipped. |
| 258 bool skipped_frames_; | 262 bool skipped_frames_; |
| 259 std::vector<ui::LatencyInfo> skipped_latency_info_list_; | 263 std::vector<ui::LatencyInfo> skipped_latency_info_list_; |
| 260 | 264 |
| 265 scoped_ptr<ui::Layer> right_gutter_; |
| 266 scoped_ptr<ui::Layer> bottom_gutter_; |
| 267 |
| 268 // This is the last root background color from a swapped frame. |
| 269 SkColor background_color_; |
| 270 |
| 261 // State for rendering into a Surface. | 271 // State for rendering into a Surface. |
| 262 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_; | 272 scoped_ptr<cc::SurfaceIdAllocator> id_allocator_; |
| 263 scoped_ptr<cc::SurfaceFactory> surface_factory_; | 273 scoped_ptr<cc::SurfaceFactory> surface_factory_; |
| 264 cc::SurfaceId surface_id_; | 274 cc::SurfaceId surface_id_; |
| 265 gfx::Size current_surface_size_; | 275 gfx::Size current_surface_size_; |
| 266 float current_scale_factor_; | 276 float current_scale_factor_; |
| 267 cc::ReturnedResourceArray surface_returned_resources_; | 277 cc::ReturnedResourceArray surface_returned_resources_; |
| 268 | 278 |
| 269 // This lock is the one waiting for a frame of the right size to come back | 279 // This lock is the one waiting for a frame of the right size to come back |
| 270 // from the renderer/GPU process. It is set from the moment the aura window | 280 // from the renderer/GPU process. It is set from the moment the aura window |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // YUV readback pipeline. | 315 // YUV readback pipeline. |
| 306 scoped_ptr<content::ReadbackYUVInterface> | 316 scoped_ptr<content::ReadbackYUVInterface> |
| 307 yuv_readback_pipeline_; | 317 yuv_readback_pipeline_; |
| 308 | 318 |
| 309 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; | 319 scoped_ptr<DelegatedFrameEvictor> delegated_frame_evictor_; |
| 310 }; | 320 }; |
| 311 | 321 |
| 312 } // namespace content | 322 } // namespace content |
| 313 | 323 |
| 314 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ | 324 #endif // CONTENT_BROWSER_COMPOSITOR_DELEGATED_FRAME_HOST_H_ |
| OLD | NEW |