| Index: cc/resources/picture_layer_tiling.h
|
| diff --git a/cc/resources/picture_layer_tiling.h b/cc/resources/picture_layer_tiling.h
|
| index f63dc676c895e6aefce8acc0896b889b9c16c9fe..edd139997ab9f377e54d758e2c8e95d7dfa1ee72 100644
|
| --- a/cc/resources/picture_layer_tiling.h
|
| +++ b/cc/resources/picture_layer_tiling.h
|
| @@ -10,7 +10,7 @@
|
| #include <vector>
|
|
|
| #include "base/basictypes.h"
|
| -#include "base/containers/scoped_ptr_hash_map.h"
|
| +#include "base/containers/hash_tables.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "cc/base/cc_export.h"
|
| #include "cc/base/region.h"
|
| @@ -35,8 +35,8 @@ class CC_EXPORT PictureLayerTilingClient {
|
| public:
|
| // Create a tile at the given content_rect (in the contents scale of the
|
| // tiling) This might return null if the client cannot create such a tile.
|
| - virtual ScopedTilePtr CreateTile(float contents_scale,
|
| - const gfx::Rect& content_rect) = 0;
|
| + virtual scoped_refptr<Tile> CreateTile(float contents_scale,
|
| + const gfx::Rect& content_rect) = 0;
|
| virtual gfx::Size CalculateTileSize(
|
| const gfx::Size& content_bounds) const = 0;
|
| // This invalidation region defines the area (if any, it can by null) that
|
| @@ -97,7 +97,7 @@ class CC_EXPORT PictureLayerTiling {
|
|
|
| Tile* TileAt(int i, int j) const {
|
| TileMap::const_iterator iter = tiles_.find(TileMapKey(i, j));
|
| - return iter == tiles_.end() ? nullptr : iter->second;
|
| + return iter == tiles_.end() ? nullptr : iter->second.get();
|
| }
|
|
|
| bool has_tiles() const { return !tiles_.empty(); }
|
| @@ -110,12 +110,18 @@ class CC_EXPORT PictureLayerTiling {
|
| std::vector<Tile*> AllTilesForTesting() const {
|
| std::vector<Tile*> all_tiles;
|
| for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
|
| - all_tiles.push_back(it->second);
|
| + all_tiles.push_back(it->second.get());
|
| return all_tiles;
|
| }
|
| void UpdateAllTilePrioritiesForTesting() {
|
| for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
|
| - UpdateTilePriority(it->second);
|
| + UpdateTilePriority(it->second.get());
|
| + }
|
| + std::vector<scoped_refptr<Tile>> AllRefTilesForTesting() const {
|
| + std::vector<scoped_refptr<Tile>> all_tiles;
|
| + for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
|
| + all_tiles.push_back(it->second);
|
| + return all_tiles;
|
| }
|
| void SetAllTilesOccludedForTesting() {
|
| gfx::Rect viewport_in_layer_space =
|
| @@ -209,8 +215,8 @@ class CC_EXPORT PictureLayerTiling {
|
| friend class TilingSetRasterQueueRequired;
|
| friend class TilingSetEvictionQueue;
|
|
|
| - using TileMapKey = std::pair<int, int>;
|
| - using TileMap = base::ScopedPtrHashMap<TileMapKey, ScopedTilePtr>;
|
| + typedef std::pair<int, int> TileMapKey;
|
| + typedef base::hash_map<TileMapKey, scoped_refptr<Tile>> TileMap;
|
|
|
| struct FrameVisibleRect {
|
| gfx::Rect visible_rect_in_content_space;
|
|
|