Changeset 176381 in webkit


Ignore:
Timestamp:
Nov 19, 2014 9:35:49 PM (9 years ago)
Author:
ryuan.choi@navercorp.com
Message:

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.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176373 r176381  
     12014-11-19  Ryuan Choi  <ryuan.choi@navercorp.com>
     2
     3        Remove dead code from TiledBackingStore
     4        https://bugs.webkit.org/show_bug.cgi?id=138864
     5
     6        Reviewed by Andreas Kling.
     7
     8        Since r168151, paint() method, m_commitTileUpdatesOnIdleEventLoop and related code are not used.
     9
     10        No new tests, no behavior change.
     11
     12        * platform/graphics/TiledBackingStore.cpp:
     13        (WebCore::TiledBackingStore::TiledBackingStore):
     14        (WebCore::TiledBackingStore::setTileSize):
     15        (WebCore::TiledBackingStore::invalidate):
     16        (WebCore::TiledBackingStore::createTiles):
     17        (WebCore::TiledBackingStore::paint): Deleted.
     18        (WebCore::TiledBackingStore::startTileBufferUpdateTimer): Deleted.
     19        (WebCore::TiledBackingStore::tileBufferUpdateTimerFired): Deleted.
     20        (WebCore::TiledBackingStore::startBackingStoreUpdateTimer): Deleted.
     21        (WebCore::TiledBackingStore::backingStoreUpdateTimerFired): Deleted.
     22        * platform/graphics/TiledBackingStore.h:
     23        (WebCore::TiledBackingStore::setCommitTileUpdatesOnIdleEventLoop): Deleted.
     24
    1252014-11-19  Andreas Kling  <akling@apple.com>
    226
  • trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp

    r175719 r176381  
    3939    : m_client(client)
    4040    , m_backend(WTF::move(backend))
    41     , m_tileBufferUpdateTimer(this, &TiledBackingStore::tileBufferUpdateTimerFired)
    42     , m_backingStoreUpdateTimer(this, &TiledBackingStore::backingStoreUpdateTimerFired)
    4341    , m_tileSize(defaultTileDimension, defaultTileDimension)
    4442    , m_coverAreaMultiplier(2.0f)
    4543    , m_contentsScale(1.f)
    46     , m_commitTileUpdatesOnIdleEventLoop(false)
    4744    , m_supportsAlpha(false)
    4845    , m_pendingTileCreation(false)
     
    5855    m_tileSize = size;
    5956    m_tiles.clear();
    60     startBackingStoreUpdateTimer();
    6157}
    6258
     
    9894        }
    9995    }
    100 
    101     startTileBufferUpdateTimer();
    10296}
    10397
     
    130124
    131125    m_client->tiledBackingStorePaintEnd(paintedArea);
    132 }
    133 
    134 void TiledBackingStore::paint(GraphicsContext* context, const IntRect& rect)
    135 {
    136     context->save();
    137 
    138     // Assumes the backing store is painted with the scale transform applied.
    139     // Since tile content is already scaled, first revert the scaling from the painter.
    140     context->scale(FloatSize(1.f / m_contentsScale, 1.f / m_contentsScale));
    141 
    142     IntRect dirtyRect = mapFromContents(rect);
    143 
    144     Tile::Coordinate topLeft = tileCoordinateForPoint(dirtyRect.location());
    145     Tile::Coordinate bottomRight = tileCoordinateForPoint(innerBottomRight(dirtyRect));
    146 
    147     for (int yCoordinate = topLeft.y(); yCoordinate <= bottomRight.y(); ++yCoordinate) {
    148         for (int xCoordinate = topLeft.x(); xCoordinate <= bottomRight.x(); ++xCoordinate) {
    149             Tile::Coordinate currentCoordinate(xCoordinate, yCoordinate);
    150             RefPtr<Tile> currentTile = tileAt(currentCoordinate);
    151             if (currentTile && currentTile->isReadyToPaint())
    152                 currentTile->paint(context, dirtyRect);
    153             else {
    154                 IntRect tileRect = tileRectForCoordinate(currentCoordinate);
    155                 IntRect target = intersection(tileRect, dirtyRect);
    156                 if (target.isEmpty())
    157                     continue;
    158                 m_backend->paintCheckerPattern(context, FloatRect(target));
    159             }
    160         }
    161     }
    162     context->restore();
    163126}
    164127
     
    311274    // Re-call createTiles on a timer to cover the visible area with the newest shortest distance.
    312275    m_pendingTileCreation = requiredTileCount;
    313     if (m_pendingTileCreation) {
    314         if (!m_commitTileUpdatesOnIdleEventLoop) {
    315             m_client->tiledBackingStoreHasPendingTileCreation();
    316             return;
    317         }
    318 
    319         static const double tileCreationDelay = 0.01;
    320         startBackingStoreUpdateTimer(tileCreationDelay);
    321     }
     276    if (m_pendingTileCreation)
     277        m_client->tiledBackingStoreHasPendingTileCreation();
    322278}
    323279
     
    504460}
    505461
    506 void TiledBackingStore::startTileBufferUpdateTimer()
    507 {
    508     if (!m_commitTileUpdatesOnIdleEventLoop)
    509         return;
    510 
    511     if (m_tileBufferUpdateTimer.isActive())
    512         return;
    513     m_tileBufferUpdateTimer.startOneShot(0);
    514 }
    515 
    516 void TiledBackingStore::tileBufferUpdateTimerFired(Timer*)
    517 {
    518     ASSERT(m_commitTileUpdatesOnIdleEventLoop);
    519     updateTileBuffers();
    520 }
    521 
    522 void TiledBackingStore::startBackingStoreUpdateTimer(double interval)
    523 {
    524     if (!m_commitTileUpdatesOnIdleEventLoop)
    525         return;
    526 
    527     if (m_backingStoreUpdateTimer.isActive())
    528         return;
    529     m_backingStoreUpdateTimer.startOneShot(interval);
    530 }
    531 
    532 void TiledBackingStore::backingStoreUpdateTimerFired(Timer*)
    533 {
    534     ASSERT(m_commitTileUpdatesOnIdleEventLoop);
    535     createTiles();
    536 }
    537 
    538462void TiledBackingStore::setSupportsAlpha(bool a)
    539463{
  • trunk/Source/WebCore/platform/graphics/TiledBackingStore.h

    r175719 r176381  
    4747    TiledBackingStoreClient* client() { return m_client; }
    4848
    49     // Used when class methods cannot be called asynchronously by client.
    50     // Updates of tiles are committed as soon as all the events in event queue have been processed.
    51     void setCommitTileUpdatesOnIdleEventLoop(bool enable) { m_commitTileUpdatesOnIdleEventLoop = enable; }
    52 
    5349    void setTrajectoryVector(const FloatPoint&);
    5450    void coverWithTilesIfNeeded();
     
    6056
    6157    void invalidate(const IntRect& dirtyRect);
    62     void paint(GraphicsContext*, const IntRect&);
    6358
    6459    IntSize tileSize() { return m_tileSize; }
     
    7974
    8075private:
    81     void startTileBufferUpdateTimer();
    82     void startBackingStoreUpdateTimer(double = 0);
    83 
    84     void tileBufferUpdateTimerFired(Timer*);
    85     void backingStoreUpdateTimerFired(Timer*);
    86 
    8776    void createTiles();
    8877    void computeCoverAndKeepRect(const IntRect& visibleRect, IntRect& coverRect, IntRect& keepRect) const;
     
    11099    TileMap m_tiles;
    111100
    112     Timer m_tileBufferUpdateTimer;
    113     Timer m_backingStoreUpdateTimer;
    114 
    115101    IntSize m_tileSize;
    116102    float m_coverAreaMultiplier;
     
    126112    float m_contentsScale;
    127113
    128     bool m_commitTileUpdatesOnIdleEventLoop;
    129114    bool m_supportsAlpha;
    130115    bool m_pendingTileCreation;
Note: See TracChangeset for help on using the changeset viewer.