| 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/draw_swap_readback_result.h" | 34 #include "cc/scheduler/draw_result.h" |
| 35 #include "skia/ext/refptr.h" | 35 #include "skia/ext/refptr.h" |
| 36 #include "third_party/skia/include/core/SkColor.h" | 36 #include "third_party/skia/include/core/SkColor.h" |
| 37 #include "ui/gfx/rect.h" | 37 #include "ui/gfx/rect.h" |
| 38 | 38 |
| 39 namespace cc { | 39 namespace cc { |
| 40 | 40 |
| 41 class CompletionEvent; | 41 class CompletionEvent; |
| 42 class CompositorFrameMetadata; | 42 class CompositorFrameMetadata; |
| 43 class DebugRectHistory; | 43 class DebugRectHistory; |
| 44 class FrameRateCounter; | 44 class FrameRateCounter; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 void UpdateBackgroundAnimateTicking(bool should_background_tick); | 185 void UpdateBackgroundAnimateTicking(bool should_background_tick); |
| 186 void DidAnimateScrollOffset(); | 186 void DidAnimateScrollOffset(); |
| 187 void SetViewportDamage(const gfx::Rect& damage_rect); | 187 void SetViewportDamage(const gfx::Rect& damage_rect); |
| 188 | 188 |
| 189 virtual void ManageTiles(); | 189 virtual void ManageTiles(); |
| 190 | 190 |
| 191 // Returns false if problems occured preparing the frame, and we should try | 191 // Returns false if problems occured preparing the frame, and we should try |
| 192 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers | 192 // to avoid displaying the frame. If PrepareToDraw is called, DidDrawAllLayers |
| 193 // must also be called, regardless of whether DrawLayers is called between the | 193 // must also be called, regardless of whether DrawLayers is called between the |
| 194 // two. | 194 // two. |
| 195 virtual DrawSwapReadbackResult::DrawResult PrepareToDraw( | 195 virtual DrawResult PrepareToDraw(FrameData* frame, |
| 196 FrameData* frame, | 196 const gfx::Rect& damage_rect); |
| 197 const gfx::Rect& damage_rect); | |
| 198 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); | 197 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
| 199 // Must be called if and only if PrepareToDraw was called. | 198 // Must be called if and only if PrepareToDraw was called. |
| 200 void DidDrawAllLayers(const FrameData& frame); | 199 void DidDrawAllLayers(const FrameData& frame); |
| 201 | 200 |
| 202 const LayerTreeSettings& settings() const { return settings_; } | 201 const LayerTreeSettings& settings() const { return settings_; } |
| 203 | 202 |
| 204 // Evict all textures by enforcing a memory policy with an allocation of 0. | 203 // Evict all textures by enforcing a memory policy with an allocation of 0. |
| 205 void EvictTexturesForTesting(); | 204 void EvictTexturesForTesting(); |
| 206 | 205 |
| 207 // When blocking, this prevents client_->NotifyReadyToActivate() from being | 206 // When blocking, this prevents client_->NotifyReadyToActivate() from being |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 Proxy* proxy() const { return proxy_; } | 372 Proxy* proxy() const { return proxy_; } |
| 374 | 373 |
| 375 AnimationRegistrar* animation_registrar() const { | 374 AnimationRegistrar* animation_registrar() const { |
| 376 return animation_registrar_.get(); | 375 return animation_registrar_.get(); |
| 377 } | 376 } |
| 378 | 377 |
| 379 void SetDebugState(const LayerTreeDebugState& new_debug_state); | 378 void SetDebugState(const LayerTreeDebugState& new_debug_state); |
| 380 const LayerTreeDebugState& debug_state() const { return debug_state_; } | 379 const LayerTreeDebugState& debug_state() const { return debug_state_; } |
| 381 | 380 |
| 382 class CC_EXPORT CullRenderPassesWithNoQuads { | 381 class CC_EXPORT CullRenderPassesWithNoQuads { |
| 383 public: | 382 public: |
| 384 bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, | 383 bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, |
| 385 const FrameData& frame) const; | 384 const FrameData& frame) const; |
| 386 | 385 |
| 387 // Iterates in draw order, so that when a surface is removed, and its | 386 // Iterates in draw order, so that when a surface is removed, and its |
| 388 // target becomes empty, then its target can be removed also. | 387 // target becomes empty, then its target can be removed also. |
| 389 size_t RenderPassListBegin(const RenderPassList& list) const { return 0; } | 388 size_t RenderPassListBegin(const RenderPassList& list) const { return 0; } |
| 390 size_t RenderPassListEnd(const RenderPassList& list) const { | 389 size_t RenderPassListEnd(const RenderPassList& list) const { |
| 391 return list.size(); | 390 return list.size(); |
| 392 } | 391 } |
| 393 size_t RenderPassListNext(size_t it) const { return it + 1; } | 392 size_t RenderPassListNext(size_t it) const { return it + 1; } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 506 |
| 508 void TrackDamageForAllSurfaces( | 507 void TrackDamageForAllSurfaces( |
| 509 LayerImpl* root_draw_layer, | 508 LayerImpl* root_draw_layer, |
| 510 const LayerImplList& render_surface_layer_list); | 509 const LayerImplList& render_surface_layer_list); |
| 511 | 510 |
| 512 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); | 511 void UpdateTileManagerMemoryPolicy(const ManagedMemoryPolicy& policy); |
| 513 | 512 |
| 514 // This function should only be called from PrepareToDraw, as DidDrawAllLayers | 513 // This function should only be called from PrepareToDraw, as DidDrawAllLayers |
| 515 // must be called if this helper function is called. Returns DRAW_SUCCESS if | 514 // must be called if this helper function is called. Returns DRAW_SUCCESS if |
| 516 // the frame should be drawn. | 515 // the frame should be drawn. |
| 517 DrawSwapReadbackResult::DrawResult CalculateRenderPasses(FrameData* frame); | 516 DrawResult CalculateRenderPasses(FrameData* frame); |
| 518 | 517 |
| 519 bool EnsureRenderSurfaceLayerList(); | 518 bool EnsureRenderSurfaceLayerList(); |
| 520 void ClearCurrentlyScrollingLayer(); | 519 void ClearCurrentlyScrollingLayer(); |
| 521 | 520 |
| 522 bool HandleMouseOverScrollbar(LayerImpl* layer_impl, | 521 bool HandleMouseOverScrollbar(LayerImpl* layer_impl, |
| 523 const gfx::PointF& device_viewport_point); | 522 const gfx::PointF& device_viewport_point); |
| 524 | 523 |
| 525 void AnimateScrollbarsRecursive(LayerImpl* layer, | 524 void AnimateScrollbarsRecursive(LayerImpl* layer, |
| 526 base::TimeTicks time); | 525 base::TimeTicks time); |
| 527 | 526 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 679 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 681 | 680 |
| 682 size_t transfer_buffer_memory_limit_; | 681 size_t transfer_buffer_memory_limit_; |
| 683 | 682 |
| 684 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 683 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 685 }; | 684 }; |
| 686 | 685 |
| 687 } // namespace cc | 686 } // namespace cc |
| 688 | 687 |
| 689 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 688 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |