Chromium Code Reviews| 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 174 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 DrawSwapReadbackResult::DrawResult PrepareToDraw(FrameData* frame); |
|
brianderson
2014/05/10 00:47:53
I would say rename this to DrawSwapResult, but Sim
danakj
2014/05/10 15:30:55
I was planning to change this to a bool or rename
| |
| 196 FrameData* frame, | |
| 197 const gfx::Rect& damage_rect); | |
| 198 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); | 196 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
| 199 // Must be called if and only if PrepareToDraw was called. | 197 // Must be called if and only if PrepareToDraw was called. |
| 200 void DidDrawAllLayers(const FrameData& frame); | 198 void DidDrawAllLayers(const FrameData& frame); |
| 201 | 199 |
| 202 const LayerTreeSettings& settings() const { return settings_; } | 200 const LayerTreeSettings& settings() const { return settings_; } |
| 203 | 201 |
| 204 // Evict all textures by enforcing a memory policy with an allocation of 0. | 202 // Evict all textures by enforcing a memory policy with an allocation of 0. |
| 205 void EvictTexturesForTesting(); | 203 void EvictTexturesForTesting(); |
| 206 | 204 |
| 207 // When blocking, this prevents client_->NotifyReadyToActivate() from being | 205 // When blocking, this prevents client_->NotifyReadyToActivate() from being |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 TileManager* tile_manager() { return tile_manager_.get(); } | 273 TileManager* tile_manager() { return tile_manager_.get(); } |
| 276 ResourcePool* resource_pool() { return resource_pool_.get(); } | 274 ResourcePool* resource_pool() { return resource_pool_.get(); } |
| 277 Renderer* renderer() { return renderer_.get(); } | 275 Renderer* renderer() { return renderer_.get(); } |
| 278 const RendererCapabilitiesImpl& GetRendererCapabilities() const; | 276 const RendererCapabilitiesImpl& GetRendererCapabilities() const; |
| 279 | 277 |
| 280 virtual bool SwapBuffers(const FrameData& frame); | 278 virtual bool SwapBuffers(const FrameData& frame); |
| 281 void SetNeedsBeginFrame(bool enable); | 279 void SetNeedsBeginFrame(bool enable); |
| 282 virtual void WillBeginImplFrame(const BeginFrameArgs& args); | 280 virtual void WillBeginImplFrame(const BeginFrameArgs& args); |
| 283 void DidModifyTilePriorities(); | 281 void DidModifyTilePriorities(); |
| 284 | 282 |
| 285 void Readback(void* pixels, const gfx::Rect& rect_in_device_viewport); | |
| 286 | |
| 287 LayerTreeImpl* active_tree() { return active_tree_.get(); } | 283 LayerTreeImpl* active_tree() { return active_tree_.get(); } |
| 288 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } | 284 const LayerTreeImpl* active_tree() const { return active_tree_.get(); } |
| 289 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } | 285 LayerTreeImpl* pending_tree() { return pending_tree_.get(); } |
| 290 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } | 286 const LayerTreeImpl* pending_tree() const { return pending_tree_.get(); } |
| 291 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } | 287 const LayerTreeImpl* recycle_tree() const { return recycle_tree_.get(); } |
| 292 virtual void CreatePendingTree(); | 288 virtual void CreatePendingTree(); |
| 293 virtual void UpdateVisibleTiles(); | 289 virtual void UpdateVisibleTiles(); |
| 294 virtual void ActivatePendingTree(); | 290 virtual void ActivatePendingTree(); |
| 295 | 291 |
| 296 // Shortcuts to layers on the active tree. | 292 // Shortcuts to layers on the active tree. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 373 Proxy* proxy() const { return proxy_; } | 369 Proxy* proxy() const { return proxy_; } |
| 374 | 370 |
| 375 AnimationRegistrar* animation_registrar() const { | 371 AnimationRegistrar* animation_registrar() const { |
| 376 return animation_registrar_.get(); | 372 return animation_registrar_.get(); |
| 377 } | 373 } |
| 378 | 374 |
| 379 void SetDebugState(const LayerTreeDebugState& new_debug_state); | 375 void SetDebugState(const LayerTreeDebugState& new_debug_state); |
| 380 const LayerTreeDebugState& debug_state() const { return debug_state_; } | 376 const LayerTreeDebugState& debug_state() const { return debug_state_; } |
| 381 | 377 |
| 382 class CC_EXPORT CullRenderPassesWithNoQuads { | 378 class CC_EXPORT CullRenderPassesWithNoQuads { |
| 383 public: | 379 public: |
| 384 bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, | 380 bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, |
| 385 const FrameData& frame) const; | 381 const FrameData& frame) const; |
| 386 | 382 |
| 387 // Iterates in draw order, so that when a surface is removed, and its | 383 // Iterates in draw order, so that when a surface is removed, and its |
| 388 // target becomes empty, then its target can be removed also. | 384 // target becomes empty, then its target can be removed also. |
| 389 size_t RenderPassListBegin(const RenderPassList& list) const { return 0; } | 385 size_t RenderPassListBegin(const RenderPassList& list) const { return 0; } |
| 390 size_t RenderPassListEnd(const RenderPassList& list) const { | 386 size_t RenderPassListEnd(const RenderPassList& list) const { |
| 391 return list.size(); | 387 return list.size(); |
| 392 } | 388 } |
| 393 size_t RenderPassListNext(size_t it) const { return it + 1; } | 389 size_t RenderPassListNext(size_t it) const { return it + 1; } |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 681 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 677 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 682 | 678 |
| 683 size_t transfer_buffer_memory_limit_; | 679 size_t transfer_buffer_memory_limit_; |
| 684 | 680 |
| 685 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 681 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
| 686 }; | 682 }; |
| 687 | 683 |
| 688 } // namespace cc | 684 } // namespace cc |
| 689 | 685 |
| 690 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 686 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
| OLD | NEW |