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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 class EvictionTilePriorityQueue; | 45 class EvictionTilePriorityQueue; |
46 class FrameRateCounter; | 46 class FrameRateCounter; |
47 class LayerImpl; | 47 class LayerImpl; |
48 class LayerTreeImpl; | 48 class LayerTreeImpl; |
49 class MemoryHistory; | 49 class MemoryHistory; |
50 class PageScaleAnimation; | 50 class PageScaleAnimation; |
51 class PaintTimeCounter; | 51 class PaintTimeCounter; |
52 class PictureLayerImpl; | 52 class PictureLayerImpl; |
53 class RasterTilePriorityQueue; | 53 class RasterTilePriorityQueue; |
54 class TileTaskWorkerPool; | 54 class TileTaskWorkerPool; |
| 55 class Rasterizer; |
| 56 class SoftwareRasterizer; |
| 57 class GpuRasterizer; |
55 class RenderPassDrawQuad; | 58 class RenderPassDrawQuad; |
56 class RenderingStatsInstrumentation; | 59 class RenderingStatsInstrumentation; |
57 class ResourcePool; | 60 class ResourcePool; |
58 class ScrollElasticityHelper; | 61 class ScrollElasticityHelper; |
59 class ScrollbarLayerImplBase; | 62 class ScrollbarLayerImplBase; |
60 class TextureMailboxDeleter; | 63 class TextureMailboxDeleter; |
61 class TopControlsManager; | 64 class TopControlsManager; |
62 class UIResourceBitmap; | 65 class UIResourceBitmap; |
63 class UIResourceRequest; | 66 class UIResourceRequest; |
64 struct RendererCapabilitiesImpl; | 67 struct RendererCapabilitiesImpl; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 virtual void BeginMainFrameAborted(bool did_handle); | 196 virtual void BeginMainFrameAborted(bool did_handle); |
194 virtual void BeginCommit(); | 197 virtual void BeginCommit(); |
195 virtual void CommitComplete(); | 198 virtual void CommitComplete(); |
196 virtual void Animate(base::TimeTicks monotonic_time); | 199 virtual void Animate(base::TimeTicks monotonic_time); |
197 virtual void UpdateAnimationState(bool start_ready_animations); | 200 virtual void UpdateAnimationState(bool start_ready_animations); |
198 void ActivateAnimations(); | 201 void ActivateAnimations(); |
199 void MainThreadHasStoppedFlinging(); | 202 void MainThreadHasStoppedFlinging(); |
200 void DidAnimateScrollOffset(); | 203 void DidAnimateScrollOffset(); |
201 void SetViewportDamage(const gfx::Rect& damage_rect); | 204 void SetViewportDamage(const gfx::Rect& damage_rect); |
202 | 205 |
| 206 virtual void PrepareTilesBeforeDraw(); |
203 virtual void PrepareTiles(); | 207 virtual void PrepareTiles(); |
204 | 208 |
205 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we | 209 // Returns DRAW_SUCCESS unless problems occured preparing the frame, and we |
206 // should try to avoid displaying the frame. If PrepareToDraw is called, | 210 // should try to avoid displaying the frame. If PrepareToDraw is called, |
207 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is | 211 // DidDrawAllLayers must also be called, regardless of whether DrawLayers is |
208 // called between the two. | 212 // called between the two. |
209 virtual DrawResult PrepareToDraw(FrameData* frame); | 213 virtual DrawResult PrepareToDraw(FrameData* frame); |
210 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); | 214 virtual void DrawLayers(FrameData* frame, base::TimeTicks frame_begin_time); |
211 // Must be called if and only if PrepareToDraw was called. | 215 // Must be called if and only if PrepareToDraw was called. |
212 void DidDrawAllLayers(const FrameData& frame); | 216 void DidDrawAllLayers(const FrameData& frame); |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 498 |
495 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } | 499 void SetRequiresHighResToDraw() { requires_high_res_to_draw_ = true; } |
496 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } | 500 void ResetRequiresHighResToDraw() { requires_high_res_to_draw_ = false; } |
497 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } | 501 bool RequiresHighResToDraw() const { return requires_high_res_to_draw_; } |
498 | 502 |
499 // Only valid for synchronous (non-scheduled) single-threaded case. | 503 // Only valid for synchronous (non-scheduled) single-threaded case. |
500 void SynchronouslyInitializeAllTiles(); | 504 void SynchronouslyInitializeAllTiles(); |
501 | 505 |
502 virtual void CreateResourceAndTileTaskWorkerPool( | 506 virtual void CreateResourceAndTileTaskWorkerPool( |
503 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 507 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
| 508 scoped_ptr<Rasterizer>* rasterizer, |
504 scoped_ptr<ResourcePool>* resource_pool, | 509 scoped_ptr<ResourcePool>* resource_pool, |
505 scoped_ptr<ResourcePool>* staging_resource_pool); | 510 scoped_ptr<ResourcePool>* staging_resource_pool); |
506 | 511 |
507 protected: | 512 protected: |
508 LayerTreeHostImpl( | 513 LayerTreeHostImpl( |
509 const LayerTreeSettings& settings, | 514 const LayerTreeSettings& settings, |
510 LayerTreeHostImplClient* client, | 515 LayerTreeHostImplClient* client, |
511 Proxy* proxy, | 516 Proxy* proxy, |
512 RenderingStatsInstrumentation* rendering_stats_instrumentation, | 517 RenderingStatsInstrumentation* rendering_stats_instrumentation, |
513 SharedBitmapManager* shared_bitmap_manager, | 518 SharedBitmapManager* shared_bitmap_manager, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 609 |
605 scoped_ptr<OutputSurface> output_surface_; | 610 scoped_ptr<OutputSurface> output_surface_; |
606 | 611 |
607 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- | 612 // |resource_provider_| and |tile_manager_| can be NULL, e.g. when using tile- |
608 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). | 613 // free rendering - see OutputSurface::ForcedDrawToSoftwareDevice(). |
609 scoped_ptr<ResourceProvider> resource_provider_; | 614 scoped_ptr<ResourceProvider> resource_provider_; |
610 scoped_ptr<TileManager> tile_manager_; | 615 scoped_ptr<TileManager> tile_manager_; |
611 bool use_gpu_rasterization_; | 616 bool use_gpu_rasterization_; |
612 GpuRasterizationStatus gpu_rasterization_status_; | 617 GpuRasterizationStatus gpu_rasterization_status_; |
613 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; | 618 scoped_ptr<TileTaskWorkerPool> tile_task_worker_pool_; |
| 619 scoped_ptr<Rasterizer> rasterizer_; |
614 scoped_ptr<ResourcePool> resource_pool_; | 620 scoped_ptr<ResourcePool> resource_pool_; |
615 scoped_ptr<ResourcePool> staging_resource_pool_; | 621 scoped_ptr<ResourcePool> staging_resource_pool_; |
616 scoped_ptr<Renderer> renderer_; | 622 scoped_ptr<Renderer> renderer_; |
617 | 623 |
618 GlobalStateThatImpactsTilePriority global_tile_state_; | 624 GlobalStateThatImpactsTilePriority global_tile_state_; |
619 | 625 |
620 // Tree currently being drawn. | 626 // Tree currently being drawn. |
621 scoped_ptr<LayerTreeImpl> active_tree_; | 627 scoped_ptr<LayerTreeImpl> active_tree_; |
622 | 628 |
623 // In impl-side painting mode, tree with possibly incomplete rasterized | 629 // In impl-side painting mode, tree with possibly incomplete rasterized |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 | 732 |
727 bool requires_high_res_to_draw_; | 733 bool requires_high_res_to_draw_; |
728 bool required_for_draw_tile_is_top_of_raster_queue_; | 734 bool required_for_draw_tile_is_top_of_raster_queue_; |
729 | 735 |
730 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 736 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
731 }; | 737 }; |
732 | 738 |
733 } // namespace cc | 739 } // namespace cc |
734 | 740 |
735 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 741 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |