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 13 matching lines...) Expand all Loading... |
24 #include "cc/base/cc_export.h" | 24 #include "cc/base/cc_export.h" |
25 #include "cc/debug/micro_benchmark.h" | 25 #include "cc/debug/micro_benchmark.h" |
26 #include "cc/debug/micro_benchmark_controller.h" | 26 #include "cc/debug/micro_benchmark_controller.h" |
27 #include "cc/input/event_listener_properties.h" | 27 #include "cc/input/event_listener_properties.h" |
28 #include "cc/input/input_handler.h" | 28 #include "cc/input/input_handler.h" |
29 #include "cc/input/layer_selection_bound.h" | 29 #include "cc/input/layer_selection_bound.h" |
30 #include "cc/input/scrollbar.h" | 30 #include "cc/input/scrollbar.h" |
31 #include "cc/input/top_controls_state.h" | 31 #include "cc/input/top_controls_state.h" |
32 #include "cc/layers/layer_collections.h" | 32 #include "cc/layers/layer_collections.h" |
33 #include "cc/layers/layer_list_iterator.h" | 33 #include "cc/layers/layer_list_iterator.h" |
34 #include "cc/output/output_surface.h" | 34 #include "cc/output/compositor_frame_sink.h" |
35 #include "cc/output/swap_promise.h" | 35 #include "cc/output/swap_promise.h" |
36 #include "cc/resources/resource_format.h" | 36 #include "cc/resources/resource_format.h" |
37 #include "cc/surfaces/surface_sequence.h" | 37 #include "cc/surfaces/surface_sequence.h" |
38 #include "cc/trees/compositor_mode.h" | 38 #include "cc/trees/compositor_mode.h" |
39 #include "cc/trees/layer_tree.h" | 39 #include "cc/trees/layer_tree.h" |
40 #include "cc/trees/layer_tree_host_client.h" | 40 #include "cc/trees/layer_tree_host_client.h" |
41 #include "cc/trees/layer_tree_host_interface.h" | 41 #include "cc/trees/layer_tree_host_interface.h" |
42 #include "cc/trees/layer_tree_settings.h" | 42 #include "cc/trees/layer_tree_settings.h" |
43 #include "cc/trees/proxy.h" | 43 #include "cc/trees/proxy.h" |
44 #include "cc/trees/swap_promise_monitor.h" | 44 #include "cc/trees/swap_promise_monitor.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 const LayerTree* GetLayerTree() const override; | 145 const LayerTree* GetLayerTree() const override; |
146 UIResourceManager* GetUIResourceManager() const override; | 146 UIResourceManager* GetUIResourceManager() const override; |
147 TaskRunnerProvider* GetTaskRunnerProvider() const override; | 147 TaskRunnerProvider* GetTaskRunnerProvider() const override; |
148 const LayerTreeSettings& GetSettings() const override; | 148 const LayerTreeSettings& GetSettings() const override; |
149 void SetSurfaceClientId(uint32_t client_id) override; | 149 void SetSurfaceClientId(uint32_t client_id) override; |
150 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator) override; | 150 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator) override; |
151 void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise) override; | 151 void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise) override; |
152 void SetHasGpuRasterizationTrigger(bool has_trigger) override; | 152 void SetHasGpuRasterizationTrigger(bool has_trigger) override; |
153 void SetVisible(bool visible) override; | 153 void SetVisible(bool visible) override; |
154 bool IsVisible() const override; | 154 bool IsVisible() const override; |
155 void SetOutputSurface(std::unique_ptr<OutputSurface> output_surface) override; | 155 void SetCompositorFrameSink( |
156 std::unique_ptr<OutputSurface> ReleaseOutputSurface() override; | 156 std::unique_ptr<CompositorFrameSink> compositor_frame_sink) override; |
| 157 std::unique_ptr<CompositorFrameSink> ReleaseCompositorFrameSink() override; |
157 void SetNeedsAnimate() override; | 158 void SetNeedsAnimate() override; |
158 void SetNeedsUpdateLayers() override; | 159 void SetNeedsUpdateLayers() override; |
159 void SetNeedsCommit() override; | 160 void SetNeedsCommit() override; |
160 bool BeginMainFrameRequested() const override; | 161 bool BeginMainFrameRequested() const override; |
161 bool CommitRequested() const override; | 162 bool CommitRequested() const override; |
162 void SetDeferCommits(bool defer_commits) override; | 163 void SetDeferCommits(bool defer_commits) override; |
163 void LayoutAndUpdateLayers() override; | 164 void LayoutAndUpdateLayers() override; |
164 void Composite(base::TimeTicks frame_begin_time) override; | 165 void Composite(base::TimeTicks frame_begin_time) override; |
165 void SetNeedsRedraw() override; | 166 void SetNeedsRedraw() override; |
166 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; | 167 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; |
(...skipping 18 matching lines...) Expand all Loading... |
185 // LayerTreeHost interface to Proxy. | 186 // LayerTreeHost interface to Proxy. |
186 void WillBeginMainFrame(); | 187 void WillBeginMainFrame(); |
187 void DidBeginMainFrame(); | 188 void DidBeginMainFrame(); |
188 void BeginMainFrame(const BeginFrameArgs& args); | 189 void BeginMainFrame(const BeginFrameArgs& args); |
189 void BeginMainFrameNotExpectedSoon(); | 190 void BeginMainFrameNotExpectedSoon(); |
190 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); | 191 void AnimateLayers(base::TimeTicks monotonic_frame_begin_time); |
191 void RequestMainFrameUpdate(); | 192 void RequestMainFrameUpdate(); |
192 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); | 193 void FinishCommitOnImplThread(LayerTreeHostImpl* host_impl); |
193 void WillCommit(); | 194 void WillCommit(); |
194 void CommitComplete(); | 195 void CommitComplete(); |
195 void RequestNewOutputSurface(); | 196 void RequestNewCompositorFrameSink(); |
196 void DidInitializeOutputSurface(); | 197 void DidInitializeCompositorFrameSink(); |
197 void DidFailToInitializeOutputSurface(); | 198 void DidFailToInitializeCompositorFrameSink(); |
198 virtual std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( | 199 virtual std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( |
199 LayerTreeHostImplClient* client); | 200 LayerTreeHostImplClient* client); |
200 void DidLoseOutputSurface(); | 201 void DidLoseCompositorFrameSink(); |
201 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } | 202 void DidCommitAndDrawFrame() { client_->DidCommitAndDrawFrame(); } |
202 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } | 203 void DidCompleteSwapBuffers() { client_->DidCompleteSwapBuffers(); } |
203 bool UpdateLayers(); | 204 bool UpdateLayers(); |
204 // Called when the compositor completed page scale animation. | 205 // Called when the compositor completed page scale animation. |
205 void DidCompletePageScaleAnimation(); | 206 void DidCompletePageScaleAnimation(); |
206 void ApplyScrollAndScale(ScrollAndScaleSet* info); | 207 void ApplyScrollAndScale(ScrollAndScaleSet* info); |
207 | 208 |
208 LayerTreeHostClient* client() { return client_; } | 209 LayerTreeHostClient* client() { return client_; } |
209 | 210 |
210 bool gpu_rasterization_histogram_recorded() const { | 211 bool gpu_rasterization_histogram_recorded() const { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 std::unique_ptr<UIResourceManager> ui_resource_manager_; | 351 std::unique_ptr<UIResourceManager> ui_resource_manager_; |
351 | 352 |
352 LayerTreeHostClient* client_; | 353 LayerTreeHostClient* client_; |
353 std::unique_ptr<Proxy> proxy_; | 354 std::unique_ptr<Proxy> proxy_; |
354 std::unique_ptr<TaskRunnerProvider> task_runner_provider_; | 355 std::unique_ptr<TaskRunnerProvider> task_runner_provider_; |
355 | 356 |
356 int source_frame_number_; | 357 int source_frame_number_; |
357 std::unique_ptr<RenderingStatsInstrumentation> | 358 std::unique_ptr<RenderingStatsInstrumentation> |
358 rendering_stats_instrumentation_; | 359 rendering_stats_instrumentation_; |
359 | 360 |
360 // |current_output_surface_| can't be updated until we've successfully | 361 // |current_compositor_frame_sink_| can't be updated until we've successfully |
361 // initialized a new output surface. |new_output_surface_| contains the | 362 // initialized a new output surface. |new_compositor_frame_sink_| contains the |
362 // new output surface that is currently being initialized. If initialization | 363 // new output surface that is currently being initialized. If initialization |
363 // is successful then |new_output_surface_| replaces | 364 // is successful then |new_compositor_frame_sink_| replaces |
364 // |current_output_surface_|. | 365 // |current_compositor_frame_sink_|. |
365 std::unique_ptr<OutputSurface> new_output_surface_; | 366 std::unique_ptr<CompositorFrameSink> new_compositor_frame_sink_; |
366 std::unique_ptr<OutputSurface> current_output_surface_; | 367 std::unique_ptr<CompositorFrameSink> current_compositor_frame_sink_; |
367 | 368 |
368 const LayerTreeSettings settings_; | 369 const LayerTreeSettings settings_; |
369 LayerTreeDebugState debug_state_; | 370 LayerTreeDebugState debug_state_; |
370 | 371 |
371 bool visible_; | 372 bool visible_; |
372 | 373 |
373 bool has_gpu_rasterization_trigger_; | 374 bool has_gpu_rasterization_trigger_; |
374 bool content_is_suitable_for_gpu_rasterization_; | 375 bool content_is_suitable_for_gpu_rasterization_; |
375 bool gpu_rasterization_histogram_recorded_; | 376 bool gpu_rasterization_histogram_recorded_; |
376 | 377 |
(...skipping 18 matching lines...) Expand all Loading... |
395 uint32_t surface_client_id_; | 396 uint32_t surface_client_id_; |
396 uint32_t next_surface_sequence_; | 397 uint32_t next_surface_sequence_; |
397 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; | 398 uint32_t num_consecutive_frames_suitable_for_gpu_ = 0; |
398 | 399 |
399 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 400 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
400 }; | 401 }; |
401 | 402 |
402 } // namespace cc | 403 } // namespace cc |
403 | 404 |
404 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 405 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |