Remove dead code from TiledBackingStore
authorryuan.choi@navercorp.com <ryuan.choi@navercorp.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Nov 2014 05:35:49 +0000 (05:35 +0000)
committerryuan.choi@navercorp.com <ryuan.choi@navercorp.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Nov 2014 05:35:49 +0000 (05:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138864

Reviewed by Andreas Kling.

Since r168151, paint() method, m_commitTileUpdatesOnIdleEventLoop and related code are not used.

No new tests, no behavior change.

* platform/graphics/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::TiledBackingStore):
(WebCore::TiledBackingStore::setTileSize):
(WebCore::TiledBackingStore::invalidate):
(WebCore::TiledBackingStore::createTiles):
(WebCore::TiledBackingStore::paint): Deleted.
(WebCore::TiledBackingStore::startTileBufferUpdateTimer): Deleted.
(WebCore::TiledBackingStore::tileBufferUpdateTimerFired): Deleted.
(WebCore::TiledBackingStore::startBackingStoreUpdateTimer): Deleted.
(WebCore::TiledBackingStore::backingStoreUpdateTimerFired): Deleted.
* platform/graphics/TiledBackingStore.h:
(WebCore::TiledBackingStore::setCommitTileUpdatesOnIdleEventLoop): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176381 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/TiledBackingStore.cpp
Source/WebCore/platform/graphics/TiledBackingStore.h

index f2bdae3..949d21e 100644 (file)
@@ -1,3 +1,27 @@
+2014-11-19  Ryuan Choi  <ryuan.choi@navercorp.com>
+
+        Remove dead code from TiledBackingStore
+        https://bugs.webkit.org/show_bug.cgi?id=138864
+
+        Reviewed by Andreas Kling.
+
+        Since r168151, paint() method, m_commitTileUpdatesOnIdleEventLoop and related code are not used.
+
+        No new tests, no behavior change.
+
+        * platform/graphics/TiledBackingStore.cpp:
+        (WebCore::TiledBackingStore::TiledBackingStore):
+        (WebCore::TiledBackingStore::setTileSize):
+        (WebCore::TiledBackingStore::invalidate):
+        (WebCore::TiledBackingStore::createTiles):
+        (WebCore::TiledBackingStore::paint): Deleted.
+        (WebCore::TiledBackingStore::startTileBufferUpdateTimer): Deleted.
+        (WebCore::TiledBackingStore::tileBufferUpdateTimerFired): Deleted.
+        (WebCore::TiledBackingStore::startBackingStoreUpdateTimer): Deleted.
+        (WebCore::TiledBackingStore::backingStoreUpdateTimerFired): Deleted.
+        * platform/graphics/TiledBackingStore.h:
+        (WebCore::TiledBackingStore::setCommitTileUpdatesOnIdleEventLoop): Deleted.
+
 2014-11-19  Andreas Kling  <akling@apple.com>
 
         Remove "document has no ::before and/or ::after rules" optimization.
index 04490dd..4c426c7 100644 (file)
@@ -38,12 +38,9 @@ static IntPoint innerBottomRight(const IntRect& rect)
 TiledBackingStore::TiledBackingStore(TiledBackingStoreClient* client, std::unique_ptr<TiledBackingStoreBackend> backend)
     : m_client(client)
     , m_backend(WTF::move(backend))
-    , m_tileBufferUpdateTimer(this, &TiledBackingStore::tileBufferUpdateTimerFired)
-    , m_backingStoreUpdateTimer(this, &TiledBackingStore::backingStoreUpdateTimerFired)
     , m_tileSize(defaultTileDimension, defaultTileDimension)
     , m_coverAreaMultiplier(2.0f)
     , m_contentsScale(1.f)
-    , m_commitTileUpdatesOnIdleEventLoop(false)
     , m_supportsAlpha(false)
     , m_pendingTileCreation(false)
 {
@@ -57,7 +54,6 @@ void TiledBackingStore::setTileSize(const IntSize& size)
 {
     m_tileSize = size;
     m_tiles.clear();
-    startBackingStoreUpdateTimer();
 }
 
 void TiledBackingStore::setTrajectoryVector(const FloatPoint& trajectoryVector)
@@ -97,8 +93,6 @@ void TiledBackingStore::invalidate(const IntRect& contentsDirtyRect)
             currentTile->invalidate(dirtyRect);
         }
     }
-
-    startTileBufferUpdateTimer();
 }
 
 void TiledBackingStore::updateTileBuffers()
@@ -131,37 +125,6 @@ void TiledBackingStore::updateTileBuffers()
     m_client->tiledBackingStorePaintEnd(paintedArea);
 }
 
