OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_TILE_MANAGER_H_ | 5 #ifndef CC_TILE_MANAGER_H_ |
6 #define CC_TILE_MANAGER_H_ | 6 #define CC_TILE_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "cc/resource_pool.h" | 12 #include "cc/resource_pool.h" |
13 #include "cc/tile_priority.h" | 13 #include "cc/tile_priority.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class SequencedWorkerPool; | 16 class SequencedWorkerPool; |
17 } | 17 } |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 | 20 |
21 class Tile; | 21 class Tile; |
22 class TileVersion; | 22 class TileVersion; |
| 23 struct RenderingStats; |
23 class ResourceProvider; | 24 class ResourceProvider; |
24 | 25 |
25 class CC_EXPORT TileManagerClient { | 26 class CC_EXPORT TileManagerClient { |
26 public: | 27 public: |
27 virtual void ScheduleManageTiles() = 0; | 28 virtual void ScheduleManageTiles() = 0; |
28 virtual void ScheduleRedraw() = 0; | 29 virtual void ScheduleRedraw() = 0; |
29 | 30 |
30 protected: | 31 protected: |
31 virtual ~TileManagerClient() {} | 32 virtual ~TileManagerClient() {} |
32 }; | 33 }; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 class CC_EXPORT TileManager { | 69 class CC_EXPORT TileManager { |
69 public: | 70 public: |
70 TileManager(TileManagerClient* client, ResourceProvider *resource_provider); | 71 TileManager(TileManagerClient* client, ResourceProvider *resource_provider); |
71 virtual ~TileManager(); | 72 virtual ~TileManager(); |
72 | 73 |
73 const GlobalStateThatImpactsTilePriority& GlobalState() const { return global_
state_; } | 74 const GlobalStateThatImpactsTilePriority& GlobalState() const { return global_
state_; } |
74 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); | 75 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); |
75 | 76 |
76 void ManageTiles(); | 77 void ManageTiles(); |
77 | 78 |
| 79 void renderingStats(RenderingStats* stats); |
| 80 |
78 protected: | 81 protected: |
79 // Methods called by Tile | 82 // Methods called by Tile |
80 friend class Tile; | 83 friend class Tile; |
81 void RegisterTile(Tile*); | 84 void RegisterTile(Tile*); |
82 void UnregisterTile(Tile*); | 85 void UnregisterTile(Tile*); |
83 void WillModifyTilePriority(Tile*, WhichTree, const TilePriority& new_priority
); | 86 void WillModifyTilePriority(Tile*, WhichTree, const TilePriority& new_priority
); |
84 | 87 |
85 private: | 88 private: |
86 void AssignGpuMemoryToTiles(); | 89 void AssignGpuMemoryToTiles(); |
87 void FreeResourcesForTile(Tile*); | 90 void FreeResourcesForTile(Tile*); |
88 void ScheduleManageTiles(); | 91 void ScheduleManageTiles(); |
89 void DispatchMoreRasterTasks(); | 92 void DispatchMoreRasterTasks(); |
90 void DispatchOneRasterTask(scoped_refptr<Tile>); | 93 void DispatchOneRasterTask(scoped_refptr<Tile>); |
91 void OnRasterTaskCompleted( | 94 void OnRasterTaskCompleted( |
92 scoped_refptr<Tile>, | 95 scoped_refptr<Tile>, |
93 ResourceProvider::ResourceId, | 96 ResourceProvider::ResourceId, |
94 scoped_refptr<PicturePileImpl>); | 97 scoped_refptr<PicturePileImpl>, |
| 98 RenderingStats*); |
95 void DidFinishTileInitialization(Tile*, ResourceProvider::ResourceId); | 99 void DidFinishTileInitialization(Tile*, ResourceProvider::ResourceId); |
96 | 100 |
97 TileManagerClient* client_; | 101 TileManagerClient* client_; |
98 scoped_ptr<ResourcePool> resource_pool_; | 102 scoped_ptr<ResourcePool> resource_pool_; |
99 bool manage_tiles_pending_; | 103 bool manage_tiles_pending_; |
100 int pending_raster_tasks_; | 104 int pending_raster_tasks_; |
101 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | 105 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
102 | 106 |
103 GlobalStateThatImpactsTilePriority global_state_; | 107 GlobalStateThatImpactsTilePriority global_state_; |
104 | 108 |
105 typedef std::vector<Tile*> TileVector; | 109 typedef std::vector<Tile*> TileVector; |
106 TileVector tiles_; | 110 TileVector tiles_; |
107 TileVector tiles_that_need_to_be_rasterized_; | 111 TileVector tiles_that_need_to_be_rasterized_; |
| 112 |
| 113 RenderingStats rendering_stats_; |
108 }; | 114 }; |
109 | 115 |
110 } // namespace cc | 116 } // namespace cc |
111 | 117 |
112 #endif // CC_TILE_MANAGER_H_ | 118 #endif // CC_TILE_MANAGER_H_ |
OLD | NEW |