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 <list> | 9 #include <list> |
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/scoped_vector.h" | |
18 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
19 #include "base/time/time.h" | 20 #include "base/time/time.h" |
20 #include "base/timer/timer.h" | 21 #include "base/timer/timer.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" |
25 #include "cc/base/swap_promise.h" | |
24 #include "cc/debug/micro_benchmark.h" | 26 #include "cc/debug/micro_benchmark.h" |
25 #include "cc/debug/micro_benchmark_controller.h" | 27 #include "cc/debug/micro_benchmark_controller.h" |
26 #include "cc/input/input_handler.h" | 28 #include "cc/input/input_handler.h" |
27 #include "cc/input/scrollbar.h" | 29 #include "cc/input/scrollbar.h" |
28 #include "cc/input/top_controls_state.h" | 30 #include "cc/input/top_controls_state.h" |
29 #include "cc/layers/layer_lists.h" | 31 #include "cc/layers/layer_lists.h" |
30 #include "cc/output/output_surface.h" | 32 #include "cc/output/output_surface.h" |
31 #include "cc/resources/resource_format.h" | 33 #include "cc/resources/resource_format.h" |
32 #include "cc/resources/scoped_ui_resource.h" | 34 #include "cc/resources/scoped_ui_resource.h" |
33 #include "cc/trees/layer_tree_host_client.h" | 35 #include "cc/trees/layer_tree_host_client.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 | 281 |
280 virtual gfx::Size GetUIResourceSize(UIResourceId id) const; | 282 virtual gfx::Size GetUIResourceSize(UIResourceId id) const; |
281 | 283 |
282 bool UsingSharedMemoryResources(); | 284 bool UsingSharedMemoryResources(); |
283 int id() const { return tree_id_; } | 285 int id() const { return tree_id_; } |
284 | 286 |
285 bool ScheduleMicroBenchmark(const std::string& benchmark_name, | 287 bool ScheduleMicroBenchmark(const std::string& benchmark_name, |
286 scoped_ptr<base::Value> value, | 288 scoped_ptr<base::Value> value, |
287 const MicroBenchmark::DoneCallback& callback); | 289 const MicroBenchmark::DoneCallback& callback); |
288 | 290 |
291 // Call this function when you expect there to be a swap buffer. | |
292 // See swap_promise.h for how to use SwapPromise. | |
293 // LTH will take the ownership of |swap_promise|. | |
danakj
2013/11/13 23:22:09
Spell out LayerTreeHost.
Yufeng Shen (Slow to review)
2013/11/14 22:09:55
Done.
| |
294 void QueueSwapPromise(SwapPromise* swap_promise); | |
danakj
2013/11/13 23:22:09
If ownership passes, why is this a raw pointer and
Yufeng Shen (Slow to review)
2013/11/14 22:09:55
Done.
| |
295 | |
296 bool HasQueuedSwapPromise(); | |
297 void FinishSwapPromise(); | |
298 void BreakSwapPromise(SwapPromise::DidNotSwapReason reason); | |
299 | |
289 protected: | 300 protected: |
290 LayerTreeHost(LayerTreeHostClient* client, | 301 LayerTreeHost(LayerTreeHostClient* client, |
291 SharedBitmapManager* manager, | 302 SharedBitmapManager* manager, |
292 const LayerTreeSettings& settings); | 303 const LayerTreeSettings& settings); |
293 bool InitializeThreaded( | 304 bool InitializeThreaded( |
294 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 305 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
295 bool InitializeSingleThreaded( | 306 bool InitializeSingleThreaded( |
296 LayerTreeHostSingleThreadClient* single_thread_client); | 307 LayerTreeHostSingleThreadClient* single_thread_client); |
297 bool InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); | 308 bool InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); |
298 void SetOutputSurfaceLostForTesting(bool is_lost) { | 309 void SetOutputSurfaceLostForTesting(bool is_lost) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 LCDTextMetrics lcd_text_metrics_; | 437 LCDTextMetrics lcd_text_metrics_; |
427 int tree_id_; | 438 int tree_id_; |
428 bool next_commit_forces_redraw_; | 439 bool next_commit_forces_redraw_; |
429 | 440 |
430 scoped_refptr<Layer> page_scale_layer_; | 441 scoped_refptr<Layer> page_scale_layer_; |
431 scoped_refptr<Layer> inner_viewport_scroll_layer_; | 442 scoped_refptr<Layer> inner_viewport_scroll_layer_; |
432 scoped_refptr<Layer> outer_viewport_scroll_layer_; | 443 scoped_refptr<Layer> outer_viewport_scroll_layer_; |
433 | 444 |
434 SharedBitmapManager* shared_bitmap_manager_; | 445 SharedBitmapManager* shared_bitmap_manager_; |
435 | 446 |
447 ScopedVector<SwapPromise> swap_promise_list_; | |
danakj
2013/11/13 23:22:09
ScopedPtrVector?
Yufeng Shen (Slow to review)
2013/11/14 22:09:55
Done.
| |
448 | |
436 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 449 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
437 }; | 450 }; |
438 | 451 |
439 } // namespace cc | 452 } // namespace cc |
440 | 453 |
441 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 454 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |