| 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/geometry/rect.h" | 37 #include "ui/gfx/geometry/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 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 122 gpu::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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 void PostDelayedScrollbarFade(const base::Closure& start_fade, | 239 void PostDelayedScrollbarFade(const base::Closure& start_fade, |
| 245 base::TimeDelta delay) override; | 240 base::TimeDelta delay) override; |
| 246 void SetNeedsScrollbarAnimationFrame() override; | 241 void SetNeedsScrollbarAnimationFrame() override; |
| 247 | 242 |
| 248 // OutputSurfaceClient implementation. | 243 // OutputSurfaceClient implementation. |
| 249 void DeferredInitialize() override; | 244 void DeferredInitialize() override; |
| 250 void ReleaseGL() override; | 245 void ReleaseGL() override; |
| 251 void CommitVSyncParameters(base::TimeTicks timebase, | 246 void CommitVSyncParameters(base::TimeTicks timebase, |
| 252 base::TimeDelta interval) override; | 247 base::TimeDelta interval) override; |
| 253 void SetNeedsRedrawRect(const gfx::Rect& rect) override; | 248 void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
| 254 void BeginFrame(const BeginFrameArgs& args) override; | |
| 255 | |
| 256 void SetExternalDrawConstraints( | 249 void SetExternalDrawConstraints( |
| 257 const gfx::Transform& transform, | 250 const gfx::Transform& transform, |
| 258 const gfx::Rect& viewport, | 251 const gfx::Rect& viewport, |
| 259 const gfx::Rect& clip, | 252 const gfx::Rect& clip, |
| 260 const gfx::Rect& viewport_rect_for_tile_priority, | 253 const gfx::Rect& viewport_rect_for_tile_priority, |
| 261 const gfx::Transform& transform_for_tile_priority, | 254 const gfx::Transform& transform_for_tile_priority, |
| 262 bool resourceless_software_draw) override; | 255 bool resourceless_software_draw) override; |
| 263 void DidLoseOutputSurface() override; | 256 void DidLoseOutputSurface() override; |
| 264 void DidSwapBuffers() override; | 257 void DidSwapBuffers() override; |
| 265 void DidSwapBuffersComplete() override; | 258 void DidSwapBuffersComplete() override; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 410 |
| 418 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); | 411 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); |
| 419 void ResetCurrentBeginFrameArgsForNextFrame(); | 412 void ResetCurrentBeginFrameArgsForNextFrame(); |
| 420 virtual BeginFrameArgs CurrentBeginFrameArgs() const; | 413 virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
| 421 | 414 |
| 422 // Expected time between two begin impl frame calls. | 415 // Expected time between two begin impl frame calls. |
| 423 base::TimeDelta begin_impl_frame_interval() const { | 416 base::TimeDelta begin_impl_frame_interval() const { |
| 424 return begin_impl_frame_interval_; | 417 return begin_impl_frame_interval_; |
| 425 } | 418 } |
| 426 | 419 |
| 427 void AsValueInto(base::debug::TracedValue* value) const override; | 420 void AsValueInto(base::debug::TracedValue* value) const; |
| 428 void AsValueWithFrameInto(FrameData* frame, | 421 void AsValueWithFrameInto(FrameData* frame, |
| 429 base::debug::TracedValue* value) const; | 422 base::debug::TracedValue* value) const; |
| 430 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 423 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 431 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( | 424 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( |
| 432 FrameData* frame) const; | 425 FrameData* frame) const; |
| 433 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() | 426 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() |
| 434 const; | 427 const; |
| 435 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; | 428 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; |
| 436 | 429 |
| 437 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 430 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 702 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
| 710 | 703 |
| 711 bool requires_high_res_to_draw_; | 704 bool requires_high_res_to_draw_; |
| 712 | 705 |
| 713 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 706 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 714 }; | 707 }; |
| 715 | 708 |
| 716 } // namespace cc | 709 } // namespace cc |
| 717 | 710 |
| 718 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 711 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |