Changeset 176381 in webkit
- Timestamp:
- Nov 19, 2014 9:35:49 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r176373 r176381 1 2014-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 1 25 2014-11-19 Andreas Kling <akling@apple.com> 2 26 -
trunk/Source/WebCore/platform/graphics/TiledBackingStore.cpp
r175719 r176381 39 39 : m_client(client) 40 40 , m_backend(WTF::move(backend)) 41 , m_tileBufferUpdateTimer(this, &TiledBackingStore::tileBufferUpdateTimerFired)42 , m_backingStoreUpdateTimer(this, &TiledBackingStore::backingStoreUpdateTimerFired)43 41 , m_tileSize(defaultTileDimension, defaultTileDimension) 44 42 , m_coverAreaMultiplier(2.0f) 45 43 , m_contentsScale(1.f) 46 , m_commitTileUpdatesOnIdleEventLoop(false)47 44 , m_supportsAlpha(false) 48 45 , m_pendingTileCreation(false) … … 58 55 m_tileSize = size; 59 56 m_tiles.clear(); 60 startBackingStoreUpdateTimer();61 57 } 62 58 … … 98 94 } 99 95 } 100 101 startTileBufferUpdateTimer();102 96 } 103 97 … … 130 124 131 125 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();163 126 } 164 127 … … 311 274 // Re-call createTiles on a timer to cover the visible area with the newest shortest distance. 312 275 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(); 322 278 } 323 279 … … 504 460 } 505 461 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 538 462 void TiledBackingStore::setSupportsAlpha(bool a) 539 463 { -
trunk/Source/WebCore/platform/graphics/TiledBackingStore.h
r175719 r176381 47 47 TiledBackingStoreClient* client() { return m_client; } 48 48 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 53 49 void setTrajectoryVector(const FloatPoint&); 54 50 void coverWithTilesIfNeeded(); … … 60 56 61 57 void invalidate(const IntRect& dirtyRect); 62 void paint(GraphicsContext*, const IntRect&);63 58 64 59 IntSize tileSize() { return m_tileSize; } … … 79 74 80 75 private: 81 void startTileBufferUpdateTimer();82 void startBackingStoreUpdateTimer(double = 0);83 84 void tileBufferUpdateTimerFired(Timer*);85 void backingStoreUpdateTimerFired(Timer*);86 87 76 void createTiles(); 88 77 void computeCoverAndKeepRect(const IntRect& visibleRect, IntRect& coverRect, IntRect& keepRect) const; … … 110 99 TileMap m_tiles; 111 100 112 Timer m_tileBufferUpdateTimer;113 Timer m_backingStoreUpdateTimer;114 115 101 IntSize m_tileSize; 116 102 float m_coverAreaMultiplier; … … 126 112 float m_contentsScale; 127 113 128 bool m_commitTileUpdatesOnIdleEventLoop;129 114 bool m_supportsAlpha; 130 115 bool m_pendingTileCreation;
Note: See TracChangeset
for help on using the changeset viewer.