Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: cc/trees/layer_tree_host_impl.h

Issue 23495022: CC: Add a scheduled action for ManageTiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reduce scope to scheduler. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 public: 56 public:
57 virtual void DidLoseOutputSurfaceOnImplThread() = 0; 57 virtual void DidLoseOutputSurfaceOnImplThread() = 0;
58 virtual void OnSwapBuffersCompleteOnImplThread() = 0; 58 virtual void OnSwapBuffersCompleteOnImplThread() = 0;
59 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) = 0; 59 virtual void BeginFrameOnImplThread(const BeginFrameArgs& args) = 0;
60 virtual void OnCanDrawStateChanged(bool can_draw) = 0; 60 virtual void OnCanDrawStateChanged(bool can_draw) = 0;
61 virtual void NotifyReadyToActivate() = 0; 61 virtual void NotifyReadyToActivate() = 0;
62 virtual void SetNeedsRedrawOnImplThread() = 0; 62 virtual void SetNeedsRedrawOnImplThread() = 0;
63 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0; 63 virtual void SetNeedsRedrawRectOnImplThread(gfx::Rect damage_rect) = 0;
64 virtual void DidInitializeVisibleTileOnImplThread() = 0; 64 virtual void DidInitializeVisibleTileOnImplThread() = 0;
65 virtual void SetNeedsCommitOnImplThread() = 0; 65 virtual void SetNeedsCommitOnImplThread() = 0;
66 virtual void SetNeedsManageTilesOnImplThread() = 0;
66 virtual void PostAnimationEventsToMainThreadOnImplThread( 67 virtual void PostAnimationEventsToMainThreadOnImplThread(
67 scoped_ptr<AnimationEventsVector> events, 68 scoped_ptr<AnimationEventsVector> events,
68 base::Time wall_clock_time) = 0; 69 base::Time wall_clock_time) = 0;
69 // Returns true if resources were deleted by this call. 70 // Returns true if resources were deleted by this call.
70 virtual bool ReduceContentsTextureMemoryOnImplThread( 71 virtual bool ReduceContentsTextureMemoryOnImplThread(
71 size_t limit_bytes, 72 size_t limit_bytes,
72 int priority_cutoff) = 0; 73 int priority_cutoff) = 0;
73 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; 74 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0;
74 virtual void SendManagedMemoryStats() = 0; 75 virtual void SendManagedMemoryStats() = 0;
75 virtual bool IsInsideDraw() = 0; 76 virtual bool IsInsideDraw() = 0;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 154
154 virtual void BeginCommit(); 155 virtual void BeginCommit();
155 virtual void CommitComplete(); 156 virtual void CommitComplete();
156 virtual void Animate(base::TimeTicks monotonic_time, 157 virtual void Animate(base::TimeTicks monotonic_time,
157 base::Time wall_clock_time); 158 base::Time wall_clock_time);
158 virtual void UpdateAnimationState(bool start_ready_animations); 159 virtual void UpdateAnimationState(bool start_ready_animations);
159 void MainThreadHasStoppedFlinging(); 160 void MainThreadHasStoppedFlinging();
160 void UpdateBackgroundAnimateTicking(bool should_background_tick); 161 void UpdateBackgroundAnimateTicking(bool should_background_tick);
161 void SetViewportDamage(gfx::Rect damage_rect); 162 void SetViewportDamage(gfx::Rect damage_rect);
162 163
163 void ManageTiles(); 164 virtual void ManageTiles();
164 165
165 // Returns false if problems occured preparing the frame, and we should try 166 // Returns false if problems occured preparing the frame, and we should try
166 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers 167 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers
167 // must also be called, regardless of whether DrawLayers is called between the 168 // must also be called, regardless of whether DrawLayers is called between the
168 // two. 169 // two.
169 virtual bool PrepareToDraw(FrameData* frame, 170 virtual bool PrepareToDraw(FrameData* frame,
170 gfx::Rect device_viewport_damage_rect); 171 gfx::Rect device_viewport_damage_rect);
171 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); 172 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time);
172 // Must be called if and only if PrepareToDraw was called. 173 // Must be called if and only if PrepareToDraw was called.
173 void DidDrawAllLayers(const FrameData& frame); 174 void DidDrawAllLayers(const FrameData& frame);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 int SourceAnimationFrameNumber() const; 246 int SourceAnimationFrameNumber() const;
246 247
247 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface); 248 virtual bool InitializeRenderer(scoped_ptr<OutputSurface> output_surface);
248 bool IsContextLost(); 249 bool IsContextLost();
249 TileManager* tile_manager() { return tile_manager_.get(); } 250 TileManager* tile_manager() { return tile_manager_.get(); }
250 Renderer* renderer() { return renderer_.get(); } 251 Renderer* renderer() { return renderer_.get(); }
251 const RendererCapabilities& GetRendererCapabilities() const; 252 const RendererCapabilities& GetRendererCapabilities() const;
252 253
253 virtual bool SwapBuffers(const FrameData& frame); 254 virtual bool SwapBuffers(const FrameData& frame);
254 void SetNeedsBeginFrame(bool enable); 255 void SetNeedsBeginFrame(bool enable);
255 void SetNeedsManageTiles() { manage_tiles_needed_ = true; } 256 void DidModifyTilePriorities();
256 257
257 void Readback(void* pixels, gfx::Rect rect_in_device_viewport); 258 void Readback(void* pixels, gfx::Rect rect_in_device_viewport);
258 259
259 LayerTreeImpl* active_tree() { return active_tree_.get(); } 260 LayerTreeImpl* active_tree() { return active_tree_.get(); }
260 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } 261 const LayerTreeImpl* active_tree() const { return active_tree_.get(); }
261 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } 262 LayerTreeImpl* pending_tree() { return pending_tree_.get(); }
262 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } 263 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); }
263 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } 264 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); }
264 virtual void CreatePendingTree(); 265 virtual void CreatePendingTree();
265 virtual void UpdateVisibleTiles(); 266 virtual void UpdateVisibleTiles();
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 base::Time wall_clock_time); 419 base::Time wall_clock_time);
419 420
420 // Virtual for testing. 421 // Virtual for testing.
421 virtual base::TimeDelta LowFrequencyAnimationInterval() const; 422 virtual base::TimeDelta LowFrequencyAnimationInterval() const;
422 423
423 const AnimationRegistrar::AnimationControllerMap& 424 const AnimationRegistrar::AnimationControllerMap&
424 active_animation_controllers() const { 425 active_animation_controllers() const {
425 return animation_registrar_->active_animation_controllers(); 426 return animation_registrar_->active_animation_controllers();
426 } 427 }
427 428
428 bool manage_tiles_needed() const { return manage_tiles_needed_; } 429 bool tile_priorities_dirty() const { return tile_priorities_dirty_; }
430 bool manage_tiles_needed() const { return tile_priorities_dirty_; }
429 431
430 LayerTreeHostImplClient* client_; 432 LayerTreeHostImplClient* client_;
431 Proxy* proxy_; 433 Proxy* proxy_;
432 434
433 private: 435 private:
434 void CreateAndSetRenderer( 436 void CreateAndSetRenderer(
435 OutputSurface* output_surface, 437 OutputSurface* output_surface,
436 ResourceProvider* resource_provider, 438 ResourceProvider* resource_provider,
437 bool skip_gl_renderer); 439 bool skip_gl_renderer);
438 void CreateAndSetTileManager(ResourceProvider* resource_provider, 440 void CreateAndSetTileManager(ResourceProvider* resource_provider,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 502
501 // In impl-side painting mode, inert tree with layers that can be recycled 503 // In impl-side painting mode, inert tree with layers that can be recycled
502 // by the next sync from the main thread. 504 // by the next sync from the main thread.
503 scoped_ptr<LayerTreeImpl> recycle_tree_; 505 scoped_ptr<LayerTreeImpl> recycle_tree_;
504 506
505 InputHandlerClient* input_handler_client_; 507 InputHandlerClient* input_handler_client_;
506 bool did_lock_scrolling_layer_; 508 bool did_lock_scrolling_layer_;
507 bool should_bubble_scrolls_; 509 bool should_bubble_scrolls_;
508 bool wheel_scrolling_; 510 bool wheel_scrolling_;
509 511
510 bool manage_tiles_needed_; 512 bool tile_priorities_dirty_;
511 513
512 // The optional delegate for the root layer scroll offset. 514 // The optional delegate for the root layer scroll offset.
513 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_; 515 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate_;
514 LayerTreeSettings settings_; 516 LayerTreeSettings settings_;
515 LayerTreeDebugState debug_state_; 517 LayerTreeDebugState debug_state_;
516 bool visible_; 518 bool visible_;
517 ManagedMemoryPolicy cached_managed_memory_policy_; 519 ManagedMemoryPolicy cached_managed_memory_policy_;
518 520
519 gfx::Vector2dF accumulated_root_overscroll_; 521 gfx::Vector2dF accumulated_root_overscroll_;
520 gfx::Vector2dF current_fling_velocity_; 522 gfx::Vector2dF current_fling_velocity_;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 596
595 // Optional callback to notify of new tree activations. 597 // Optional callback to notify of new tree activations.
596 base::Closure tree_activation_callback_; 598 base::Closure tree_activation_callback_;
597 599
598 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 600 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
599 }; 601 };
600 602
601 } // namespace cc 603 } // namespace cc
602 604
603 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ 605 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698