| 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; |
| 45 class EvictionTilePriorityQueue; | 44 class EvictionTilePriorityQueue; |
| 46 class FrameRateCounter; | 45 class FrameRateCounter; |
| 47 class LayerImpl; | 46 class LayerImpl; |
| 48 class LayerTreeHostImplTimeSourceAdapter; | |
| 49 class LayerTreeImpl; | 47 class LayerTreeImpl; |
| 50 class MemoryHistory; | 48 class MemoryHistory; |
| 51 class PageScaleAnimation; | 49 class PageScaleAnimation; |
| 52 class PaintTimeCounter; | 50 class PaintTimeCounter; |
| 53 class PictureLayerImpl; | 51 class PictureLayerImpl; |
| 54 class RasterTilePriorityQueue; | 52 class RasterTilePriorityQueue; |
| 55 class RasterWorkerPool; | 53 class RasterWorkerPool; |
| 56 class RenderPassDrawQuad; | 54 class RenderPassDrawQuad; |
| 57 class RenderingStatsInstrumentation; | 55 class RenderingStatsInstrumentation; |
| 58 class ResourcePool; | 56 class ResourcePool; |
| 57 class ScrollElasticityHelper; |
| 59 class ScrollbarLayerImplBase; | 58 class ScrollbarLayerImplBase; |
| 60 class TextureMailboxDeleter; | 59 class TextureMailboxDeleter; |
| 61 class TopControlsManager; | 60 class TopControlsManager; |
| 62 class UIResourceBitmap; | 61 class UIResourceBitmap; |
| 63 class UIResourceRequest; | 62 class UIResourceRequest; |
| 64 struct RendererCapabilitiesImpl; | 63 struct RendererCapabilitiesImpl; |
| 65 | 64 |
| 66 // LayerTreeHost->Proxy callback interface. | 65 // LayerTreeHost->Proxy callback interface. |
| 67 class LayerTreeHostImplClient { | 66 class LayerTreeHostImplClient { |
| 68 public: | 67 public: |
| 69 virtual void UpdateRendererCapabilitiesOnImplThread() = 0; | 68 virtual void UpdateRendererCapabilitiesOnImplThread() = 0; |
| 70 virtual void DidLoseOutputSurfaceOnImplThread() = 0; | 69 virtual void DidLoseOutputSurfaceOnImplThread() = 0; |
| 71 virtual void CommitVSyncParameters(base::TimeTicks timebase, | 70 virtual void CommitVSyncParameters(base::TimeTicks timebase, |
| 72 base::TimeDelta interval) = 0; | 71 base::TimeDelta interval) = 0; |
| 73 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; | 72 virtual void SetEstimatedParentDrawTime(base::TimeDelta draw_time) = 0; |
| 74 virtual void SetMaxSwapsPendingOnImplThread(int max) = 0; | 73 virtual void SetMaxSwapsPendingOnImplThread(int max) = 0; |
| 75 virtual void DidSwapBuffersOnImplThread() = 0; | 74 virtual void DidSwapBuffersOnImplThread() = 0; |
| 76 virtual void DidSwapBuffersCompleteOnImplThread() = 0; | 75 virtual void DidSwapBuffersCompleteOnImplThread() = 0; |
| 77 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 76 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
| 78 virtual void NotifyReadyToActivate() = 0; | 77 virtual void NotifyReadyToActivate() = 0; |
| 78 virtual void NotifyReadyToDraw() = 0; |
| 79 // Please call these 3 functions through | 79 // Please call these 3 functions through |
| 80 // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and | 80 // LayerTreeHostImpl's SetNeedsRedraw(), SetNeedsRedrawRect() and |
| 81 // SetNeedsAnimate(). | 81 // SetNeedsAnimate(). |
| 82 virtual void SetNeedsRedrawOnImplThread() = 0; | 82 virtual void SetNeedsRedrawOnImplThread() = 0; |
| 83 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; | 83 virtual void SetNeedsRedrawRectOnImplThread(const gfx::Rect& damage_rect) = 0; |
| 84 virtual void SetNeedsAnimateOnImplThread() = 0; | 84 virtual void SetNeedsAnimateOnImplThread() = 0; |
| 85 virtual void DidInitializeVisibleTileOnImplThread() = 0; | 85 virtual void DidInitializeVisibleTileOnImplThread() = 0; |
| 86 virtual void SetNeedsCommitOnImplThread() = 0; | 86 virtual void SetNeedsCommitOnImplThread() = 0; |
| 87 virtual void SetNeedsManageTilesOnImplThread() = 0; | 87 virtual void SetNeedsManageTilesOnImplThread() = 0; |
| 88 virtual void PostAnimationEventsToMainThreadOnImplThread( | 88 virtual void PostAnimationEventsToMainThreadOnImplThread( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 105 | 105 |
| 106 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 106 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
| 107 // state. | 107 // state. |
| 108 class CC_EXPORT LayerTreeHostImpl | 108 class CC_EXPORT LayerTreeHostImpl |
| 109 : public InputHandler, | 109 : public InputHandler, |
| 110 public RendererClient, | 110 public RendererClient, |
| 111 public TileManagerClient, | 111 public TileManagerClient, |
| 112 public OutputSurfaceClient, | 112 public OutputSurfaceClient, |
| 113 public TopControlsManagerClient, | 113 public TopControlsManagerClient, |
| 114 public ScrollbarAnimationControllerClient, | 114 public ScrollbarAnimationControllerClient, |
| 115 public BeginFrameSourceMixIn, | |
| 116 public base::SupportsWeakPtr<LayerTreeHostImpl> { | 115 public base::SupportsWeakPtr<LayerTreeHostImpl> { |
| 117 public: | 116 public: |
| 118 static scoped_ptr<LayerTreeHostImpl> Create( | 117 static scoped_ptr<LayerTreeHostImpl> Create( |
| 119 const LayerTreeSettings& settings, | 118 const LayerTreeSettings& settings, |
| 120 LayerTreeHostImplClient* client, | 119 LayerTreeHostImplClient* client, |
| 121 Proxy* proxy, | 120 Proxy* proxy, |
| 122 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 121 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 123 SharedBitmapManager* shared_bitmap_manager, | 122 SharedBitmapManager* shared_bitmap_manager, |
| 124 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 123 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 125 int id); | 124 int id); |
| 126 ~LayerTreeHostImpl() override; | 125 ~LayerTreeHostImpl() override; |
| 127 | 126 |
| 128 // BeginFrameSourceMixIn implementation | |
| 129 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | |
| 130 | |
| 131 // InputHandler implementation | 127 // InputHandler implementation |
| 132 void BindToClient(InputHandlerClient* client) override; | 128 void BindToClient(InputHandlerClient* client) override; |
| 133 InputHandler::ScrollStatus ScrollBegin( | 129 InputHandler::ScrollStatus ScrollBegin( |
| 134 const gfx::Point& viewport_point, | 130 const gfx::Point& viewport_point, |
| 135 InputHandler::ScrollInputType type) override; | 131 InputHandler::ScrollInputType type) override; |
| 136 InputHandler::ScrollStatus ScrollAnimated( | 132 InputHandler::ScrollStatus ScrollAnimated( |
| 137 const gfx::Point& viewport_point, | 133 const gfx::Point& viewport_point, |
| 138 const gfx::Vector2dF& scroll_delta) override; | 134 const gfx::Vector2dF& scroll_delta) override; |
| 139 bool ScrollBy(const gfx::Point& viewport_point, | 135 InputHandlerScrollResult ScrollBy( |
| 140 const gfx::Vector2dF& scroll_delta) override; | 136 const gfx::Point& viewport_point, |
| 137 const gfx::Vector2dF& scroll_delta) override; |
| 141 bool ScrollVerticallyByPage(const gfx::Point& viewport_point, | 138 bool ScrollVerticallyByPage(const gfx::Point& viewport_point, |
| 142 ScrollDirection direction) override; | 139 ScrollDirection direction) override; |
| 143 void SetRootLayerScrollOffsetDelegate( | 140 void SetRootLayerScrollOffsetDelegate( |
| 144 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) override; | 141 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) override; |
| 145 void OnRootLayerDelegatedScrollOffsetChanged() override; | 142 void OnRootLayerDelegatedScrollOffsetChanged() override; |
| 146 void ScrollEnd() override; | 143 void ScrollEnd() override; |
| 147 InputHandler::ScrollStatus FlingScrollBegin() override; | 144 InputHandler::ScrollStatus FlingScrollBegin() override; |
| 148 void MouseMoveAt(const gfx::Point& viewport_point) override; | 145 void MouseMoveAt(const gfx::Point& viewport_point) override; |
| 149 void PinchGestureBegin() override; | 146 void PinchGestureBegin() override; |
| 150 void PinchGestureUpdate(float magnify_delta, | 147 void PinchGestureUpdate(float magnify_delta, |
| 151 const gfx::Point& anchor) override; | 148 const gfx::Point& anchor) override; |
| 152 void PinchGestureEnd() override; | 149 void PinchGestureEnd() override; |
| 153 void SetNeedsAnimate() override; | 150 void SetNeedsAnimate() override; |
| 154 bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, | 151 bool IsCurrentlyScrollingLayerAt(const gfx::Point& viewport_point, |
| 155 InputHandler::ScrollInputType type) override; | 152 InputHandler::ScrollInputType type) override; |
| 156 bool HaveTouchEventHandlersAt(const gfx::Point& viewport_port) override; | 153 bool HaveTouchEventHandlersAt(const gfx::Point& viewport_port) override; |
| 157 scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( | 154 scoped_ptr<SwapPromiseMonitor> CreateLatencyInfoSwapPromiseMonitor( |
| 158 ui::LatencyInfo* latency) override; | 155 ui::LatencyInfo* latency) override; |
| 156 ScrollElasticityHelper* CreateScrollElasticityHelper() override; |
| 159 | 157 |
| 160 // TopControlsManagerClient implementation. | 158 // TopControlsManagerClient implementation. |
| 161 void SetControlsTopOffset(float offset) override; | 159 void SetControlsTopOffset(float offset) override; |
| 162 float ControlsTopOffset() const override; | 160 float ControlsTopOffset() const override; |
| 163 void DidChangeTopControlsPosition() override; | 161 void DidChangeTopControlsPosition() override; |
| 164 bool HaveRootScrollLayer() const override; | 162 bool HaveRootScrollLayer() const override; |
| 165 | 163 |
| 166 struct CC_EXPORT FrameData : public RenderPassSink { | 164 struct CC_EXPORT FrameData : public RenderPassSink { |
| 167 FrameData(); | 165 FrameData(); |
| 168 ~FrameData() override; | 166 ~FrameData() override; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 181 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; | 179 void AppendRenderPass(scoped_ptr<RenderPass> render_pass) override; |
| 182 }; | 180 }; |
| 183 | 181 |
| 184 virtual void BeginMainFrameAborted(bool did_handle); | 182 virtual void BeginMainFrameAborted(bool did_handle); |
| 185 virtual void BeginCommit(); | 183 virtual void BeginCommit(); |
| 186 virtual void CommitComplete(); | 184 virtual void CommitComplete(); |
| 187 virtual void Animate(base::TimeTicks monotonic_time); | 185 virtual void Animate(base::TimeTicks monotonic_time); |
| 188 virtual void UpdateAnimationState(bool start_ready_animations); | 186 virtual void UpdateAnimationState(bool start_ready_animations); |
| 189 void ActivateAnimations(); | 187 void ActivateAnimations(); |
| 190 void MainThreadHasStoppedFlinging(); | 188 void MainThreadHasStoppedFlinging(); |
| 191 void UpdateBackgroundAnimateTicking(bool should_background_tick); | |
| 192 void DidAnimateScrollOffset(); | 189 void DidAnimateScrollOffset(); |
| 193 void SetViewportDamage(const gfx::Rect& damage_rect); | 190 void SetViewportDamage(const gfx::Rect& damage_rect); |
| 194 | 191 |
| 195 virtual void ManageTiles(); | 192 virtual void ManageTiles(); |
| 196 | 193 |
| 197 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 194 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
| 198 // should try to avoid displaying the frame. If PrepareToDraw is called, | 195 // should try to avoid displaying the frame. If PrepareToDraw is called, |
| 199 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 196 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
| 200 // called between the two. | 197 // called between the two. |
| 201 virtual DrawResult PrepareToDraw(FrameData* frame); | 198 virtual DrawResult PrepareToDraw(FrameData* frame); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 227 | 224 |
| 228 // Viewport rect in view space used for tiling prioritization. | 225 // Viewport rect in view space used for tiling prioritization. |
| 229 const gfx::Rect ViewportRectForTilePriority() const; | 226 const gfx::Rect ViewportRectForTilePriority() const; |
| 230 | 227 |
| 231 // RendererClient implementation. | 228 // RendererClient implementation. |
| 232 void SetFullRootLayerDamage() override; | 229 void SetFullRootLayerDamage() override; |
| 233 | 230 |
| 234 // TileManagerClient implementation. | 231 // TileManagerClient implementation. |
| 235 const std::vector<PictureLayerImpl*>& GetPictureLayers() const override; | 232 const std::vector<PictureLayerImpl*>& GetPictureLayers() const override; |
| 236 void NotifyReadyToActivate() override; | 233 void NotifyReadyToActivate() override; |
| 234 void NotifyReadyToDraw() override; |
| 237 void NotifyTileStateChanged(const Tile* tile) override; | 235 void NotifyTileStateChanged(const Tile* tile) override; |
| 238 void BuildRasterQueue(RasterTilePriorityQueue* queue, | 236 void BuildRasterQueue(RasterTilePriorityQueue* queue, |
| 239 TreePriority tree_priority) override; | 237 TreePriority tree_priority) override; |
| 240 void BuildEvictionQueue(EvictionTilePriorityQueue* queue, | 238 void BuildEvictionQueue(EvictionTilePriorityQueue* queue, |
| 241 TreePriority tree_priority) override; | 239 TreePriority tree_priority) override; |
| 242 | 240 |
| 243 // ScrollbarAnimationControllerClient implementation. | 241 // ScrollbarAnimationControllerClient implementation. |
| 244 void PostDelayedScrollbarFade(const base::Closure& start_fade, | 242 void PostDelayedScrollbarFade(const base::Closure& start_fade, |
| 245 base::TimeDelta delay) override; | 243 base::TimeDelta delay) override; |
| 246 void SetNeedsScrollbarAnimationFrame() override; | 244 void SetNeedsScrollbarAnimationFrame() override; |
| 247 | 245 |
| 248 // OutputSurfaceClient implementation. | 246 // OutputSurfaceClient implementation. |
| 249 void DeferredInitialize() override; | 247 void DeferredInitialize() override; |
| 250 void ReleaseGL() override; | 248 void ReleaseGL() override; |
| 251 void CommitVSyncParameters(base::TimeTicks timebase, | 249 void CommitVSyncParameters(base::TimeTicks timebase, |
| 252 base::TimeDelta interval) override; | 250 base::TimeDelta interval) override; |
| 253 void SetNeedsRedrawRect(const gfx::Rect& rect) override; | 251 void SetNeedsRedrawRect(const gfx::Rect& rect) override; |
| 254 void BeginFrame(const BeginFrameArgs& args) override; | |
| 255 | |
| 256 void SetExternalDrawConstraints( | 252 void SetExternalDrawConstraints( |
| 257 const gfx::Transform& transform, | 253 const gfx::Transform& transform, |
| 258 const gfx::Rect& viewport, | 254 const gfx::Rect& viewport, |
| 259 const gfx::Rect& clip, | 255 const gfx::Rect& clip, |
| 260 const gfx::Rect& viewport_rect_for_tile_priority, | 256 const gfx::Rect& viewport_rect_for_tile_priority, |
| 261 const gfx::Transform& transform_for_tile_priority, | 257 const gfx::Transform& transform_for_tile_priority, |
| 262 bool resourceless_software_draw) override; | 258 bool resourceless_software_draw) override; |
| 263 void DidLoseOutputSurface() override; | 259 void DidLoseOutputSurface() override; |
| 264 void DidSwapBuffers() override; | 260 void DidSwapBuffers() override; |
| 265 void DidSwapBuffersComplete() override; | 261 void DidSwapBuffersComplete() override; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 return scroll_affects_scroll_handler_; | 318 return scroll_affects_scroll_handler_; |
| 323 } | 319 } |
| 324 void QueueSwapPromiseForMainThreadScrollUpdate( | 320 void QueueSwapPromiseForMainThreadScrollUpdate( |
| 325 scoped_ptr<SwapPromise> swap_promise); | 321 scoped_ptr<SwapPromise> swap_promise); |
| 326 | 322 |
| 327 bool IsActivelyScrolling() const; | 323 bool IsActivelyScrolling() const; |
| 328 | 324 |
| 329 virtual void SetVisible(bool visible); | 325 virtual void SetVisible(bool visible); |
| 330 bool visible() const { return visible_; } | 326 bool visible() const { return visible_; } |
| 331 | 327 |
| 328 bool AnimationsAreVisible() { return visible() && CanDraw(); } |
| 329 |
| 332 void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); } | 330 void SetNeedsCommit() { client_->SetNeedsCommitOnImplThread(); } |
| 333 void SetNeedsRedraw(); | 331 void SetNeedsRedraw(); |
| 334 | 332 |
| 335 ManagedMemoryPolicy ActualManagedMemoryPolicy() const; | 333 ManagedMemoryPolicy ActualManagedMemoryPolicy() const; |
| 336 | 334 |
| 337 size_t memory_allocation_limit_bytes() const; | 335 size_t memory_allocation_limit_bytes() const; |
| 338 int memory_allocation_priority_cutoff() const; | 336 int memory_allocation_priority_cutoff() const; |
| 339 | 337 |
| 340 void SetViewportSize(const gfx::Size& device_viewport_size); | 338 void SetViewportSize(const gfx::Size& device_viewport_size); |
| 341 gfx::Size device_viewport_size() const { return device_viewport_size_; } | 339 gfx::Size device_viewport_size() const { return device_viewport_size_; } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 | 415 |
| 418 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); | 416 void UpdateCurrentBeginFrameArgs(const BeginFrameArgs& args); |
| 419 void ResetCurrentBeginFrameArgsForNextFrame(); | 417 void ResetCurrentBeginFrameArgsForNextFrame(); |
| 420 virtual BeginFrameArgs CurrentBeginFrameArgs() const; | 418 virtual BeginFrameArgs CurrentBeginFrameArgs() const; |
| 421 | 419 |
| 422 // Expected time between two begin impl frame calls. | 420 // Expected time between two begin impl frame calls. |
| 423 base::TimeDelta begin_impl_frame_interval() const { | 421 base::TimeDelta begin_impl_frame_interval() const { |
| 424 return begin_impl_frame_interval_; | 422 return begin_impl_frame_interval_; |
| 425 } | 423 } |
| 426 | 424 |
| 427 void AsValueInto(base::debug::TracedValue* value) const override; | 425 void AsValueInto(base::debug::TracedValue* value) const; |
| 428 void AsValueWithFrameInto(FrameData* frame, | 426 void AsValueWithFrameInto(FrameData* frame, |
| 429 base::debug::TracedValue* value) const; | 427 base::debug::TracedValue* value) const; |
| 430 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 428 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 431 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( | 429 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueWithFrame( |
| 432 FrameData* frame) const; | 430 FrameData* frame) const; |
| 433 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() | 431 scoped_refptr<base::debug::ConvertableToTraceFormat> ActivationStateAsValue() |
| 434 const; | 432 const; |
| 435 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; | 433 void ActivationStateAsValueInto(base::debug::TracedValue* value) const; |
| 436 | 434 |
| 437 bool page_scale_animation_active() const { return !!page_scale_animation_; } | 435 bool page_scale_animation_active() const { return !!page_scale_animation_; } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 466 // When a SwapPromiseMonitor is created on the impl thread, it calls | 464 // When a SwapPromiseMonitor is created on the impl thread, it calls |
| 467 // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl. | 465 // InsertSwapPromiseMonitor() to register itself with LayerTreeHostImpl. |
| 468 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | 466 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
| 469 // to unregister itself. | 467 // to unregister itself. |
| 470 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 468 void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
| 471 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); | 469 void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor); |
| 472 | 470 |
| 473 void RegisterPictureLayerImpl(PictureLayerImpl* layer); | 471 void RegisterPictureLayerImpl(PictureLayerImpl* layer); |
| 474 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); | 472 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); |
| 475 | 473 |
| 476 void GetPictureLayerImplPairs( | 474 void GetPictureLayerImplPairs(std::vector<PictureLayerImpl::Pair>* layers, |
| 477 std::vector<PictureLayerImpl::Pair>* layers) const; | 475 bool need_valid_tile_priorities) const; |
| 478 | 476 |
| 479 void SetTopControlsLayoutHeight(float height); | 477 void SetTopControlsLayoutHeight(float height); |
| 480 | 478 |
| 481 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } | 479 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } |
| 482 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } | 480 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } |
| 483 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } | 481 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } |
| 484 | 482 |
| 485 // Only valid for synchronous (non-scheduled) single-threaded case. | 483 // Only valid for synchronous (non-scheduled) single-threaded case. |
| 486 void SynchronouslyInitializeAllTiles(); | 484 void SynchronouslyInitializeAllTiles(); |
| 487 | 485 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 499 Proxy* proxy, | 497 Proxy* proxy, |
| 500 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 498 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
| 501 SharedBitmapManager* shared_bitmap_manager, | 499 SharedBitmapManager* shared_bitmap_manager, |
| 502 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 500 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 503 int id); | 501 int id); |
| 504 | 502 |
| 505 void UpdateViewportContainerSizes(); | 503 void UpdateViewportContainerSizes(); |
| 506 | 504 |
| 507 // Virtual for testing. | 505 // Virtual for testing. |
| 508 virtual void AnimateLayers(base::TimeTicks monotonic_time); | 506 virtual void AnimateLayers(base::TimeTicks monotonic_time); |
| 509 virtual base::TimeDelta LowFrequencyAnimationInterval() const; | |
| 510 | |
| 511 const AnimationRegistrar::AnimationControllerMap& | 507 const AnimationRegistrar::AnimationControllerMap& |
| 512 active_animation_controllers() const { | 508 active_animation_controllers() const { |
| 513 return animation_registrar_->active_animation_controllers(); | 509 return animation_registrar_->active_animation_controllers(); |
| 514 } | 510 } |
| 515 | 511 |
| 516 bool manage_tiles_needed() const { return tile_priorities_dirty_; } | 512 bool manage_tiles_needed() const { return tile_priorities_dirty_; } |
| 517 | 513 |
| 518 LayerTreeHostImplClient* client_; | 514 LayerTreeHostImplClient* client_; |
| 519 Proxy* proxy_; | 515 Proxy* proxy_; |
| 520 | 516 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 scoped_ptr<LayerTreeImpl> recycle_tree_; | 616 scoped_ptr<LayerTreeImpl> recycle_tree_; |
| 621 | 617 |
| 622 InputHandlerClient* input_handler_client_; | 618 InputHandlerClient* input_handler_client_; |
| 623 bool did_lock_scrolling_layer_; | 619 bool did_lock_scrolling_layer_; |
| 624 bool should_bubble_scrolls_; | 620 bool should_bubble_scrolls_; |
| 625 bool wheel_scrolling_; | 621 bool wheel_scrolling_; |
| 626 bool scroll_affects_scroll_handler_; | 622 bool scroll_affects_scroll_handler_; |
| 627 int scroll_layer_id_when_mouse_over_scrollbar_; | 623 int scroll_layer_id_when_mouse_over_scrollbar_; |
| 628 ScopedPtrVector<SwapPromise> swap_promises_for_main_thread_scroll_update_; | 624 ScopedPtrVector<SwapPromise> swap_promises_for_main_thread_scroll_update_; |
| 629 | 625 |
| 626 // An object to implement the ScrollElasticityHelper interface and |
| 627 // hold all state related to elasticity. May be NULL if never requested. |
| 628 scoped_ptr<ScrollElasticityHelper> scroll_elasticity_helper_; |
| 629 |
| 630 bool tile_priorities_dirty_; | 630 bool tile_priorities_dirty_; |
| 631 | 631 |
| 632 // The optional delegate for the root layer scroll offset. | 632 // The optional delegate for the root layer scroll offset. |
| 633 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 633 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
| 634 LayerTreeSettings settings_; | 634 LayerTreeSettings settings_; |
| 635 LayerTreeDebugState debug_state_; | 635 LayerTreeDebugState debug_state_; |
| 636 bool visible_; | 636 bool visible_; |
| 637 ManagedMemoryPolicy cached_managed_memory_policy_; | 637 ManagedMemoryPolicy cached_managed_memory_policy_; |
| 638 | 638 |
| 639 gfx::Vector2dF accumulated_root_overscroll_; | 639 gfx::Vector2dF accumulated_root_overscroll_; |
| 640 | 640 |
| 641 bool pinch_gesture_active_; | 641 bool pinch_gesture_active_; |
| 642 bool pinch_gesture_end_should_clear_scrolling_layer_; | 642 bool pinch_gesture_end_should_clear_scrolling_layer_; |
| 643 gfx::Point previous_pinch_anchor_; | 643 gfx::Point previous_pinch_anchor_; |
| 644 | 644 |
| 645 scoped_ptr<TopControlsManager> top_controls_manager_; | 645 scoped_ptr<TopControlsManager> top_controls_manager_; |
| 646 | 646 |
| 647 scoped_ptr<PageScaleAnimation> page_scale_animation_; | 647 scoped_ptr<PageScaleAnimation> page_scale_animation_; |
| 648 | 648 |
| 649 // This is used for ticking animations slowly when hidden. | |
| 650 scoped_ptr<LayerTreeHostImplTimeSourceAdapter> time_source_client_adapter_; | |
| 651 | |
| 652 scoped_ptr<FrameRateCounter> fps_counter_; | 649 scoped_ptr<FrameRateCounter> fps_counter_; |
| 653 scoped_ptr<PaintTimeCounter> paint_time_counter_; | 650 scoped_ptr<PaintTimeCounter> paint_time_counter_; |
| 654 scoped_ptr<MemoryHistory> memory_history_; | 651 scoped_ptr<MemoryHistory> memory_history_; |
| 655 scoped_ptr<DebugRectHistory> debug_rect_history_; | 652 scoped_ptr<DebugRectHistory> debug_rect_history_; |
| 656 | 653 |
| 657 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 654 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
| 658 | 655 |
| 659 // The maximum memory that would be used by the prioritized resource | 656 // The maximum memory that would be used by the prioritized resource |
| 660 // manager, if there were no limit on memory usage. | 657 // manager, if there were no limit on memory usage. |
| 661 size_t max_memory_needed_bytes_; | 658 size_t max_memory_needed_bytes_; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; | 714 std::vector<PictureLayerImpl::Pair> picture_layer_pairs_; |
| 718 | 715 |
| 719 bool requires_high_res_to_draw_; | 716 bool requires_high_res_to_draw_; |
| 720 | 717 |
| 721 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 718 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 722 }; | 719 }; |
| 723 | 720 |
| 724 } // namespace cc | 721 } // namespace cc |
| 725 | 722 |
| 726 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 723 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |