Chromium Code Reviews| Index: cc/tile_manager.h |
| diff --git a/cc/tile_manager.h b/cc/tile_manager.h |
| index 2d57f7d04312d5607630b68a75f7b5845c921e5b..98beb6faa19406494f8eb97f92bbf9f9014ef2d7 100644 |
| --- a/cc/tile_manager.h |
| +++ b/cc/tile_manager.h |
| @@ -12,12 +12,24 @@ |
| #include "cc/resource_pool.h" |
| #include "cc/tile_priority.h" |
| +#if defined(COMPILER_GCC) |
| +namespace BASE_HASH_NAMESPACE { |
| +template<> |
| +struct hash<SkPixelRef*> { |
|
nduca
2012/12/06 08:46:53
Can we make SkLazyPixelRef have an id() field on i
qinmin
2012/12/07 05:06:28
SkPixelRef has getGenerationId() call. But the rev
|
| + size_t operator()(SkPixelRef* ptr) const { |
| + return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| + } |
| +}; |
| +} // namespace BASE_HASH_NAMESPACE |
| +#endif // COMPILER_GCC |
| + |
| namespace base { |
| class SequencedWorkerPool; |
| } |
| namespace cc { |
| +class Image; |
| class Tile; |
| class TileVersion; |
| struct RenderingStats; |
| @@ -42,6 +54,13 @@ enum TileManagerBin { |
| NUM_BINS = 4 |
| }; |
| +// Current progress of image decoding jobs. |
| +enum ImageDecodingProgress { |
| + NOT_STARTED = 0, |
| + IN_PROGRESS = 1, |
| + FINISHED = 2 |
| +}; |
| + |
| // This is state that is specific to a tile that is |
| // managed by the TileManager. |
| class CC_EXPORT ManagedTileState { |
| @@ -60,6 +79,7 @@ class CC_EXPORT ManagedTileState { |
| TileManagerBin bin; |
| TileResolution resolution; |
| float time_to_needed_in_seconds; |
| + std::vector<SkPixelRef*> pixel_refs; |
|
nduca
2012/12/06 08:46:53
hmm.... isn't it sufficient to track num_pending_d
qinmin
2012/12/07 05:06:28
Then we need a map in TileManager to map from skpi
|
| }; |
| // This class manages tiles, deciding which should get rasterized and which |
| @@ -97,6 +117,9 @@ class CC_EXPORT TileManager { |
| scoped_refptr<PicturePileImpl>, |
| RenderingStats*); |
| void DidFinishTileInitialization(Tile*, ResourceProvider::ResourceId); |
| + bool HasUndecodedImages(Tile*, std::vector<SkPixelRef*>&); |
|
Alpha Left Google
2012/12/05 20:24:28
This seems to be called over and over again, does
qinmin
2012/12/07 05:06:28
No, this just check if the tile has undecoded imag
|
| + void OnImageDecoded(scoped_refptr<Image> image); |
| + void SpawnImageDecodingTask(SkPixelRef*); |
|
reveman
2012/12/05 19:48:46
Maybe DispatchOneImageDecodingTask/OnImageDecoding
qinmin
2012/12/07 05:06:28
Done.
|
| TileManagerClient* client_; |
| scoped_ptr<ResourcePool> resource_pool_; |
| @@ -110,6 +133,12 @@ class CC_EXPORT TileManager { |
| TileVector tiles_; |
| TileVector tiles_that_need_to_be_rasterized_; |
| + typedef base::hash_map<uint32_t, scoped_refptr<Tile> > TileMap; |
|
reveman
2012/12/05 19:48:46
where is TileMap used?
qinmin
2012/12/07 05:06:28
This is originally wrote to map SkPixelRef* to til
|
| + |
| + typedef base::hash_map<SkPixelRef*, ImageDecodingProgress> |
| + PixelRefDecodingProgress; |
| + PixelRefDecodingProgress decoding_progress_; |
|
nduca
2012/12/06 08:46:53
All you need is IsDecodeTaskPending. Finished is n
qinmin
2012/12/07 05:06:28
changed it to pending_decode_tasks_ hashmap here.
|
| + |
| RenderingStats rendering_stats_; |
| }; |