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> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 const LayerTreeSettings& settings, | 87 const LayerTreeSettings& settings, |
88 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 88 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
89 | 89 |
90 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( | 90 static scoped_ptr<LayerTreeHost> CreateSingleThreaded( |
91 LayerTreeHostClient* client, | 91 LayerTreeHostClient* client, |
92 LayerTreeHostSingleThreadClient* single_thread_client, | 92 LayerTreeHostSingleThreadClient* single_thread_client, |
93 SharedBitmapManager* manager, | 93 SharedBitmapManager* manager, |
94 const LayerTreeSettings& settings); | 94 const LayerTreeSettings& settings); |
95 virtual ~LayerTreeHost(); | 95 virtual ~LayerTreeHost(); |
96 | 96 |
97 void SetLayerTreeHostClientReady(); | 97 void SetLayerTreeHostClientReady( |
98 scoped_ptr<OutputSurface> first_output_surface); | |
jamesr
2013/11/26 18:20:28
hmm, why do you need this? we don't makecurrent()
no sievers
2013/11/26 19:28:37
I'm happy to try removing |first_output_surface| e
no sievers
2013/11/26 22:19:57
Also note odd behavior that I see in some of the b
| |
98 | 99 |
99 void set_needs_filter_context() { needs_filter_context_ = true; } | 100 void set_needs_filter_context() { needs_filter_context_ = true; } |
100 bool needs_offscreen_context() const { | 101 bool needs_offscreen_context() const { |
101 return needs_filter_context_; | 102 return needs_filter_context_; |
102 } | 103 } |
103 | 104 |
104 // LayerTreeHost interface to Proxy. | 105 // LayerTreeHost interface to Proxy. |
105 void WillBeginMainFrame() { | 106 void WillBeginMainFrame() { |
106 client_->WillBeginMainFrame(source_frame_number_); | 107 client_->WillBeginMainFrame(source_frame_number_); |
107 } | 108 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
283 int id() const { return tree_id_; } | 284 int id() const { return tree_id_; } |
284 | 285 |
285 bool ScheduleMicroBenchmark(const std::string& benchmark_name, | 286 bool ScheduleMicroBenchmark(const std::string& benchmark_name, |
286 scoped_ptr<base::Value> value, | 287 scoped_ptr<base::Value> value, |
287 const MicroBenchmark::DoneCallback& callback); | 288 const MicroBenchmark::DoneCallback& callback); |
288 | 289 |
289 protected: | 290 protected: |
290 LayerTreeHost(LayerTreeHostClient* client, | 291 LayerTreeHost(LayerTreeHostClient* client, |
291 SharedBitmapManager* manager, | 292 SharedBitmapManager* manager, |
292 const LayerTreeSettings& settings); | 293 const LayerTreeSettings& settings); |
293 bool InitializeThreaded( | 294 void InitializeThreaded( |
294 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); | 295 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner); |
295 bool InitializeSingleThreaded( | 296 void InitializeSingleThreaded( |
296 LayerTreeHostSingleThreadClient* single_thread_client); | 297 LayerTreeHostSingleThreadClient* single_thread_client); |
297 bool InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); | 298 void InitializeForTesting(scoped_ptr<Proxy> proxy_for_testing); |
298 void SetOutputSurfaceLostForTesting(bool is_lost) { | 299 void SetOutputSurfaceLostForTesting(bool is_lost) { |
299 output_surface_lost_ = is_lost; | 300 output_surface_lost_ = is_lost; |
300 } | 301 } |
301 | 302 |
302 MicroBenchmarkController micro_benchmark_controller_; | 303 MicroBenchmarkController micro_benchmark_controller_; |
303 | 304 |
304 private: | 305 private: |
305 bool InitializeProxy(scoped_ptr<Proxy> proxy); | 306 void InitializeProxy(scoped_ptr<Proxy> proxy); |
306 | 307 |
307 void PaintLayerContents( | 308 void PaintLayerContents( |
308 const RenderSurfaceLayerList& render_surface_layer_list, | 309 const RenderSurfaceLayerList& render_surface_layer_list, |
309 ResourceUpdateQueue* queue, | 310 ResourceUpdateQueue* queue, |
310 bool* did_paint_content, | 311 bool* did_paint_content, |
311 bool* need_more_updates); | 312 bool* need_more_updates); |
312 void PaintMasksForRenderSurface(Layer* render_surface_layer, | 313 void PaintMasksForRenderSurface(Layer* render_surface_layer, |
313 ResourceUpdateQueue* queue, | 314 ResourceUpdateQueue* queue, |
314 bool* did_paint_content, | 315 bool* did_paint_content, |
315 bool* need_more_updates); | 316 bool* need_more_updates); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
349 bool needs_filter_context_; | 350 bool needs_filter_context_; |
350 | 351 |
351 base::CancelableClosure prepaint_callback_; | 352 base::CancelableClosure prepaint_callback_; |
352 | 353 |
353 LayerTreeHostClient* client_; | 354 LayerTreeHostClient* client_; |
354 scoped_ptr<Proxy> proxy_; | 355 scoped_ptr<Proxy> proxy_; |
355 | 356 |
356 int source_frame_number_; | 357 int source_frame_number_; |
357 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; | 358 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_instrumentation_; |
358 | 359 |
360 bool client_ready_; | |
359 bool output_surface_can_be_initialized_; | 361 bool output_surface_can_be_initialized_; |
360 bool output_surface_lost_; | 362 bool output_surface_lost_; |
361 int num_failed_recreate_attempts_; | 363 int num_failed_recreate_attempts_; |
362 | 364 |
363 scoped_refptr<Layer> root_layer_; | 365 scoped_refptr<Layer> root_layer_; |
364 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; | 366 scoped_refptr<HeadsUpDisplayLayer> hud_layer_; |
365 | 367 |
366 scoped_ptr<PrioritizedResourceManager> contents_texture_manager_; | 368 scoped_ptr<PrioritizedResourceManager> contents_texture_manager_; |
367 scoped_ptr<PrioritizedResource> surface_memory_placeholder_; | 369 scoped_ptr<PrioritizedResource> surface_memory_placeholder_; |
368 | 370 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
432 scoped_refptr<Layer> outer_viewport_scroll_layer_; | 434 scoped_refptr<Layer> outer_viewport_scroll_layer_; |
433 | 435 |
434 SharedBitmapManager* shared_bitmap_manager_; | 436 SharedBitmapManager* shared_bitmap_manager_; |
435 | 437 |
436 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 438 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
437 }; | 439 }; |
438 | 440 |
439 } // namespace cc | 441 } // namespace cc |
440 | 442 |
441 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 443 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |