Commit 6c1133d4 authored by jae.park@company100.net's avatar jae.park@company100.net
Browse files

[CoordinatedGraphics] Use std::unique_ptrs rather than OwnPtrs

https://bugs.webkit.org/show_bug.cgi?id=124692

Reviewed by Noam Rosenthal.

No new tests, covered by existing ones.

* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
* platform/graphics/TiledBackingStore.h:
* platform/graphics/TiledBackingStoreBackend.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::createBackingStore):
* platform/graphics/texmap/coordinated/CoordinatedTile.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7e710c2c
2013-11-20 Jae Hyun Park <jae.park@company100.net>
[CoordinatedGraphics] Use std::unique_ptrs rather than OwnPtrs
https://bugs.webkit.org/show_bug.cgi?id=124692
Reviewed by Noam Rosenthal.
No new tests, covered by existing ones.
* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
* platform/graphics/TiledBackingStore.h:
* platform/graphics/TiledBackingStoreBackend.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::createBackingStore):
* platform/graphics/texmap/coordinated/CoordinatedTile.h:
2013-11-20 Brady Eidson <beidson@apple.com>
 
Add more infrastructure for ServerConnection communication between Web and Database processes
......@@ -35,9 +35,9 @@ static IntPoint innerBottomRight(const IntRect& rect)
return IntPoint(rect.maxX() - 1, rect.maxY() - 1);
}
TiledBackingStore::TiledBackingStore(TiledBackingStoreClient* client, PassOwnPtr<TiledBackingStoreBackend> backend)
TiledBackingStore::TiledBackingStore(TiledBackingStoreClient* client, std::unique_ptr<TiledBackingStoreBackend> backend)
: m_client(client)
, m_backend(backend)
, m_backend(std::move(backend))
, m_tileBufferUpdateTimer(this, &TiledBackingStore::tileBufferUpdateTimerFired)
, m_backingStoreUpdateTimer(this, &TiledBackingStore::backingStoreUpdateTimerFired)
, m_tileSize(defaultTileDimension, defaultTileDimension)
......
......@@ -41,7 +41,7 @@ class TiledBackingStoreClient;
class TiledBackingStore {
WTF_MAKE_NONCOPYABLE(TiledBackingStore); WTF_MAKE_FAST_ALLOCATED;
public:
TiledBackingStore(TiledBackingStoreClient*, PassOwnPtr<TiledBackingStoreBackend> = TiledBackingStoreBackend::create());
TiledBackingStore(TiledBackingStoreClient*, std::unique_ptr<TiledBackingStoreBackend> = std::make_unique<TiledBackingStoreBackend>());
~TiledBackingStore();
TiledBackingStoreClient* client() { return m_client; }
......@@ -112,7 +112,7 @@ private:
private:
TiledBackingStoreClient* m_client;
OwnPtr<TiledBackingStoreBackend> m_backend;
std::unique_ptr<TiledBackingStoreBackend> m_backend;
typedef HashMap<Tile::Coordinate, RefPtr<Tile> > TileMap;
TileMap m_tiles;
......
......@@ -28,18 +28,13 @@
namespace WebCore {
class TiledBackingStore;
class TiledBackingStoreBackend;
class TiledBackingStoreBackend {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<TiledBackingStoreBackend> create() { return adoptPtr(new TiledBackingStoreBackend); }
virtual ~TiledBackingStoreBackend() { }
virtual PassRefPtr<Tile> createTile(TiledBackingStore*, const Tile::Coordinate&);
virtual void paintCheckerPattern(GraphicsContext*, const FloatRect&);
protected:
TiledBackingStoreBackend() { }
};
}
......
......@@ -893,7 +893,7 @@ void CoordinatedGraphicsLayer::adjustContentsScale()
void CoordinatedGraphicsLayer::createBackingStore()
{
m_mainBackingStore = std::make_unique<TiledBackingStore>(this, CoordinatedTileBackend::create(this));
m_mainBackingStore = std::make_unique<TiledBackingStore>(this, std::make_unique<CoordinatedTileBackend>(this));
m_mainBackingStore->setSupportsAlpha(!contentsOpaque());
m_mainBackingStore->setContentsScale(effectiveContentsScale());
}
......
......@@ -81,12 +81,11 @@ public:
class CoordinatedTileBackend : public TiledBackingStoreBackend {
public:
static PassOwnPtr<TiledBackingStoreBackend> create(CoordinatedTileClient* client) { return adoptPtr(new CoordinatedTileBackend(client)); }
explicit CoordinatedTileBackend(CoordinatedTileClient*);
PassRefPtr<Tile> createTile(TiledBackingStore*, const Tile::Coordinate&);
void paintCheckerPattern(GraphicsContext*, const FloatRect&);
private:
explicit CoordinatedTileBackend(CoordinatedTileClient*);
CoordinatedTileClient* m_client;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment