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_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "cc/input/top_controls_manager_client.h" | 24 #include "cc/input/top_controls_manager_client.h" |
25 #include "cc/layers/layer_lists.h" | 25 #include "cc/layers/layer_lists.h" |
26 #include "cc/layers/render_pass_sink.h" | 26 #include "cc/layers/render_pass_sink.h" |
27 #include "cc/output/begin_frame_args.h" | 27 #include "cc/output/begin_frame_args.h" |
28 #include "cc/output/managed_memory_policy.h" | 28 #include "cc/output/managed_memory_policy.h" |
29 #include "cc/output/output_surface_client.h" | 29 #include "cc/output/output_surface_client.h" |
30 #include "cc/output/renderer.h" | 30 #include "cc/output/renderer.h" |
31 #include "cc/quads/render_pass.h" | 31 #include "cc/quads/render_pass.h" |
32 #include "cc/resources/resource_provider.h" | 32 #include "cc/resources/resource_provider.h" |
33 #include "cc/resources/tile_manager.h" | 33 #include "cc/resources/tile_manager.h" |
34 #include "cc/scheduler/begin_frame_source.h" | |
35 #include "cc/scheduler/draw_result.h" | 34 #include "cc/scheduler/draw_result.h" |
36 #include "skia/ext/refptr.h" | 35 #include "skia/ext/refptr.h" |
37 #include "third_party/skia/include/core/SkColor.h" | 36 #include "third_party/skia/include/core/SkColor.h" |
38 #include "ui/gfx/rect.h" | 37 #include "ui/gfx/rect.h" |
39 | 38 |
40 namespace cc { | 39 namespace cc { |
41 | 40 |
42 class CompletionEvent; | 41 class CompletionEvent; |
43 class CompositorFrameMetadata; | 42 class CompositorFrameMetadata; |
44 class DebugRectHistory; | 43 class DebugRectHistory; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 104 |
106 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 105 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
107 // state. | 106 // state. |
108 class CC_EXPORT LayerTreeHostImpl | 107 class CC_EXPORT LayerTreeHostImpl |
109 : public InputHandler, | 108 : public InputHandler, |
110 public RendererClient, | 109 public RendererClient, |
111 public TileManagerClient, | 110 public TileManagerClient, |
112 public OutputSurfaceClient, | 111 public OutputSurfaceClient, |
113 public TopControlsManagerClient, | 112 public TopControlsManagerClient, |
114 public ScrollbarAnimationControllerClient, | 113 public ScrollbarAnimationControllerClient, |
115 public BeginFrameSourceMixIn, | |
116 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 114 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
117 public: | 115 public: |
118 static scoped_ptr<LayerTreeHostImpl> Create( | 116 static scoped_ptr<LayerTreeHostImpl> Create( |
119 const LayerTreeSettings& settings, | 117 const LayerTreeSettings& settings, |
120 LayerTreeHostImplClient* client, | 118 LayerTreeHostImplClient* client, |
121 Proxy* proxy, | 119 Proxy* proxy, |
122 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 120 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
123 SharedBitmapManager* shared_bitmap_manager, | 121 SharedBitmapManager* shared_bitmap_manager, |
124 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 122 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
125 int id); | 123 int id); |
126 ~LayerTreeHostImpl() override; | 124 ~LayerTreeHostImpl() override; |
127 | 125 |
128 // BeginFrameSourceMixIn implementation | |
129 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | |
130 | |
131 // InputHandler implementation | 126 // InputHandler implementation |
132 void BindToClient(InputHandlerClient* client) override; | 127 void BindToClient(InputHandlerClient* client) override; |
133 InputHandler::ScrollStatus ScrollBegin( | 128 InputHandler::ScrollStatus ScrollBegin( |
134 const gfx::Point& viewport_point, | 129 const gfx::Point& viewport_point, |
135 InputHandler::ScrollInputType type) override; | 130 InputHandler::ScrollInputType type) override; |
136 InputHandler::ScrollStatus ScrollAnimated( | 131 InputHandler::ScrollStatus ScrollAnimated( |
137 const gfx::Point& viewport_point, | 132 const gfx::Point& viewport_point, |
138 const gfx::Vector2dF& scroll_delta) override; | 133 const gfx::Vector2dF& scroll_delta) override; |
139 bool ScrollBy(const gfx::Point& viewport_point, | 134 bool ScrollBy(const gfx::Point& viewport_point, |
140 const gfx::Vector2dF& scroll_delta) override; | 135 const gfx::Vector2dF& scroll_delta) override; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 void PostDelayedScrollbarFade(const base::Closure& start_fade, | 240 void PostDelayedScrollbarFade(const base::Closure& start_fade, |
246 base::TimeDelta delay) override; | 241 base::TimeDelta delay) override; |
247 void SetNeedsScrollbarAnimationFrame() override; | 242 void SetNeedsScrollbarAnimationFrame() override; |
248 | 243 |
249 // OutputSurfaceClient implementation. | 244 // OutputSurfaceClient implementation. |
250 void DeferredInitialize() override; | 245 void DeferredInitialize() override; |
251 void ReleaseGL() override; | 246 void ReleaseGL() override; |
252 void CommitVSyncParameters(base::TimeTicks timebase, | 247 void CommitVSyncParameters(base::TimeTicks timebase, |
253 base::TimeDelta interval) override; | 248 base::TimeDelta interval) override; |
254 void SetNeedsRedrawRect(const gfx::Rect& rect) override; | 249 void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
255 void BeginFrame(const BeginFrameArgs& args) override; | |
256 | |
257 void SetExternalDrawConstraints( | 250 void SetExternalDrawConstraints( |
258 const gfx::Transform& transform, | 251 const gfx::Transform& transform, |
259 const gfx::Rect& viewport, | 252 const gfx::Rect& viewport, |
260 const gfx::Rect& clip, | 253 const gfx::Rect& clip, |
261 const gfx::Rect& viewport_rect_for_tile_priority, | 254 const gfx::Rect& viewport_rect_for_tile_priority, |
262 const gfx::Transform& transform_for_tile_priority, | 255 const gfx::Transform& transform_for_tile_priority, |
263 bool resourceless_software_draw) override; | 256 bool resourceless_software_draw) override; |
264 void DidLoseOutputSurface() override; | 257 void DidLoseOutputSurface() override; |
265 void DidSwapBuffers() override; | 258 void DidSwapBuffers() override; |
266 void DidSwapBuffersComplete() override; | 259 void DidSwapBuffersComplete() override; |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 411 |
419 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); | 412 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); |
420 void ResetCurrentBeginFrameArgsForNextFrame(); | 413 void ResetCurrentBeginFrameArgsForNextFrame(); |
421 virtual BeginFrameArgs CurrentBeginFrameArgs() const; | 414 virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
422 | 415 |
423 // Expected time between two begin impl frame calls. | 416 // Expected time between two begin impl frame calls. |
424 base::TimeDelta begin_impl_frame_interval() const { | 417 base::TimeDelta begin_impl_frame_interval() const { |
425 return begin_impl_frame_interval_; | 418 return begin_impl_frame_interval_; |
426 } | 419 } |
427 | 420 |
428 void AsValueInto(base::debug::TracedValue* value) const override; | 421 void AsValueInto(base::debug::TracedValue* value) const; |
429 void AsValueWithFrameInto(FrameData* frame, | 422 void AsValueWithFrameInto(FrameData* frame, |
430 base::debug::TracedValue* value) const; | 423 base::debug::TracedValue* value) const; |
431 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 424 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
432 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( | 425 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( |
433 FrameData* frame) const; | 426 FrameData* frame) const; |
434 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() | 427 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() |
435 const; | 428 const; |
436 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; | 429 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; |
437 | 430 |
438 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 431 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 703 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
711 | 704 |
712 bool requires_high_res_to_draw_; | 705 bool requires_high_res_to_draw_; |
713 | 706 |
714 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 707 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
715 }; | 708 }; |
716 | 709 |
717 } // namespace cc | 710 } // namespace cc |
718 | 711 |
719 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 712 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |