OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CC_TREES_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_IMPL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 // Distribute the rool scroll between outer and inner viewport scroll layer. | 278 // Distribute the rool scroll between outer and inner viewport scroll layer. |
279 // The outer viewport scroll layer scrolls first. | 279 // The outer viewport scroll layer scrolls first. |
280 void DistributeRootScrollOffset(); | 280 void DistributeRootScrollOffset(); |
281 | 281 |
282 void ApplyScroll(LayerImpl* layer, ScrollState* scroll_state) { | 282 void ApplyScroll(LayerImpl* layer, ScrollState* scroll_state) { |
283 layer_tree_host_impl_->ApplyScroll(layer, scroll_state); | 283 layer_tree_host_impl_->ApplyScroll(layer, scroll_state); |
284 } | 284 } |
285 | 285 |
286 // Call this function when you expect there to be a swap buffer. | 286 // Call this function when you expect there to be a swap buffer. |
287 // See swap_promise.h for how to use SwapPromise. | 287 // See swap_promise.h for how to use SwapPromise. |
288 // | |
289 // A swap promise queued by QueueSwapPromise travels with the layer | |
290 // information currently associated with the tree. For example, when | |
291 // a pending tree is activated, the swap promise is passed to the | |
292 // active tree along with the layer information. Similarly, when a | |
293 // new activation overwrites layer information on the active tree, | |
294 // queued swap promises are broken. | |
288 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 295 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
289 | 296 |
297 // Queue a swap promise, pinned to this tree. A pinned swap promise | |
298 // will not be passed from the pending tree to the active tree upon | |
299 // activation, and will not be broken prematurely on the active tree | |
300 // if a new tree is activated. | |
301 // | |
302 // Thus, a pinned swap promise on a pending tree will only see | |
danakj
2015/08/27 17:52:54
Update this comment then about the pending tree pl
Tobias Sargeant
2015/08/28 10:58:09
Done.
| |
303 // DidActivate() or DidNotSwap(ACTIVATION_FAILS). It is not passed | |
304 // to the active tree, so it will not swap. | |
305 // | |
306 // A pinned swap promise on the active tree will either see only | |
307 // DidSwap() or DidNotSwap(SWAP_FAILS). No DidActivate() will be | |
308 // seen because that has already happened prior to queueing of the | |
309 // swap promise. | |
310 void QueuePinnedSwapPromise(scoped_ptr<SwapPromise> swap_promise); | |
311 | |
290 // Take the |new_swap_promise| and append it to |swap_promise_list_|. | 312 // Take the |new_swap_promise| and append it to |swap_promise_list_|. |
291 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); | 313 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); |
292 void FinishSwapPromises(CompositorFrameMetadata* metadata); | 314 void FinishSwapPromises(CompositorFrameMetadata* metadata); |
293 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 315 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
294 | 316 |
295 void DidModifyTilePriorities(); | 317 void DidModifyTilePriorities(); |
296 | 318 |
297 ResourceId ResourceIdForUIResource(UIResourceId uid) const; | 319 ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
298 void ProcessUIResourceRequestQueue(); | 320 void ProcessUIResourceRequestQueue(); |
299 | 321 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 | 461 |
440 // In impl-side painting mode, this is true when the tree may contain | 462 // In impl-side painting mode, this is true when the tree may contain |
441 // structural differences relative to the active tree. | 463 // structural differences relative to the active tree. |
442 bool needs_full_tree_sync_; | 464 bool needs_full_tree_sync_; |
443 | 465 |
444 bool next_activation_forces_redraw_; | 466 bool next_activation_forces_redraw_; |
445 | 467 |
446 bool has_ever_been_drawn_; | 468 bool has_ever_been_drawn_; |
447 | 469 |
448 ScopedPtrVector<SwapPromise> swap_promise_list_; | 470 ScopedPtrVector<SwapPromise> swap_promise_list_; |
471 ScopedPtrVector<SwapPromise> pinned_swap_promise_list_; | |
449 | 472 |
450 UIResourceRequestQueue ui_resource_request_queue_; | 473 UIResourceRequestQueue ui_resource_request_queue_; |
451 | 474 |
452 int render_surface_layer_list_id_; | 475 int render_surface_layer_list_id_; |
453 | 476 |
454 // Whether or not Blink's viewport size was shrunk by the height of the top | 477 // Whether or not Blink's viewport size was shrunk by the height of the top |
455 // controls at the time of the last layout. | 478 // controls at the time of the last layout. |
456 bool top_controls_shrink_blink_size_; | 479 bool top_controls_shrink_blink_size_; |
457 | 480 |
458 float top_controls_height_; | 481 float top_controls_height_; |
459 | 482 |
460 // The amount that the top controls are shown from 0 (hidden) to 1 (fully | 483 // The amount that the top controls are shown from 0 (hidden) to 1 (fully |
461 // shown). | 484 // shown). |
462 scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; | 485 scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; |
463 | 486 |
464 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 487 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
465 | 488 |
466 private: | 489 private: |
467 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 490 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
468 }; | 491 }; |
469 | 492 |
470 } // namespace cc | 493 } // namespace cc |
471 | 494 |
472 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 495 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |