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 virtual ~LayerTreeHostImpl(); | 124 virtual ~LayerTreeHostImpl(); |
127 | 125 |
128 // BeginFrameSourceMixIn implementation | |
129 virtual void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | |
130 | |
131 // InputHandler implementation | 126 // InputHandler implementation |
132 virtual void BindToClient(InputHandlerClient* client) override; | 127 virtual void BindToClient(InputHandlerClient* client) override; |
133 virtual InputHandler::ScrollStatus ScrollBegin( | 128 virtual 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 virtual InputHandler::ScrollStatus ScrollAnimated( | 131 virtual 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 virtual bool ScrollBy(const gfx::Point& viewport_point, | 134 virtual bool ScrollBy(const gfx::Point& viewport_point, |
140 const gfx::Vector2dF& scroll_delta) override; | 135 const gfx::Vector2dF& scroll_delta) override; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 virtual void PostDelayedScrollbarFade(const base::Closure& start_fade, | 243 virtual void PostDelayedScrollbarFade(const base::Closure& start_fade, |
249 base::TimeDelta delay) override; | 244 base::TimeDelta delay) override; |
250 virtual void SetNeedsScrollbarAnimationFrame() override; | 245 virtual void SetNeedsScrollbarAnimationFrame() override; |
251 | 246 |
252 // OutputSurfaceClient implementation. | 247 // OutputSurfaceClient implementation. |
253 virtual void DeferredInitialize() override; | 248 virtual void DeferredInitialize() override; |
254 virtual void ReleaseGL() override; | 249 virtual void ReleaseGL() override; |
255 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 250 virtual void CommitVSyncParameters(base::TimeTicks timebase, |
256 base::TimeDelta interval) override; | 251 base::TimeDelta interval) override; |
257 virtual void SetNeedsRedrawRect(const gfx::Rect& rect) override; | 252 virtual void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
258 virtual void BeginFrame(const BeginFrameArgs& args) override; | |
259 | 253 |
260 virtual void SetExternalDrawConstraints( | 254 virtual void SetExternalDrawConstraints( |
261 const gfx::Transform& transform, | 255 const gfx::Transform& transform, |
262 const gfx::Rect& viewport, | 256 const gfx::Rect& viewport, |
263 const gfx::Rect& clip, | 257 const gfx::Rect& clip, |
264 const gfx::Rect& viewport_rect_for_tile_priority, | 258 const gfx::Rect& viewport_rect_for_tile_priority, |
265 const gfx::Transform& transform_for_tile_priority, | 259 const gfx::Transform& transform_for_tile_priority, |
266 bool resourceless_software_draw) override; | 260 bool resourceless_software_draw) override; |
267 virtual void DidLoseOutputSurface() override; | 261 virtual void DidLoseOutputSurface() override; |
268 virtual void DidSwapBuffers() override; | 262 virtual void DidSwapBuffers() override; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 416 |
423 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); | 417 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); |
424 void ResetCurrentBeginFrameArgsForNextFrame(); | 418 void ResetCurrentBeginFrameArgsForNextFrame(); |
425 virtual BeginFrameArgs CurrentBeginFrameArgs() const; | 419 virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
426 | 420 |
427 // Expected time between two begin impl frame calls. | 421 // Expected time between two begin impl frame calls. |
428 base::TimeDelta begin_impl_frame_interval() const { | 422 base::TimeDelta begin_impl_frame_interval() const { |
429 return begin_impl_frame_interval_; | 423 return begin_impl_frame_interval_; |
430 } | 424 } |
431 | 425 |
432 virtual void AsValueInto(base::debug::TracedValue* value) const override; | 426 void AsValueInto(base::debug::TracedValue* value) const; |
433 void AsValueWithFrameInto(FrameData* frame, | 427 void AsValueWithFrameInto(FrameData* frame, |
434 base::debug::TracedValue* value) const; | 428 base::debug::TracedValue* value) const; |
435 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 429 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
436 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( | 430 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( |
437 FrameData* frame) const; | 431 FrameData* frame) const; |
438 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() | 432 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() |
439 const; | 433 const; |
440 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; | 434 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; |
441 | 435 |
442 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 436 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 708 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
715 | 709 |
716 bool requires_high_res_to_draw_; | 710 bool requires_high_res_to_draw_; |
717 | 711 |
718 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 712 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
719 }; | 713 }; |
720 | 714 |
721 } // namespace cc | 715 } // namespace cc |
722 | 716 |
723 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 717 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |