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