-void TiledBackingStore::paint(GraphicsContext* context, const IntRect& rect)
-{
-    context->save();
-
-    // Assumes the backing store is painted with the scale transform applied.
-    // Since tile content is already scaled, first revert the scaling from the painter.
-    context->scale(FloatSize(1.f / m_contentsScale, 1.f / m_contentsScale));
-
-    IntRect dirtyRect = mapFromContents(rect);
-
-    Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
-    Tile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(dirtyRect));
-
-    for (int yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
-        for (int xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
-            Tile::Coordinate currentCoordinate(xCoordinate, yCoordinate);
-            RefPtr<Tile> currentTile = tileAt(currentCoordinate);
-            if (currentTile && currentTile->isReadyToPaint())
-                currentTile->paint(context, dirtyRect);
-            else {
-                IntRect tileRect = tileRectForCoordinate(currentCoordinate);
-                IntRect target = intersection(tileRect, dirtyRect);
-                if (target.isEmpty())
-                    continue;
-                m_backend->paintCheckerPattern(context, FloatRect(target));
-            }
-        }
-    }
-    context->restore();
-}
-
 IntRect TiledBackingStore::visibleRect() const
 {
     return mapFromContents(m_client->tiledBackingStoreVisibleRect());
@@ -310,15 +273,8 @@ void TiledBackingStore::createTiles()
 
     // Re-call createTiles on a timer to cover the visible area with the newest shortest distance.
     m_pendingTileCreation = requiredTileCount;
-    if (m_pendingTileCreation) {
-        if (!m_commitTileUpdatesOnIdleEventLoop) {
-            m_client->tiledBackingStoreHasPendingTileCreation();
-            return;
-        }
-
-        static const double tileCreationDelay = 0.01;
-        startBackingStoreUpdateTimer(tileCreationDelay);
-    }
+    if (m_pendingTileCreation)
+        m_client->tiledBackingStoreHasPendingTileCreation();
 }
 
 void TiledBackingStore::adjustForContentsRect(IntRect& rect) const
@@ -503,38 +459,6 @@ Tile::Coordinate TiledBackingStore::tileCoordinateForPoint(const IntPoint& point
     return Tile::Coordinate(std::max(x, 0), std::max(y, 0));
 }
 
-void TiledBackingStore::startTileBufferUpdateTimer()
-{
-    if (!m_commitTileUpdatesOnIdleEventLoop)
-        return;
-
-    if (m_tileBufferUpdateTimer.isActive())
-        return;
-    m_tileBufferUpdateTimer.startOneShot(0);
-}
-
-void TiledBackingStore::tileBufferUpdateTimerFired(Timer*)
-{
-    ASSERT(m_commitTileUpdatesOnIdleEventLoop);
-    updateTileBuffers();
-}
-
-void TiledBackingStore::startBackingStoreUpdateTimer(double interval)
-{
-    if (!m_commitTileUpdatesOnIdleEventLoop)
-        return;
-
-    if (m_backingStoreUpdateTimer.isActive())
-        return;
-    m_backingStoreUpdateTimer.startOneShot(interval);
-}
-
-void TiledBackingStore::backingStoreUpdateTimerFired(Timer*)
-{
-    ASSERT(m_commitTileUpdatesOnIdleEventLoop);
-    createTiles();
-}
-
 void TiledBackingStore::setSupportsAlpha(bool a)
 {
     if (a == m_supportsAlpha)
index 5693eb7..eab16f5 100644 (file)
@@ -46,10 +46,6 @@ public:
 
     TiledBackingStoreClient* client() { return m_client; }
 
-    // Used when class methods cannot be called asynchronously by client.
-    // Updates of tiles are committed as soon as all the events in event queue have been processed.
-    void setCommitTileUpdatesOnIdleEventLoop(bool enable) { m_commitTileUpdatesOnIdleEventLoop = enable; }
-
     void setTrajectoryVector(const FloatPoint&);
     void coverWithTilesIfNeeded();
 
@@ -59,7 +55,6 @@ public:
     void updateTileBuffers();
 
     void invalidate(const IntRect& dirtyRect);
-    void paint(GraphicsContext*, const IntRect&);
 
     IntSize tileSize() { return m_tileSize; }
     void setTileSize(const IntSize&);
@@ -78,12 +73,6 @@ public:
     void setSupportsAlpha(bool);
 
 private:
-    void startTileBufferUpdateTimer();
-    void startBackingStoreUpdateTimer(double = 0);
-
-    void tileBufferUpdateTimerFired(Timer*);
-    void backingStoreUpdateTimerFired(Timer*);
-
     void createTiles();
     void computeCoverAndKeepRect(const IntRect& visibleRect, IntRect& coverRect, IntRect& keepRect) const;
 
@@ -109,9 +98,6 @@ private:
     typedef HashMap<Tile::Coordinate, RefPtr<Tile> > TileMap;
     TileMap m_tiles;
 
-    Timer m_tileBufferUpdateTimer;
-    Timer m_backingStoreUpdateTimer;
-
     IntSize m_tileSize;
     float m_coverAreaMultiplier;
 
@@ -125,7 +111,6 @@ private:
 
     float m_contentsScale;
 
-    bool m_commitTileUpdatesOnIdleEventLoop;
     bool m_supportsAlpha;
     bool m_pendingTileCreation;