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> |
11 | 11 |
12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "cc/base/scoped_ptr_vector.h" | 14 #include "cc/base/scoped_ptr_vector.h" |
15 #include "cc/base/synced_property.h" | 15 #include "cc/base/synced_property.h" |
16 #include "cc/input/layer_selection_bound.h" | 16 #include "cc/input/layer_selection_bound.h" |
17 #include "cc/layers/layer_impl.h" | 17 #include "cc/layers/layer_impl.h" |
18 #include "cc/output/begin_frame_args.h" | 18 #include "cc/output/begin_frame_args.h" |
| 19 #include "cc/output/promise.h" |
| 20 #include "cc/output/promise_list.h" |
19 #include "cc/output/renderer.h" | 21 #include "cc/output/renderer.h" |
20 #include "cc/output/swap_promise.h" | 22 #include "cc/output/viewport_selection_bound.h" |
21 #include "cc/resources/ui_resource_client.h" | 23 #include "cc/resources/ui_resource_client.h" |
22 #include "cc/trees/layer_tree_host_impl.h" | 24 #include "cc/trees/layer_tree_host_impl.h" |
23 #include "cc/trees/property_tree.h" | 25 #include "cc/trees/property_tree.h" |
24 | 26 |
25 namespace base { | 27 namespace base { |
26 namespace trace_event { | 28 namespace trace_event { |
27 class TracedValue; | 29 class TracedValue; |
28 } | 30 } |
29 } | 31 } |
30 | 32 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // Useful for debug assertions, probably shouldn't be used for anything else. | 270 // Useful for debug assertions, probably shouldn't be used for anything else. |
269 Proxy* proxy() const; | 271 Proxy* proxy() const; |
270 | 272 |
271 void SetRootLayerScrollOffsetDelegate( | 273 void SetRootLayerScrollOffsetDelegate( |
272 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); | 274 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate); |
273 void UpdateRootScrollOffsetDelegate(); | 275 void UpdateRootScrollOffsetDelegate(); |
274 // Distribute the rool scroll between outer and inner viewport scroll layer. | 276 // Distribute the rool scroll between outer and inner viewport scroll layer. |
275 // The outer viewport scroll layer scrolls first. | 277 // The outer viewport scroll layer scrolls first. |
276 void DistributeRootScrollOffset(); | 278 void DistributeRootScrollOffset(); |
277 | 279 |
278 // Call this function when you expect there to be a swap buffer. | 280 void PassPromises(PromiseList* other); |
279 // See swap_promise.h for how to use SwapPromise. | 281 void QueuePromise(scoped_ptr<Promise> promise); |
280 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | |
281 | 282 |
282 // Take the |new_swap_promise| and append it to |swap_promise_list_|. | 283 void BreakSwapPromises(Promise::DidNotSwap::Reason reason); |
283 void PassSwapPromises(ScopedPtrVector<SwapPromise>* new_swap_promise); | |
284 void FinishSwapPromises(CompositorFrameMetadata* metadata); | 284 void FinishSwapPromises(CompositorFrameMetadata* metadata); |
285 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 285 |
| 286 void BreakActivationPromises(Promise::DidNotActivate::Reason reason); |
| 287 void FinishActivationPromises(CompositorFrameMetadata* metadata); |
286 | 288 |
287 void DidModifyTilePriorities(); | 289 void DidModifyTilePriorities(); |
288 | 290 |
289 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; | 291 ResourceProvider::ResourceId ResourceIdForUIResource(UIResourceId uid) const; |
290 void ProcessUIResourceRequestQueue(); | 292 void ProcessUIResourceRequestQueue(); |
291 | 293 |
292 bool IsUIResourceOpaque(UIResourceId uid) const; | 294 bool IsUIResourceOpaque(UIResourceId uid) const; |
293 | 295 |
294 void RegisterPictureLayerImpl(PictureLayerImpl* layer); | 296 void RegisterPictureLayerImpl(PictureLayerImpl* layer); |
295 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); | 297 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 bool needs_update_draw_properties_; | 403 bool needs_update_draw_properties_; |
402 | 404 |
403 // In impl-side painting mode, this is true when the tree may contain | 405 // In impl-side painting mode, this is true when the tree may contain |
404 // structural differences relative to the active tree. | 406 // structural differences relative to the active tree. |
405 bool needs_full_tree_sync_; | 407 bool needs_full_tree_sync_; |
406 | 408 |
407 bool next_activation_forces_redraw_; | 409 bool next_activation_forces_redraw_; |
408 | 410 |
409 bool has_ever_been_drawn_; | 411 bool has_ever_been_drawn_; |
410 | 412 |
411 ScopedPtrVector<SwapPromise> swap_promise_list_; | 413 PromiseList promises_; |
412 | 414 |
413 UIResourceRequestQueue ui_resource_request_queue_; | 415 UIResourceRequestQueue ui_resource_request_queue_; |
414 | 416 |
415 int render_surface_layer_list_id_; | 417 int render_surface_layer_list_id_; |
416 | 418 |
417 // Whether or not Blink's viewport size was shrunk by the height of the top | 419 // Whether or not Blink's viewport size was shrunk by the height of the top |
418 // controls at the time of the last layout. | 420 // controls at the time of the last layout. |
419 bool top_controls_shrink_blink_size_; | 421 bool top_controls_shrink_blink_size_; |
420 | 422 |
421 float top_controls_height_; | 423 float top_controls_height_; |
422 | 424 |
423 // The amount that the top controls are shown from 0 (hidden) to 1 (fully | 425 // The amount that the top controls are shown from 0 (hidden) to 1 (fully |
424 // shown). | 426 // shown). |
425 scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; | 427 scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; |
426 | 428 |
427 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 429 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
428 | 430 |
429 private: | 431 private: |
430 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 432 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
431 }; | 433 }; |
432 | 434 |
433 } // namespace cc | 435 } // namespace cc |
434 | 436 |
435 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 437 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |