Changeset 102738 in webkit
- Timestamp:
- Dec 13, 2011 9:19:46 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102735 r102738 1 2011-12-13 James Robinson <jamesr@chromium.org> 2 3 Unreviewed, rolling out r102726. 4 http://trac.webkit.org/changeset/102726 5 https://bugs.webkit.org/show_bug.cgi?id=74154 6 7 Does not compile on clang 8 9 * platform/graphics/chromium/TiledLayerChromium.cpp: 10 (WebCore::UpdatableTile::UpdatableTile): 11 (WebCore::TiledLayerChromium::createTile): 12 * platform/graphics/chromium/cc/CCLayerTilingData.cpp: 13 (WebCore::CCLayerTilingData::addTile): 14 (WebCore::CCLayerTilingData::takeTile): 15 (WebCore::CCLayerTilingData::tileAt): 16 * platform/graphics/chromium/cc/CCLayerTilingData.h: 17 * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: 18 (WebCore::DrawableTile::DrawableTile): 19 (WebCore::CCTiledLayerImpl::createTile): 20 1 21 2011-12-13 Hajime Morrita <morrita@chromium.org> 2 22 -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r102726 r102738 53 53 WTF_MAKE_NONCOPYABLE(UpdatableTile); 54 54 public: 55 static PassOwnPtr<UpdatableTile> create(PassOwnPtr<LayerTextureUpdater::Texture> texture) 56 { 57 return adoptPtr(new UpdatableTile(texture)); 58 } 55 explicit UpdatableTile(PassOwnPtr<LayerTextureUpdater::Texture> texture) : m_texture(texture) { } 59 56 60 57 LayerTextureUpdater::Texture* texture() { return m_texture.get(); } … … 69 66 IntRect m_updateRect; 70 67 private: 71 explicit UpdatableTile(PassOwnPtr<LayerTextureUpdater::Texture> texture) : m_texture(texture) { }72 73 68 OwnPtr<LayerTextureUpdater::Texture> m_texture; 74 69 }; … … 284 279 UpdatableTile* TiledLayerChromium::createTile(int i, int j) 285 280 { 286 OwnPtr<UpdatableTile> tile(UpdatableTile::create(textureUpdater()->createTexture(textureManager()))); 287 UpdatableTile* addedTile = tile.get(); 288 m_tiler->addTile(tile.release(), i, j); 289 290 addedTile->m_dirtyLayerRect = m_tiler->tileLayerRect(addedTile); 291 return addedTile; 281 RefPtr<UpdatableTile> tile = adoptRef(new UpdatableTile(textureUpdater()->createTexture(textureManager()))); 282 m_tiler->addTile(tile, i, j); 283 tile->m_dirtyLayerRect = m_tiler->tileLayerRect(tile.get()); 284 285 return tile.get(); 292 286 } 293 287 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp
r102726 r102738 66 66 } 67 67 68 void CCLayerTilingData::addTile(Pass OwnPtr<Tile> tile, int i, int j)68 void CCLayerTilingData::addTile(PassRefPtr<Tile> tile, int i, int j) 69 69 { 70 70 ASSERT(!tileAt(i, j)); … … 73 73 } 74 74 75 Pass OwnPtr<CCLayerTilingData::Tile> CCLayerTilingData::takeTile(int i, int j)75 PassRefPtr<CCLayerTilingData::Tile> CCLayerTilingData::takeTile(int i, int j) 76 76 { 77 77 return m_tiles.take(make_pair(i, j)); … … 80 80 CCLayerTilingData::Tile* CCLayerTilingData::tileAt(int i, int j) const 81 81 { 82 return m_tiles.get(make_pair(i, j)); 82 Tile* tile = m_tiles.get(make_pair(i, j)).get(); 83 ASSERT(!tile || tile->refCount() == 1); 84 return tile; 83 85 } 84 86 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h
r102735 r102738 35 35 #include <wtf/HashTraits.h> 36 36 #include <wtf/PassOwnPtr.h> 37 #include <wtf/RefCounted.h> 37 38 38 39 namespace WebCore { … … 62 63 const CCLayerTilingData& operator=(const CCLayerTilingData&); 63 64 64 class Tile {65 class Tile: public RefCounted<Tile> { 65 66 WTF_MAKE_NONCOPYABLE(Tile); 66 67 public: … … 85 86 static bool isDeletedValue(TileMapKey value) { return value.first == -2 && value.second == -2; } 86 87 }; 87 typedef HashMap<TileMapKey, OwnPtr<Tile>, DefaultHash<TileMapKey>::Hash, TileMapKeyTraits> TileMap; 88 // FIXME: The mapped value in TileMap should really be an OwnPtr, as the 89 // refcount of a Tile should never be more than 1. However, HashMap 90 // doesn't easily support OwnPtr as a value. 91 typedef HashMap<TileMapKey, RefPtr<Tile>, DefaultHash<TileMapKey>::Hash, TileMapKeyTraits> TileMap; 88 92 89 void addTile(Pass OwnPtr<Tile>, int, int);90 Pass OwnPtr<Tile> takeTile(int, int);93 void addTile(PassRefPtr<Tile>, int, int); 94 PassRefPtr<Tile> takeTile(int, int); 91 95 Tile* tileAt(int, int) const; 92 96 const TileMap& tiles() const { return m_tiles; } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
r102726 r102738 43 43 WTF_MAKE_NONCOPYABLE(DrawableTile); 44 44 public: 45 static PassOwnPtr<DrawableTile> create() { return adoptPtr(new DrawableTile());}45 DrawableTile() : m_textureId(0) { } 46 46 47 47 Platform3DObject textureId() const { return m_textureId; } 48 48 void setTextureId(Platform3DObject textureId) { m_textureId = textureId; } 49 49 private: 50 DrawableTile() : m_textureId(0) { }51 52 50 Platform3DObject m_textureId; 53 51 }; … … 95 93 DrawableTile* CCTiledLayerImpl::createTile(int i, int j) 96 94 { 97 OwnPtr<DrawableTile> tile(DrawableTile::create()); 98 DrawableTile* addedTile = tile.get(); 99 m_tiler->addTile(tile.release(), i, j); 100 return addedTile; 95 RefPtr<DrawableTile> tile = adoptRef(new DrawableTile()); 96 m_tiler->addTile(tile, i, j); 97 return tile.get(); 101 98 } 102 99
Note: See TracChangeset
for help on using the changeset viewer.