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 <list> | 8 #include <list> |
9 #include <queue> | 9 #include <queue> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "cc/rendering_stats.h" | 15 #include "cc/rendering_stats.h" |
16 #include "cc/resource_pool.h" | 16 #include "cc/resource_pool.h" |
17 #include "cc/tile_priority.h" | 17 #include "cc/tile_priority.h" |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 class RasterWorkerPool; | 20 class RasterWorkerPool; |
21 class ResourceProvider; | 21 class ResourceProvider; |
22 class Tile; | 22 class Tile; |
23 class TileVersion; | 23 class TileVersion; |
24 | 24 |
25 class CC_EXPORT TileManagerClient { | 25 class CC_EXPORT TileManagerClient { |
26 public: | 26 public: |
27 virtual void ScheduleManageTiles() = 0; | 27 virtual void ScheduleManageTiles() = 0; |
| 28 virtual void DidUploadVisibleHighResolutionTile() = 0; |
28 | 29 |
29 protected: | 30 protected: |
30 virtual ~TileManagerClient() {} | 31 virtual ~TileManagerClient() {} |
31 }; | 32 }; |
32 | 33 |
33 // Tile manager classifying tiles into a few basic | 34 // Tile manager classifying tiles into a few basic |
34 // bins: | 35 // bins: |
35 enum TileManagerBin { | 36 enum TileManagerBin { |
36 NOW_BIN = 0, // Needed ASAP. | 37 NOW_BIN = 0, // Needed ASAP. |
37 SOON_BIN = 1, // Impl-side version of prepainting. | 38 SOON_BIN = 1, // Impl-side version of prepainting. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 ResourceProvider *resource_provider, | 76 ResourceProvider *resource_provider, |
76 size_t num_raster_threads); | 77 size_t num_raster_threads); |
77 virtual ~TileManager(); | 78 virtual ~TileManager(); |
78 | 79 |
79 const GlobalStateThatImpactsTilePriority& GlobalState() const { | 80 const GlobalStateThatImpactsTilePriority& GlobalState() const { |
80 return global_state_; | 81 return global_state_; |
81 } | 82 } |
82 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); | 83 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); |
83 | 84 |
84 void ManageTiles(); | 85 void ManageTiles(); |
85 void CheckForCompletedSetPixels(); | 86 void CheckForCompletedTextures(); |
86 void GetMemoryStats(size_t* memoryRequiredBytes, | 87 void GetMemoryStats(size_t* memoryRequiredBytes, |
87 size_t* memoryNiceToHaveBytes, | 88 size_t* memoryNiceToHaveBytes, |
88 size_t* memoryUsedBytes); | 89 size_t* memoryUsedBytes); |
89 | 90 |
90 void GetRenderingStats(RenderingStats* stats); | 91 void GetRenderingStats(RenderingStats* stats); |
91 | 92 |
92 protected: | 93 protected: |
93 // Methods called by Tile | 94 // Methods called by Tile |
94 friend class Tile; | 95 friend class Tile; |
95 void RegisterTile(Tile* tile); | 96 void RegisterTile(Tile* tile); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 TileQueue tiles_with_pending_set_pixels_; | 141 TileQueue tiles_with_pending_set_pixels_; |
141 | 142 |
142 RenderingStats rendering_stats_; | 143 RenderingStats rendering_stats_; |
143 | 144 |
144 DISALLOW_COPY_AND_ASSIGN(TileManager); | 145 DISALLOW_COPY_AND_ASSIGN(TileManager); |
145 }; | 146 }; |
146 | 147 |
147 } // namespace cc | 148 } // namespace cc |
148 | 149 |
149 #endif // CC_TILE_MANAGER_H_ | 150 #endif // CC_TILE_MANAGER_H_ |
OLD | NEW |