Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Unified Diff: cc/layer_tiling_data.h

Issue 11144023: cc: Store tiles, painters, tiling data in scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/frame_buffer_skpicture_canvas_layer_texture_updater.cc ('k') | cc/layer_tiling_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_tiling_data.h
diff --git a/cc/layer_tiling_data.h b/cc/layer_tiling_data.h
index 19921d00ca6290d2e7226cf27aa9c4e07d09a4e0..2be7b4c097896c4252b78b430fc9801667fcfa49 100644
--- a/cc/layer_tiling_data.h
+++ b/cc/layer_tiling_data.h
@@ -7,12 +7,12 @@
#define CCLayerTilingData_h
#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "cc/hash_pair.h"
+#include "cc/scoped_ptr_hash_map.h"
#include "IntRect.h"
#include "Region.h"
#include "TilingData.h"
-#include <wtf/HashMap.h>
-#include <wtf/HashTraits.h>
-#include <wtf/PassOwnPtr.h>
namespace cc {
@@ -22,7 +22,7 @@ public:
~CCLayerTilingData();
- static PassOwnPtr<CCLayerTilingData> create(const IntSize& tileSize, BorderTexelOption);
+ static scoped_ptr<CCLayerTilingData> create(const IntSize& tileSize, BorderTexelOption);
bool hasEmptyBounds() const { return m_tilingData.hasEmptyBounds(); }
int numTilesX() const { return m_tilingData.numTilesX(); }
@@ -58,20 +58,11 @@ public:
IntRect m_opaqueRect;
DISALLOW_COPY_AND_ASSIGN(Tile);
};
- // Default hash key traits for integers disallow 0 and -1 as a key, so
- // use a custom hash trait which disallows -1 and -2 instead.
typedef std::pair<int, int> TileMapKey;
- struct TileMapKeyTraits : HashTraits<TileMapKey> {
- static const bool emptyValueIsZero = false;
- static const bool needsDestruction = false;
- static TileMapKey emptyValue() { return std::make_pair(-1, -1); }
- static void constructDeletedValue(TileMapKey& slot) { slot = std::make_pair(-2, -2); }
- static bool isDeletedValue(TileMapKey value) { return value.first == -2 && value.second == -2; }
- };
- typedef HashMap<TileMapKey, OwnPtr<Tile>, DefaultHash<TileMapKey>::Hash, TileMapKeyTraits> TileMap;
+ typedef ScopedPtrHashMap<TileMapKey, Tile> TileMap;
- void addTile(PassOwnPtr<Tile>, int, int);
- PassOwnPtr<Tile> takeTile(int, int);
+ void addTile(scoped_ptr<Tile>, int, int);
+ scoped_ptr<Tile> takeTile(int, int);
Tile* tileAt(int, int) const;
const TileMap& tiles() const { return m_tiles; }
« no previous file with comments | « cc/frame_buffer_skpicture_canvas_layer_texture_updater.cc ('k') | cc/layer_tiling_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698