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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 void WillCommit(); | 138 void WillCommit(); |
139 void CommitComplete(); | 139 void CommitComplete(); |
140 void SetOutputSurface(std::unique_ptr<OutputSurface> output_surface); | 140 void SetOutputSurface(std::unique_ptr<OutputSurface> output_surface); |
141 std::unique_ptr<OutputSurface> ReleaseOutputSurface(); | 141 std::unique_ptr<OutputSurface> ReleaseOutputSurface(); |
142 void RequestNewOutputSurface(); | 142 void RequestNewOutputSurface(); |
143 void DidInitializeOutputSurface(); | 143 void DidInitializeOutputSurface(); |
144 void DidFailToInitializeOutputSurface(); | 144 void DidFailToInitializeOutputSurface(); |
145 virtual std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( | 145 virtual std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( |
146 LayerTreeHostImplClient* client); | 146 LayerTreeHostImplClient* client); |
147 void DidLoseOutputSurface(); | 147 void DidLoseOutputSurface(); |
148 bool output_surface_lost() const { return output_surface_lost_; } | |
149 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } | 148 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } |
150 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } | 149 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } |
151 bool UpdateLayers(); | 150 bool UpdateLayers(); |
152 // Called when the compositor completed page scale animation. | 151 // Called when the compositor completed page scale animation. |
153 void DidCompletePageScaleAnimation(); | 152 void DidCompletePageScaleAnimation(); |
154 | 153 |
155 LayerTreeHostClient* client() { return client_; } | 154 LayerTreeHostClient* client() { return client_; } |
156 const base::WeakPtr<InputHandler>& GetInputHandler() { | 155 const base::WeakPtr<InputHandler>& GetInputHandler() { |
157 return input_handler_weak_ptr_; | 156 return input_handler_weak_ptr_; |
158 } | 157 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 319 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
321 void InitializeRemoteClient( | 320 void InitializeRemoteClient( |
322 RemoteProtoChannel* remote_proto_channel, | 321 RemoteProtoChannel* remote_proto_channel, |
323 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 322 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
324 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 323 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
325 void InitializeForTesting( | 324 void InitializeForTesting( |
326 std::unique_ptr<TaskRunnerProvider> task_runner_provider, | 325 std::unique_ptr<TaskRunnerProvider> task_runner_provider, |
327 std::unique_ptr<Proxy> proxy_for_testing, | 326 std::unique_ptr<Proxy> proxy_for_testing, |
328 std::unique_ptr<BeginFrameSource> external_begin_frame_source); | 327 std::unique_ptr<BeginFrameSource> external_begin_frame_source); |
329 void InitializePictureCacheForTesting(); | 328 void InitializePictureCacheForTesting(); |
330 void SetOutputSurfaceLostForTesting(bool is_lost) { | |
331 output_surface_lost_ = is_lost; | |
332 } | |
333 void SetTaskRunnerProviderForTesting( | 329 void SetTaskRunnerProviderForTesting( |
334 std::unique_ptr<TaskRunnerProvider> task_runner_provider); | 330 std::unique_ptr<TaskRunnerProvider> task_runner_provider); |
335 | 331 |
336 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and | 332 // shared_bitmap_manager(), gpu_memory_buffer_manager(), and |
337 // task_graph_runner() return valid values only until the LayerTreeHostImpl is | 333 // task_graph_runner() return valid values only until the LayerTreeHostImpl is |
338 // created in CreateLayerTreeHostImpl(). | 334 // created in CreateLayerTreeHostImpl(). |
339 SharedBitmapManager* shared_bitmap_manager() const { | 335 SharedBitmapManager* shared_bitmap_manager() const { |
340 return shared_bitmap_manager_; | 336 return shared_bitmap_manager_; |
341 } | 337 } |
342 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { | 338 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() const { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 std::unique_ptr<RenderingStatsInstrumentation> | 394 std::unique_ptr<RenderingStatsInstrumentation> |
399 rendering_stats_instrumentation_; | 395 rendering_stats_instrumentation_; |
400 | 396 |
401 // |current_output_surface_| can't be updated until we've successfully | 397 // |current_output_surface_| can't be updated until we've successfully |
402 // initialized a new output surface. |new_output_surface_| contains the | 398 // initialized a new output surface. |new_output_surface_| contains the |
403 // new output surface that is currently being initialized. If initialization | 399 // new output surface that is currently being initialized. If initialization |
404 // is successful then |new_output_surface_| replaces | 400 // is successful then |new_output_surface_| replaces |
405 // |current_output_surface_|. | 401 // |current_output_surface_|. |
406 std::unique_ptr<OutputSurface> new_output_surface_; | 402 std::unique_ptr<OutputSurface> new_output_surface_; |
407 std::unique_ptr<OutputSurface> current_output_surface_; | 403 std::unique_ptr<OutputSurface> current_output_surface_; |
408 bool output_surface_lost_; | |
409 | 404 |
410 base::WeakPtr<InputHandler> input_handler_weak_ptr_; | 405 base::WeakPtr<InputHandler> input_handler_weak_ptr_; |
411 | 406 |
412 const LayerTreeSettings settings_; | 407 const LayerTreeSettings settings_; |
413 LayerTreeDebugState debug_state_; | 408 LayerTreeDebugState debug_state_; |
414 | 409 |
415 bool visible_; | 410 bool visible_; |
416 | 411 |
417 bool has_gpu_rasterization_trigger_; | 412 bool has_gpu_rasterization_trigger_; |
418 bool content_is_suitable_for_gpu_rasterization_; | 413 bool content_is_suitable_for_gpu_rasterization_; |
(...skipping 22 matching lines...) Expand all Loading... |
441 uint32_t surface_client_id_; | 436 uint32_t surface_client_id_; |
442 uint32_t next_surface_sequence_; | 437 uint32_t next_surface_sequence_; |
443 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; | 438 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; |
444 | 439 |
445 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 440 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
446 }; | 441 }; |
447 | 442 |
448 } // namespace cc | 443 } // namespace cc |
449 | 444 |
450 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 445 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |