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 <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/cancelable_callback.h" | 14 #include "base/cancelable_callback.h" |
15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
21 #include "base/trace_event/trace_event.h" | |
21 #include "cc/animation/animation_events.h" | 22 #include "cc/animation/animation_events.h" |
22 #include "cc/base/cc_export.h" | 23 #include "cc/base/cc_export.h" |
23 #include "cc/base/scoped_ptr_vector.h" | 24 #include "cc/base/scoped_ptr_vector.h" |
24 #include "cc/debug/frame_timing_tracker.h" | 25 #include "cc/debug/frame_timing_tracker.h" |
25 #include "cc/debug/micro_benchmark.h" | 26 #include "cc/debug/micro_benchmark.h" |
26 #include "cc/debug/micro_benchmark_controller.h" | 27 #include "cc/debug/micro_benchmark_controller.h" |
27 #include "cc/input/input_handler.h" | 28 #include "cc/input/input_handler.h" |
28 #include "cc/input/layer_selection_bound.h" | 29 #include "cc/input/layer_selection_bound.h" |
29 #include "cc/input/scrollbar.h" | 30 #include "cc/input/scrollbar.h" |
30 #include "cc/input/top_controls_state.h" | 31 #include "cc/input/top_controls_state.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 305 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
305 | 306 |
306 // Call this function when you expect there to be a swap buffer. | 307 // Call this function when you expect there to be a swap buffer. |
307 // See swap_promise.h for how to use SwapPromise. | 308 // See swap_promise.h for how to use SwapPromise. |
308 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); | 309 void QueueSwapPromise(scoped_ptr<SwapPromise> swap_promise); |
309 | 310 |
310 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); | 311 void BreakSwapPromises(SwapPromise::DidNotSwapReason reason); |
311 | 312 |
312 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } | 313 size_t num_queued_swap_promises() const { return swap_promise_list_.size(); } |
313 | 314 |
315 void trace_commit() { | |
316 for (unsigned int i = 0; i < num_queued_swap_promises(); i++) { | |
317 SwapPromise* swap_promise_ = swap_promise_list_.at(i); | |
318 | |
319 TRACE_EVENT_FLOW_STEP0("input,benchmark", "LatencyInfo.Flow", | |
320 TRACE_ID_DONT_MANGLE(swap_promise_->TraceId()), | |
Yufeng Shen (Slow to review)
2015/06/15 23:48:25
Not all SwapPromise is carrying LatencyInfo with i
| |
321 "HanldeInputEventMainCommit"); | |
322 } | |
323 } | |
324 | |
314 void set_surface_id_namespace(uint32_t id_namespace); | 325 void set_surface_id_namespace(uint32_t id_namespace); |
315 SurfaceSequence CreateSurfaceSequence(); | 326 SurfaceSequence CreateSurfaceSequence(); |
316 | 327 |
317 void SetChildrenNeedBeginFrames(bool children_need_begin_frames) const; | 328 void SetChildrenNeedBeginFrames(bool children_need_begin_frames) const; |
318 void SendBeginFramesToChildren(const BeginFrameArgs& args) const; | 329 void SendBeginFramesToChildren(const BeginFrameArgs& args) const; |
319 | 330 |
320 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); | 331 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); |
321 | 332 |
322 PropertyTrees* property_trees() { return &property_trees_; } | 333 PropertyTrees* property_trees() { return &property_trees_; } |
323 bool needs_meta_info_recomputation() { | 334 bool needs_meta_info_recomputation() { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
489 | 500 |
490 uint32_t surface_id_namespace_; | 501 uint32_t surface_id_namespace_; |
491 uint32_t next_surface_sequence_; | 502 uint32_t next_surface_sequence_; |
492 | 503 |
493 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 504 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
494 }; | 505 }; |
495 | 506 |
496 } // namespace cc | 507 } // namespace cc |
497 | 508 |
498 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 509 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |