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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 | 129 |
130 virtual void BeginCommit(); | 130 virtual void BeginCommit(); |
131 virtual void CommitComplete(); | 131 virtual void CommitComplete(); |
132 virtual void Animate(base::TimeTicks monotonic_time, | 132 virtual void Animate(base::TimeTicks monotonic_time, |
133 base::Time wall_clock_time); | 133 base::Time wall_clock_time); |
134 | 134 |
135 void ManageTiles(); | 135 void ManageTiles(); |
136 void SetAnticipatedDrawTime(base::TimeTicks time); | 136 void SetAnticipatedDrawTime(base::TimeTicks time); |
137 | 137 |
138 // Returns false if problems occured preparing the frame, and we should try | 138 // Returns false if problems occured preparing the frame, and we should try |
139 // to avoid displaying the frame. If prepareToDraw is called, DidDrawAllLayers | 139 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers |
140 // must also be called, regardless of whether DrawLayers is called between the | 140 // must also be called, regardless of whether DrawLayers is called between the |
141 // two. | 141 // two. |
142 virtual bool PrepareToDraw(FrameData* frame); | 142 virtual bool PrepareToDraw(FrameData* frame); |
143 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); | 143 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
144 // Must be called if and only if PrepareToDraw was called. | 144 // Must be called if and only if PrepareToDraw was called. |
145 void DidDrawAllLayers(const FrameData& frame); | 145 void DidDrawAllLayers(const FrameData& frame); |
146 | 146 |
147 const LayerTreeSettings& settings() const { return settings_; } | 147 const LayerTreeSettings& settings() const { return settings_; } |
148 | 148 |
149 // Returns the currently visible viewport size in DIP. This value excludes | 149 // Returns the currently visible viewport size in DIP. This value excludes |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 float scale, | 235 float scale, |
236 base::TimeDelta duration); | 236 base::TimeDelta duration); |
237 | 237 |
238 bool needs_animate_layers() const { | 238 bool needs_animate_layers() const { |
239 return !animation_registrar_->active_animation_controllers().empty(); | 239 return !animation_registrar_->active_animation_controllers().empty(); |
240 } | 240 } |
241 | 241 |
242 void SendManagedMemoryStats( | 242 void SendManagedMemoryStats( |
243 size_t memory_visible_bytes, | 243 size_t memory_visible_bytes, |
244 size_t memory_visible_and_nearby_bytes, | 244 size_t memory_visible_and_nearby_bytes, |
245 size_t memoryUseBytes); | 245 size_t memory_use_bytes); |
246 | 246 |
247 FrameRateCounter* fps_counter() { | 247 FrameRateCounter* fps_counter() { |
248 return fps_counter_.get(); | 248 return fps_counter_.get(); |
249 } | 249 } |
250 PaintTimeCounter* paint_time_counter() { | 250 PaintTimeCounter* paint_time_counter() { |
251 return paint_time_counter_.get(); | 251 return paint_time_counter_.get(); |
252 } | 252 } |
253 MemoryHistory* memory_history() { | 253 MemoryHistory* memory_history() { |
254 return memory_history_.get(); | 254 return memory_history_.get(); |
255 } | 255 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 | 350 |
351 LayerTreeHostImplClient* client_; | 351 LayerTreeHostImplClient* client_; |
352 Proxy* proxy_; | 352 Proxy* proxy_; |
353 | 353 |
354 private: | 354 private: |
355 void AnimatePageScale(base::TimeTicks monotonic_time); | 355 void AnimatePageScale(base::TimeTicks monotonic_time); |
356 void AnimateScrollbars(base::TimeTicks monotonic_time); | 356 void AnimateScrollbars(base::TimeTicks monotonic_time); |
357 void AnimateTopControls(base::TimeTicks monotonic_time); | 357 void AnimateTopControls(base::TimeTicks monotonic_time); |
358 | 358 |
359 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( | 359 gfx::Vector2dF ScrollLayerWithViewportSpaceDelta( |
360 LayerImpl* layerImpl, | 360 LayerImpl* layer_ompl, |
enne (OOO)
2013/03/23 01:30:23
layer_ompalompas
| |
361 float scaleFromViewportToScreenSpace, | 361 float scale_from_viewport_to_screen_space, |
362 gfx::PointF viewportPoint, | 362 gfx::PointF viewport_point, |
363 gfx::Vector2dF viewportDelta); | 363 gfx::Vector2dF viewport_delta); |
364 | 364 |
365 void UpdateMaxScrollOffset(); | 365 void UpdateMaxScrollOffset(); |
366 void TrackDamageForAllSurfaces(LayerImpl* root_draw_layer, | 366 void TrackDamageForAllSurfaces(LayerImpl* root_draw_layer, |
367 const LayerList& render_surface_layer_list); | 367 const LayerList& render_surface_layer_list); |
368 | 368 |
369 // Returns false if the frame should not be displayed. This function should | 369 // Returns false if the frame should not be displayed. This function should |
370 // only be called from prepareToDraw, as didDrawAllLayers must be called | 370 // only be called from PrepareToDraw, as DidDrawAllLayers must be called |
371 // if this helper function is called. | 371 // if this helper function is called. |
372 bool CalculateRenderPasses(FrameData* frame); | 372 bool CalculateRenderPasses(FrameData* frame); |
373 void SetBackgroundTickingEnabled(bool enabled); | 373 void SetBackgroundTickingEnabled(bool enabled); |
374 | 374 |
375 void SendDidLoseOutputSurfaceRecursive(LayerImpl* current); | 375 void SendDidLoseOutputSurfaceRecursive(LayerImpl* current); |
376 void ClearRenderSurfaces(); | 376 void ClearRenderSurfaces(); |
377 bool EnsureRenderSurfaceLayerList(); | 377 bool EnsureRenderSurfaceLayerList(); |
378 void ClearCurrentlyScrollingLayer(); | 378 void ClearCurrentlyScrollingLayer(); |
379 | 379 |
380 void AnimateScrollbarsRecursive(LayerImpl* layer, | 380 void AnimateScrollbarsRecursive(LayerImpl* layer, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
450 scoped_ptr<AnimationRegistrar> animation_registrar_; | 450 scoped_ptr<AnimationRegistrar> animation_registrar_; |
451 | 451 |
452 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 452 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
453 | 453 |
454 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 454 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
455 }; | 455 }; |
456 | 456 |
457 } // namespace cc | 457 } // namespace cc |
458 | 458 |
459 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 459 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |