| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 virtual void OnSwapBuffersCompleteOnImplThread() = 0; | 57 virtual void OnSwapBuffersCompleteOnImplThread() = 0; |
| 58 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 58 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
| 59 base::TimeDelta interval) = 0; | 59 base::TimeDelta interval) = 0; |
| 60 virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) = 0; | 60 virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) = 0; |
| 61 virtual void OnCanDrawStateChanged(bool can_draw) = 0; | 61 virtual void OnCanDrawStateChanged(bool can_draw) = 0; |
| 62 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; | 62 virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; |
| 63 virtual void SetNeedsRedrawOnImplThread() = 0; | 63 virtual void SetNeedsRedrawOnImplThread() = 0; |
| 64 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; | 64 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; |
| 65 virtual void DidInitializeVisibleTileOnImplThread() = 0; | 65 virtual void DidInitializeVisibleTileOnImplThread() = 0; |
| 66 virtual void SetNeedsCommitOnImplThread() = 0; | 66 virtual void SetNeedsCommitOnImplThread() = 0; |
| 67 virtual void SetNeedsManageTilesOnImplThread() = 0; | |
| 68 virtual void PostAnimationEventsToMainThreadOnImplThread( | 67 virtual void PostAnimationEventsToMainThreadOnImplThread( |
| 69 scoped_ptr<AnimationEventsVector> events, | 68 scoped_ptr<AnimationEventsVector> events, |
| 70 base::Time wall_clock_time) = 0; | 69 base::Time wall_clock_time) = 0; |
| 71 // Returns true if resources were deleted by this call. | 70 // Returns true if resources were deleted by this call. |
| 72 virtual bool ReduceContentsTextureMemoryOnImplThread( | 71 virtual bool ReduceContentsTextureMemoryOnImplThread( |
| 73 size_t limit_bytes, | 72 size_t limit_bytes, |
| 74 int priority_cutoff) = 0; | 73 int priority_cutoff) = 0; |
| 75 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; | 74 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; |
| 76 virtual void SendManagedMemoryStats() = 0; | 75 virtual void SendManagedMemoryStats() = 0; |
| 77 virtual bool IsInsideDraw() = 0; | 76 virtual bool IsInsideDraw() = 0; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) | 189 virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) |
| 191 OVERRIDE; | 190 OVERRIDE; |
| 192 virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) | 191 virtual void EnforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) |
| 193 OVERRIDE; | 192 OVERRIDE; |
| 194 virtual bool HasImplThread() const OVERRIDE; | 193 virtual bool HasImplThread() const OVERRIDE; |
| 195 virtual bool ShouldClearRootRenderPass() const OVERRIDE; | 194 virtual bool ShouldClearRootRenderPass() const OVERRIDE; |
| 196 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; | 195 virtual CompositorFrameMetadata MakeCompositorFrameMetadata() const OVERRIDE; |
| 197 virtual bool AllowPartialSwap() const OVERRIDE; | 196 virtual bool AllowPartialSwap() const OVERRIDE; |
| 198 | 197 |
| 199 // TileManagerClient implementation. | 198 // TileManagerClient implementation. |
| 200 virtual void ScheduleManageTiles() OVERRIDE; | |
| 201 virtual void DidInitializeVisibleTile() OVERRIDE; | 199 virtual void DidInitializeVisibleTile() OVERRIDE; |
| 202 virtual bool ShouldForceTileUploadsRequiredForActivationToComplete() const | 200 virtual bool ShouldForceTileUploadsRequiredForActivationToComplete() const |
| 203 OVERRIDE; | 201 OVERRIDE; |
| 204 | 202 |
| 205 // OutputSurfaceClient implementation. | 203 // OutputSurfaceClient implementation. |
| 206 virtual bool DeferredInitialize( | 204 virtual bool DeferredInitialize( |
| 207 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; | 205 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; |
| 208 virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; | 206 virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; |
| 209 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 207 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
| 210 base::TimeDelta interval) OVERRIDE; | 208 base::TimeDelta interval) OVERRIDE; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 229 int SourceAnimationFrameNumber() const; | 227 int SourceAnimationFrameNumber() const; |
| 230 | 228 |
| 231 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); | 229 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); |
| 232 bool IsContextLost(); | 230 bool IsContextLost(); |
| 233 TileManager* tile_manager() { return tile_manager_.get(); } | 231 TileManager* tile_manager() { return tile_manager_.get(); } |
| 234 Renderer* renderer() { return renderer_.get(); } | 232 Renderer* renderer() { return renderer_.get(); } |
| 235 const RendererCapabilities& GetRendererCapabilities() const; | 233 const RendererCapabilities& GetRendererCapabilities() const; |
| 236 | 234 |
| 237 virtual bool SwapBuffers(const FrameData& frame); | 235 virtual bool SwapBuffers(const FrameData& frame); |
| 238 void SetNeedsBeginFrame(bool enable); | 236 void SetNeedsBeginFrame(bool enable); |
| 237 void SetNeedsManageTiles() { manage_tiles_needed_ = true; } |
| 239 | 238 |
| 240 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); | 239 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); |
| 241 | 240 |
| 242 LayerTreeImpl* active_tree() { return active_tree_.get(); } | 241 LayerTreeImpl* active_tree() { return active_tree_.get(); } |
| 243 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } | 242 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
| 244 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } | 243 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
| 245 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } | 244 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
| 246 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } | 245 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
| 247 void CreatePendingTree(); | 246 void CreatePendingTree(); |
| 248 void CheckForCompletedTileUploads(); | 247 void CheckForCompletedTileUploads(); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 scoped_ptr<LayerTreeImpl> pending_tree_; | 458 scoped_ptr<LayerTreeImpl> pending_tree_; |
| 460 | 459 |
| 461 // In impl-side painting mode, inert tree with layers that can be recycled | 460 // In impl-side painting mode, inert tree with layers that can be recycled |
| 462 // by the next sync from the main thread. | 461 // by the next sync from the main thread. |
| 463 scoped_ptr<LayerTreeImpl> recycle_tree_; | 462 scoped_ptr<LayerTreeImpl> recycle_tree_; |
| 464 | 463 |
| 465 InputHandlerClient* input_handler_client_; | 464 InputHandlerClient* input_handler_client_; |
| 466 bool did_lock_scrolling_layer_; | 465 bool did_lock_scrolling_layer_; |
| 467 bool should_bubble_scrolls_; | 466 bool should_bubble_scrolls_; |
| 468 bool wheel_scrolling_; | 467 bool wheel_scrolling_; |
| 468 |
| 469 bool manage_tiles_needed_; |
| 470 |
| 469 // The optional delegate for the root layer scroll offset. | 471 // The optional delegate for the root layer scroll offset. |
| 470 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; | 472 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; |
| 471 LayerTreeSettings settings_; | 473 LayerTreeSettings settings_; |
| 472 LayerTreeDebugState debug_state_; | 474 LayerTreeDebugState debug_state_; |
| 473 bool visible_; | 475 bool visible_; |
| 474 ManagedMemoryPolicy managed_memory_policy_; | 476 ManagedMemoryPolicy managed_memory_policy_; |
| 475 | 477 |
| 476 gfx::Vector2dF accumulated_root_overscroll_; | 478 gfx::Vector2dF accumulated_root_overscroll_; |
| 477 gfx::Vector2dF current_fling_velocity_; | 479 gfx::Vector2dF current_fling_velocity_; |
| 478 | 480 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 scoped_ptr<AnimationRegistrar> animation_registrar_; | 533 scoped_ptr<AnimationRegistrar> animation_registrar_; |
| 532 | 534 |
| 533 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 535 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
| 534 | 536 |
| 535 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 537 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 536 }; | 538 }; |
| 537 | 539 |
| 538 } // namespace cc | 540 } // namespace cc |
| 539 | 541 |
| 540 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 542 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |