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_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "cc/input/top_controls_manager_client.h" | 25 #include "cc/input/top_controls_manager_client.h" |
26 #include "cc/layers/layer_lists.h" | 26 #include "cc/layers/layer_lists.h" |
27 #include "cc/layers/render_pass_sink.h" | 27 #include "cc/layers/render_pass_sink.h" |
28 #include "cc/output/begin_frame_args.h" | 28 #include "cc/output/begin_frame_args.h" |
29 #include "cc/output/managed_memory_policy.h" | 29 #include "cc/output/managed_memory_policy.h" |
30 #include "cc/output/output_surface_client.h" | 30 #include "cc/output/output_surface_client.h" |
31 #include "cc/output/renderer.h" | 31 #include "cc/output/renderer.h" |
32 #include "cc/quads/render_pass.h" | 32 #include "cc/quads/render_pass.h" |
33 #include "cc/resources/resource_provider.h" | 33 #include "cc/resources/resource_provider.h" |
34 #include "cc/resources/tile_manager.h" | 34 #include "cc/resources/tile_manager.h" |
| 35 #include "cc/scheduler/begin_frame_tracker.h" |
35 #include "cc/scheduler/commit_earlyout_reason.h" | 36 #include "cc/scheduler/commit_earlyout_reason.h" |
36 #include "cc/scheduler/draw_result.h" | 37 #include "cc/scheduler/draw_result.h" |
37 #include "skia/ext/refptr.h" | 38 #include "skia/ext/refptr.h" |
38 #include "third_party/skia/include/core/SkColor.h" | 39 #include "third_party/skia/include/core/SkColor.h" |
39 #include "ui/gfx/geometry/rect.h" | 40 #include "ui/gfx/geometry/rect.h" |
40 | 41 |
41 namespace cc { | 42 namespace cc { |
42 | 43 |
43 class CompletionEvent; | 44 class CompletionEvent; |
44 class CompositorFrameMetadata; | 45 class CompositorFrameMetadata; |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 426 |
426 gfx::Vector2dF accumulated_root_overscroll() const { | 427 gfx::Vector2dF accumulated_root_overscroll() const { |
427 return accumulated_root_overscroll_; | 428 return accumulated_root_overscroll_; |
428 } | 429 } |
429 | 430 |
430 bool pinch_gesture_active() const { return pinch_gesture_active_; } | 431 bool pinch_gesture_active() const { return pinch_gesture_active_; } |
431 | 432 |
432 void SetTreePriority(TreePriority priority); | 433 void SetTreePriority(TreePriority priority); |
433 TreePriority GetTreePriority() const; | 434 TreePriority GetTreePriority() const; |
434 | 435 |
435 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); | 436 // TODO(mithro): Remove these methods which expose control of the internal |
| 437 // BeginFrameArgs to external callers. LayerTreeHostImpl should manage its |
| 438 // own frame time based on WillBeginImplFrame and other methods. |
436 void ResetCurrentBeginFrameArgsForNextFrame(); | 439 void ResetCurrentBeginFrameArgsForNextFrame(); |
437 virtual BeginFrameArgs CurrentBeginFrameArgs() const; | 440 virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
438 | 441 |
439 // Expected time between two begin impl frame calls. | 442 // Expected time between two begin impl frame calls. |
440 base::TimeDelta begin_impl_frame_interval() const { | 443 base::TimeDelta CurrentBeginFrameInterval() const; |
441 return begin_impl_frame_interval_; | |
442 } | |
443 | 444 |
444 void AsValueInto(base::debug::TracedValue* value) const; | 445 void AsValueInto(base::debug::TracedValue* value) const; |
445 void AsValueWithFrameInto(FrameData* frame, | 446 void AsValueWithFrameInto(FrameData* frame, |
446 base::debug::TracedValue* value) const; | 447 base::debug::TracedValue* value) const; |
447 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 448 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
448 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( | 449 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( |
449 FrameData* frame) const; | 450 FrameData* frame) const; |
450 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() | 451 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() |
451 const; | 452 const; |
452 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; | 453 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 const AnimationRegistrar::AnimationControllerMap& | 523 const AnimationRegistrar::AnimationControllerMap& |
523 active_animation_controllers() const { | 524 active_animation_controllers() const { |
524 return animation_registrar_->active_animation_controllers(); | 525 return animation_registrar_->active_animation_controllers(); |
525 } | 526 } |
526 | 527 |
527 bool prepare_tiles_needed() const { return tile_priorities_dirty_; } | 528 bool prepare_tiles_needed() const { return tile_priorities_dirty_; } |
528 | 529 |
529 LayerTreeHostImplClient* client_; | 530 LayerTreeHostImplClient* client_; |
530 Proxy* proxy_; | 531 Proxy* proxy_; |
531 | 532 |
| 533 BeginFrameTracker current_begin_frame_tracker_; |
| 534 |
532 private: | 535 private: |
533 void CreateAndSetRenderer(); | 536 void CreateAndSetRenderer(); |
534 void CreateAndSetTileManager(); | 537 void CreateAndSetTileManager(); |
535 void DestroyTileManager(); | 538 void DestroyTileManager(); |
536 void ReleaseTreeResources(); | 539 void ReleaseTreeResources(); |
537 void EnforceZeroBudget(bool zero_budget); | 540 void EnforceZeroBudget(bool zero_budget); |
538 | 541 |
539 bool UsePendingTreeForSync() const; | 542 bool UsePendingTreeForSync() const; |
540 bool IsSynchronousSingleThreaded() const; | 543 bool IsSynchronousSingleThreaded() const; |
541 | 544 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 // - viewport_rect_for_tile_priority_ is the rect in view space used for | 698 // - viewport_rect_for_tile_priority_ is the rect in view space used for |
696 // tiling priority. | 699 // tiling priority. |
697 gfx::Transform external_transform_; | 700 gfx::Transform external_transform_; |
698 gfx::Rect external_viewport_; | 701 gfx::Rect external_viewport_; |
699 gfx::Rect external_clip_; | 702 gfx::Rect external_clip_; |
700 gfx::Rect viewport_rect_for_tile_priority_; | 703 gfx::Rect viewport_rect_for_tile_priority_; |
701 bool resourceless_software_draw_; | 704 bool resourceless_software_draw_; |
702 | 705 |
703 gfx::Rect viewport_damage_rect_; | 706 gfx::Rect viewport_damage_rect_; |
704 | 707 |
705 BeginFrameArgs current_begin_frame_args_; | |
706 | |
707 // Expected time between two begin impl frame calls. | |
708 base::TimeDelta begin_impl_frame_interval_; | |
709 | |
710 scoped_ptr<AnimationRegistrar> animation_registrar_; | 708 scoped_ptr<AnimationRegistrar> animation_registrar_; |
711 | 709 |
712 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 710 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
713 MicroBenchmarkControllerImpl micro_benchmark_controller_; | 711 MicroBenchmarkControllerImpl micro_benchmark_controller_; |
714 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; | 712 scoped_ptr<TaskGraphRunner> single_thread_synchronous_task_graph_runner_; |
715 | 713 |
716 // Optional callback to notify of new tree activations. | 714 // Optional callback to notify of new tree activations. |
717 base::Closure tree_activation_callback_; | 715 base::Closure tree_activation_callback_; |
718 | 716 |
719 SharedBitmapManager* shared_bitmap_manager_; | 717 SharedBitmapManager* shared_bitmap_manager_; |
720 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 718 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
721 int id_; | 719 int id_; |
722 | 720 |
723 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 721 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
724 | 722 |
725 std::vector<PictureLayerImpl*> picture_layers_; | 723 std::vector<PictureLayerImpl*> picture_layers_; |
726 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 724 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
727 | 725 |
728 bool requires_high_res_to_draw_; | 726 bool requires_high_res_to_draw_; |
729 bool required_for_draw_tile_is_top_of_raster_queue_; | 727 bool required_for_draw_tile_is_top_of_raster_queue_; |
730 | 728 |
731 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 729 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
732 }; | 730 }; |
733 | 731 |
734 } // namespace cc | 732 } // namespace cc |
735 | 733 |
736 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 734 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |