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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 void FinishAllRendering(); | 136 void FinishAllRendering(); |
137 | 137 |
138 void SetDeferCommits(bool defer_commits); | 138 void SetDeferCommits(bool defer_commits); |
139 | 139 |
140 int source_frame_number() const { return source_frame_number_; } | 140 int source_frame_number() const { return source_frame_number_; } |
141 | 141 |
142 int meta_information_sequence_number() { | 142 int meta_information_sequence_number() { |
143 return meta_information_sequence_number_; | 143 return meta_information_sequence_number_; |
144 } | 144 } |
145 | 145 |
| 146 bool gpu_rasterization_histogram_recorded() const { |
| 147 return gpu_rasterization_histogram_recorded_; |
| 148 } |
| 149 |
146 void IncrementMetaInformationSequenceNumber() { | 150 void IncrementMetaInformationSequenceNumber() { |
147 meta_information_sequence_number_++; | 151 meta_information_sequence_number_++; |
148 } | 152 } |
149 | 153 |
150 void SetNeedsDisplayOnAllLayers(); | 154 void SetNeedsDisplayOnAllLayers(); |
151 | 155 |
152 void CollectRenderingStats(RenderingStats* stats) const; | 156 void CollectRenderingStats(RenderingStats* stats) const; |
153 | 157 |
154 RenderingStatsInstrumentation* rendering_stats_instrumentation() const { | 158 RenderingStatsInstrumentation* rendering_stats_instrumentation() const { |
155 return rendering_stats_instrumentation_.get(); | 159 return rendering_stats_instrumentation_.get(); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 371 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
368 void InitializeSingleThreaded( | 372 void InitializeSingleThreaded( |
369 LayerTreeHostSingleThreadClient* single_thread_client, | 373 LayerTreeHostSingleThreadClient* single_thread_client, |
370 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 374 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
371 scoped_ptr<BeginFrameSource> external_begin_frame_source); | 375 scoped_ptr<BeginFrameSource> external_begin_frame_source); |
372 void InitializeForTesting(scoped_ptr<TaskRunnerProvider> task_runner_provider, | 376 void InitializeForTesting(scoped_ptr<TaskRunnerProvider> task_runner_provider, |
373 scoped_ptr<Proxy> proxy_for_testing); | 377 scoped_ptr<Proxy> proxy_for_testing); |
374 void SetOutputSurfaceLostForTesting(bool is_lost) { | 378 void SetOutputSurfaceLostForTesting(bool is_lost) { |
375 output_surface_lost_ = is_lost; | 379 output_surface_lost_ = is_lost; |
376 } | 380 } |
| 381 void SetTaskRunnerProviderForTesting( |
| 382 scoped_ptr<TaskRunnerProvider> task_runner_provider); |
377 | 383 |
378 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and | 384 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and |
379 // task_graph_runner() return valid values only until the LayerTreeHostImpl is | 385 // task_graph_runner() return valid values only until the LayerTreeHostImpl is |
380 // created in CreateLayerTreeHostImpl(). | 386 // created in CreateLayerTreeHostImpl(). |
381 SharedBitmapManager* shared_bitmap_manager() const { | 387 SharedBitmapManager* shared_bitmap_manager() const { |
382 return shared_bitmap_manager_; | 388 return shared_bitmap_manager_; |
383 } | 389 } |
384 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { | 390 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { |
385 return gpu_memory_buffer_manager_; | 391 return gpu_memory_buffer_manager_; |
386 } | 392 } |
387 TaskGraphRunner* task_graph_runner() const { return task_graph_runner_; } | 393 TaskGraphRunner* task_graph_runner() const { return task_graph_runner_; } |
388 | 394 |
389 MicroBenchmarkController micro_benchmark_controller_; | 395 MicroBenchmarkController micro_benchmark_controller_; |
390 | 396 |
391 void OnCommitForSwapPromises(); | 397 void OnCommitForSwapPromises(); |
392 | 398 |
| 399 void RecordGpuRasterizationHistogram(); |
| 400 |
393 private: | 401 private: |
394 void InitializeProxy(scoped_ptr<Proxy> proxy); | 402 void InitializeProxy(scoped_ptr<Proxy> proxy); |
395 | 403 |
396 bool DoUpdateLayers(Layer* root_layer); | 404 bool DoUpdateLayers(Layer* root_layer); |
397 void UpdateHudLayer(); | 405 void UpdateHudLayer(); |
398 | 406 |
399 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); | 407 bool AnimateLayersRecursive(Layer* current, base::TimeTicks time); |
400 | 408 |
401 bool IsSingleThreaded() const; | 409 bool IsSingleThreaded() const; |
402 bool IsThreaded() const; | 410 bool IsThreaded() const; |
403 | 411 |
404 struct UIResourceClientData { | 412 struct UIResourceClientData { |
405 UIResourceClient* client; | 413 UIResourceClient* client; |
406 gfx::Size size; | 414 gfx::Size size; |
407 }; | 415 }; |
408 | 416 |
409 typedef base::hash_map<UIResourceId, UIResourceClientData> | 417 typedef base::hash_map<UIResourceId, UIResourceClientData> |
410 UIResourceClientMap; | 418 UIResourceClientMap; |
411 UIResourceClientMap ui_resource_client_map_; | 419 UIResourceClientMap ui_resource_client_map_; |
412 int next_ui_resource_id_; | 420 int next_ui_resource_id_; |
413 | 421 |
414 typedef std::vector<UIResourceRequest> UIResourceRequestQueue; | 422 typedef std::vector<UIResourceRequest> UIResourceRequestQueue; |
415 UIResourceRequestQueue ui_resource_request_queue_; | 423 UIResourceRequestQueue ui_resource_request_queue_; |
416 | 424 |
417 void RecordGpuRasterizationHistogram(); | |
418 void CalculateLCDTextMetricsCallback(Layer* layer); | 425 void CalculateLCDTextMetricsCallback(Layer* layer); |
419 | 426 |
420 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); | 427 void NotifySwapPromiseMonitorsOfSetNeedsCommit(); |
421 | 428 |
422 void SetPropertyTreesNeedRebuild(); | 429 void SetPropertyTreesNeedRebuild(); |
423 | 430 |
424 const CompositorMode compositor_mode_; | 431 const CompositorMode compositor_mode_; |
425 | 432 |
426 bool needs_full_tree_sync_; | 433 bool needs_full_tree_sync_; |
427 bool needs_meta_info_recomputation_; | 434 bool needs_meta_info_recomputation_; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 513 |
507 uint32_t surface_id_namespace_; | 514 uint32_t surface_id_namespace_; |
508 uint32_t next_surface_sequence_; | 515 uint32_t next_surface_sequence_; |
509 | 516 |
510 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 517 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
511 }; | 518 }; |
512 | 519 |
513 } // namespace cc | 520 } // namespace cc |
514 | 521 |
515 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 522 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |