OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_HOST_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 // When a SwapPromiseMonitor is created on the main thread, it calls | 329 // When a SwapPromiseMonitor is created on the main thread, it calls |
330 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. | 330 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. |
331 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | 331 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
332 // to unregister itself. | 332 // to unregister itself. |
333 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 333 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
334 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 334 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
335 | 335 |
336 // Call this function when you expect there to be a swap buffer. | 336 // Call this function when you expect there to be a swap buffer. |
337 // See swap_promise.h for how to use SwapPromise. | 337 // See swap_promise.h for how to use SwapPromise. |
338 void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise); | 338 void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise); |
| 339 void QueueForcedRedrawSwapPromise(std::unique_ptr<SwapPromise> swap_promise); |
339 | 340 |
340 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 341 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
341 | 342 |
342 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } | 343 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } |
343 | 344 |
344 void set_surface_client_id(uint32_t client_id); | 345 void set_surface_client_id(uint32_t client_id); |
345 SurfaceSequence CreateSurfaceSequence(); | 346 SurfaceSequence CreateSurfaceSequence(); |
346 | 347 |
347 PropertyTrees* property_trees() { return &property_trees_; } | 348 PropertyTrees* property_trees() { return &property_trees_; } |
348 bool needs_meta_info_recomputation() { | 349 bool needs_meta_info_recomputation() { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 std::unordered_map<UIResourceId, UIResourceClientData>; | 504 std::unordered_map<UIResourceId, UIResourceClientData>; |
504 UIResourceClientMap ui_resource_client_map_; | 505 UIResourceClientMap ui_resource_client_map_; |
505 int next_ui_resource_id_; | 506 int next_ui_resource_id_; |
506 | 507 |
507 using UIResourceRequestQueue = std::vector<UIResourceRequest>; | 508 using UIResourceRequestQueue = std::vector<UIResourceRequest>; |
508 UIResourceRequestQueue ui_resource_request_queue_; | 509 UIResourceRequestQueue ui_resource_request_queue_; |
509 | 510 |
510 void CalculateLCDTextMetricsCallback(Layer* layer); | 511 void CalculateLCDTextMetricsCallback(Layer* layer); |
511 | 512 |
512 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); | 513 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); |
| 514 void NotifySwapPromiseMonitorsOfSetNeedsForcedRedraw(); |
513 | 515 |
514 void SetPropertyTreesNeedRebuild(); | 516 void SetPropertyTreesNeedRebuild(); |
515 | 517 |
516 const CompositorMode compositor_mode_; | 518 const CompositorMode compositor_mode_; |
517 | 519 |
518 bool needs_full_tree_sync_; | 520 bool needs_full_tree_sync_; |
519 bool needs_meta_info_recomputation_; | 521 bool needs_meta_info_recomputation_; |
520 | 522 |
521 LayerTreeHostClient* client_; | 523 LayerTreeHostClient* client_; |
522 std::unique_ptr<Proxy> proxy_; | 524 std::unique_ptr<Proxy> proxy_; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 | 591 |
590 SharedBitmapManager* shared_bitmap_manager_; | 592 SharedBitmapManager* shared_bitmap_manager_; |
591 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 593 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
592 TaskGraphRunner* task_graph_runner_; | 594 TaskGraphRunner* task_graph_runner_; |
593 | 595 |
594 ImageSerializationProcessor* image_serialization_processor_; | 596 ImageSerializationProcessor* image_serialization_processor_; |
595 std::unique_ptr<EnginePictureCache> engine_picture_cache_; | 597 std::unique_ptr<EnginePictureCache> engine_picture_cache_; |
596 std::unique_ptr<ClientPictureCache> client_picture_cache_; | 598 std::unique_ptr<ClientPictureCache> client_picture_cache_; |
597 | 599 |
598 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; | 600 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; |
| 601 std::vector<std::unique_ptr<SwapPromise>> forced_redraw_swap_promises_; |
599 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 602 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
600 | 603 |
601 PropertyTrees property_trees_; | 604 PropertyTrees property_trees_; |
602 | 605 |
603 using LayerIdMap = std::unordered_map<int, Layer*>; | 606 using LayerIdMap = std::unordered_map<int, Layer*>; |
604 LayerIdMap layer_id_map_; | 607 LayerIdMap layer_id_map_; |
605 | 608 |
606 using ElementLayersMap = std::unordered_map<ElementId, Layer*, ElementIdHash>; | 609 using ElementLayersMap = std::unordered_map<ElementId, Layer*, ElementIdHash>; |
607 ElementLayersMap element_layers_map_; | 610 ElementLayersMap element_layers_map_; |
608 | 611 |
609 // Set of layers that need to push properties. | 612 // Set of layers that need to push properties. |
610 std::unordered_set<Layer*> layers_that_should_push_properties_; | 613 std::unordered_set<Layer*> layers_that_should_push_properties_; |
611 | 614 |
612 uint32_t surface_client_id_; | 615 uint32_t surface_client_id_; |
613 uint32_t next_surface_sequence_; | 616 uint32_t next_surface_sequence_; |
614 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; | 617 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; |
615 | 618 |
616 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 619 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
617 }; | 620 }; |
618 | 621 |
619 } // namespace cc | 622 } // namespace cc |
620 | 623 |
621 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 624 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |