Changeset 102738 in webkit


Ignore:
Timestamp:
Dec 13, 2011 9:19:46 PM (12 years ago)
Author:
jamesr@google.com
Message:

Unreviewed, rolling out r102726.
http://trac.webkit.org/changeset/102726
https://bugs.webkit.org/show_bug.cgi?id=74154

Does not compile on clang

  • platform/graphics/chromium/TiledLayerChromium.cpp:

(WebCore::UpdatableTile::UpdatableTile):
(WebCore::TiledLayerChromium::createTile):

  • platform/graphics/chromium/cc/CCLayerTilingData.cpp:

(WebCore::CCLayerTilingData::addTile):
(WebCore::CCLayerTilingData::takeTile):
(WebCore::CCLayerTilingData::tileAt):

  • platform/graphics/chromium/cc/CCLayerTilingData.h:
  • platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:

(WebCore::DrawableTile::DrawableTile):
(WebCore::CCTiledLayerImpl::createTile):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r102735 r102738  
     12011-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
    1212011-12-13  Hajime Morrita  <morrita@chromium.org>
    222
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

    r102726 r102738  
    5353    WTF_MAKE_NONCOPYABLE(UpdatableTile);
    5454public:
    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) { }
    5956
    6057    LayerTextureUpdater::Texture* texture() { return m_texture.get(); }
     
    6966    IntRect m_updateRect;
    7067private:
    71     explicit UpdatableTile(PassOwnPtr<LayerTextureUpdater::Texture> texture) : m_texture(texture) { }
    72 
    7368    OwnPtr<LayerTextureUpdater::Texture> m_texture;
    7469};
     
    284279UpdatableTile* TiledLayerChromium::createTile(int i, int j)
    285280{
    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();
    292286}
    293287
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.cpp

    r102726 r102738  
    6666}
    6767
    68 void CCLayerTilingData::addTile(PassOwnPtr<Tile> tile, int i, int j)
     68void CCLayerTilingData::addTile(PassRefPtr<Tile> tile, int i, int j)
    6969{
    7070    ASSERT(!tileAt(i, j));
     
    7373}
    7474
    75 PassOwnPtr<CCLayerTilingData::Tile> CCLayerTilingData::takeTile(int i, int j)
     75PassRefPtr<CCLayerTilingData::Tile> CCLayerTilingData::takeTile(int i, int j)
    7676{
    7777    return m_tiles.take(make_pair(i, j));
     
    8080CCLayerTilingData::Tile* CCLayerTilingData::tileAt(int i, int j) const
    8181{
    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;
    8385}
    8486
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTilingData.h

    r102735 r102738  
    3535#include <wtf/HashTraits.h>
    3636#include <wtf/PassOwnPtr.h>
     37#include <wtf/RefCounted.h>
    3738
    3839namespace WebCore {
     
    6263    const CCLayerTilingData& operator=(const CCLayerTilingData&);
    6364
    64     class Tile {
     65    class Tile: public RefCounted<Tile> {
    6566        WTF_MAKE_NONCOPYABLE(Tile);
    6667    public:
     
    8586        static bool isDeletedValue(TileMapKey value) { return value.first == -2 && value.second == -2; }
    8687    };
    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;
    8892
    89     void addTile(PassOwnPtr<Tile>, int, int);
    90     PassOwnPtr<Tile> takeTile(int, int);
     93    void addTile(PassRefPtr<Tile>, int, int);
     94    PassRefPtr<Tile> takeTile(int, int);
    9195    Tile* tileAt(int, int) const;
    9296    const TileMap& tiles() const { return m_tiles; }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp

    r102726 r102738  
    4343    WTF_MAKE_NONCOPYABLE(DrawableTile);
    4444public:
    45     static PassOwnPtr<DrawableTile> create() { return adoptPtr(new DrawableTile()); }
     45    DrawableTile() : m_textureId(0) { }
    4646
    4747    Platform3DObject textureId() const { return m_textureId; }
    4848    void setTextureId(Platform3DObject textureId) { m_textureId = textureId; }
    4949private:
    50     DrawableTile() : m_textureId(0) { }
    51 
    5250    Platform3DObject m_textureId;
    5351};
     
    9593DrawableTile* CCTiledLayerImpl::createTile(int i, int j)
    9694{
    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();
    10198}
    10299
Note: See TracChangeset for help on using the changeset viewer.