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> |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "cc/input/layer_selection_bound.h" | 26 #include "cc/input/layer_selection_bound.h" |
27 #include "cc/input/scrollbar.h" | 27 #include "cc/input/scrollbar.h" |
28 #include "cc/input/top_controls_state.h" | 28 #include "cc/input/top_controls_state.h" |
29 #include "cc/layers/layer_lists.h" | 29 #include "cc/layers/layer_lists.h" |
30 #include "cc/output/output_surface.h" | 30 #include "cc/output/output_surface.h" |
31 #include "cc/output/renderer_capabilities.h" | 31 #include "cc/output/renderer_capabilities.h" |
32 #include "cc/output/swap_promise.h" | 32 #include "cc/output/swap_promise.h" |
33 #include "cc/resources/resource_format.h" | 33 #include "cc/resources/resource_format.h" |
34 #include "cc/resources/scoped_ui_resource.h" | 34 #include "cc/resources/scoped_ui_resource.h" |
35 #include "cc/surfaces/surface_sequence.h" | 35 #include "cc/surfaces/surface_sequence.h" |
| 36 #include "cc/trees/compositor_mode.h" |
36 #include "cc/trees/layer_tree_host_client.h" | 37 #include "cc/trees/layer_tree_host_client.h" |
37 #include "cc/trees/layer_tree_host_common.h" | 38 #include "cc/trees/layer_tree_host_common.h" |
38 #include "cc/trees/layer_tree_settings.h" | 39 #include "cc/trees/layer_tree_settings.h" |
39 #include "cc/trees/mutator_host_client.h" | 40 #include "cc/trees/mutator_host_client.h" |
40 #include "cc/trees/proxy.h" | 41 #include "cc/trees/proxy.h" |
41 #include "cc/trees/swap_promise_monitor.h" | 42 #include "cc/trees/swap_promise_monitor.h" |
42 #include "third_party/skia/include/core/SkColor.h" | 43 #include "third_party/skia/include/core/SkColor.h" |
43 #include "ui/gfx/geometry/rect.h" | 44 #include "ui/gfx/geometry/rect.h" |
44 | 45 |
45 namespace gpu { | 46 namespace gpu { |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 bool MaximumTargetScale(const Layer* layer, float* max_scale) const; | 353 bool MaximumTargetScale(const Layer* layer, float* max_scale) const; |
353 bool AnimationStartScale(const Layer* layer, float* start_scale) const; | 354 bool AnimationStartScale(const Layer* layer, float* start_scale) const; |
354 bool HasAnyAnimationTargetingProperty( | 355 bool HasAnyAnimationTargetingProperty( |
355 const Layer* layer, | 356 const Layer* layer, |
356 Animation::TargetProperty property) const; | 357 Animation::TargetProperty property) const; |
357 bool AnimationsPreserveAxisAlignment(const Layer* layer) const; | 358 bool AnimationsPreserveAxisAlignment(const Layer* layer) const; |
358 bool HasAnyAnimation(const Layer* layer) const; | 359 bool HasAnyAnimation(const Layer* layer) const; |
359 bool HasActiveAnimation(const Layer* layer) const; | 360 bool HasActiveAnimation(const Layer* layer) const; |
360 | 361 |
361 protected: | 362 protected: |
362 explicit LayerTreeHost(InitParams* params); | 363 LayerTreeHost(InitParams* params, CompositorMode mode); |
363 void InitializeThreaded( | 364 void InitializeThreaded( |
364 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 365 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
365 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 366 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
366 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 367 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
367 void InitializeSingleThreaded( | 368 void InitializeSingleThreaded( |
368 LayerTreeHostSingleThreadClient* single_thread_client, | 369 LayerTreeHostSingleThreadClient* single_thread_client, |
369 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 370 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
370 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 371 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
371 void InitializeForTesting(scoped_ptr<TaskRunnerProvider> task_runner_provider, | 372 void InitializeForTesting(scoped_ptr<TaskRunnerProvider> task_runner_provider, |
372 scoped_ptr<Proxy> proxy_for_testing); | 373 scoped_ptr<Proxy> proxy_for_testing); |
(...skipping 17 matching lines...) Expand all Loading... |
390 void OnCommitForSwapPromises(); | 391 void OnCommitForSwapPromises(); |
391 | 392 |
392 private: | 393 private: |
393 void InitializeProxy(scoped_ptr<Proxy> proxy); | 394 void InitializeProxy(scoped_ptr<Proxy> proxy); |
394 | 395 |
395 bool DoUpdateLayers(Layer* root_layer); | 396 bool DoUpdateLayers(Layer* root_layer); |
396 void UpdateHudLayer(); | 397 void UpdateHudLayer(); |
397 | 398 |
398 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); | 399 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); |
399 | 400 |
| 401 bool IsSingleThreaded() const; |
| 402 bool IsThreaded() const; |
| 403 |
400 struct UIResourceClientData { | 404 struct UIResourceClientData { |
401 UIResourceClient* client; | 405 UIResourceClient* client; |
402 gfx::Size size; | 406 gfx::Size size; |
403 }; | 407 }; |
404 | 408 |
405 typedef base::hash_map<UIResourceId, UIResourceClientData> | 409 typedef base::hash_map<UIResourceId, UIResourceClientData> |
406 UIResourceClientMap; | 410 UIResourceClientMap; |
407 UIResourceClientMap ui_resource_client_map_; | 411 UIResourceClientMap ui_resource_client_map_; |
408 int next_ui_resource_id_; | 412 int next_ui_resource_id_; |
409 | 413 |
410 typedef std::vector<UIResourceRequest> UIResourceRequestQueue; | 414 typedef std::vector<UIResourceRequest> UIResourceRequestQueue; |
411 UIResourceRequestQueue ui_resource_request_queue_; | 415 UIResourceRequestQueue ui_resource_request_queue_; |
412 | 416 |
413 void RecordGpuRasterizationHistogram(); | 417 void RecordGpuRasterizationHistogram(); |
414 void CalculateLCDTextMetricsCallback(Layer* layer); | 418 void CalculateLCDTextMetricsCallback(Layer* layer); |
415 | 419 |
416 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); | 420 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); |
417 | 421 |
418 void SetPropertyTreesNeedRebuild(); | 422 void SetPropertyTreesNeedRebuild(); |
419 | 423 |
| 424 const CompositorMode compositor_mode_; |
| 425 |
420 bool needs_full_tree_sync_; | 426 bool needs_full_tree_sync_; |
421 bool needs_meta_info_recomputation_; | 427 bool needs_meta_info_recomputation_; |
422 | 428 |
423 LayerTreeHostClient* client_; | 429 LayerTreeHostClient* client_; |
424 scoped_ptr<Proxy> proxy_; | 430 scoped_ptr<Proxy> proxy_; |
425 scoped_ptr<TaskRunnerProvider> task_runner_provider_; | 431 scoped_ptr<TaskRunnerProvider> task_runner_provider_; |
426 | 432 |
427 int source_frame_number_; | 433 int source_frame_number_; |
428 int meta_information_sequence_number_; | 434 int meta_information_sequence_number_; |
429 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; | 435 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 | 506 |
501 uint32_t surface_id_namespace_; | 507 uint32_t surface_id_namespace_; |
502 uint32_t next_surface_sequence_; | 508 uint32_t next_surface_sequence_; |
503 | 509 |
504 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 510 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
505 }; | 511 }; |
506 | 512 |
507 } // namespace cc | 513 } // namespace cc |
508 | 514 |
509 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 515 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |