Title: [225111] trunk/Source/WebCore
- Revision
- 225111
- Author
- zandober...@gmail.com
- Date
- 2017-11-23 03:00:32 -0800 (Thu, 23 Nov 2017)
Log Message
[CoordGraphics] Early tile buffer update in TiledBackingStore::createTiles() is unnecessary
https://bugs.webkit.org/show_bug.cgi?id=179968
Reviewed by Carlos Garcia Campos.
Under CoordinatedGraphicsLayer::updateContentBuffers(), the TiledBackingStore
object has the createTilesIfNeeded() method invoked, if necessary. This
invokes createTiles(), where the edge tiles are resized if necessary, and
the missing tiles are created. If any of those two cases is fulfilled, the
updateTileBuffers() method is invoked, updating any dirty tiles (i.e. the
ones that were resized or newly-created).
This specific invocation of updateTileBuffers() is not needed since it's the
very next method that's invoked on the TiledBackingStore object by
CoordinatedGraphicsLayer::updateContentBuffers(). It's therefore removed,
and the resizeEdgeTiles() method is changed to not return any value.
No new tests -- no change in behavior.
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::createTiles):
(WebCore::TiledBackingStore::resizeEdgeTiles):
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (225110 => 225111)
--- trunk/Source/WebCore/ChangeLog 2017-11-23 10:45:26 UTC (rev 225110)
+++ trunk/Source/WebCore/ChangeLog 2017-11-23 11:00:32 UTC (rev 225111)
@@ -1,3 +1,29 @@
+2017-11-23 Zan Dobersek <zdober...@igalia.com>
+
+ [CoordGraphics] Early tile buffer update in TiledBackingStore::createTiles() is unnecessary
+ https://bugs.webkit.org/show_bug.cgi?id=179968
+
+ Reviewed by Carlos Garcia Campos.
+
+ Under CoordinatedGraphicsLayer::updateContentBuffers(), the TiledBackingStore
+ object has the createTilesIfNeeded() method invoked, if necessary. This
+ invokes createTiles(), where the edge tiles are resized if necessary, and
+ the missing tiles are created. If any of those two cases is fulfilled, the
+ updateTileBuffers() method is invoked, updating any dirty tiles (i.e. the
+ ones that were resized or newly-created).
+
+ This specific invocation of updateTileBuffers() is not needed since it's the
+ very next method that's invoked on the TiledBackingStore object by
+ CoordinatedGraphicsLayer::updateContentBuffers(). It's therefore removed,
+ and the resizeEdgeTiles() method is changed to not return any value.
+
+ No new tests -- no change in behavior.
+
+ * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
+ (WebCore::TiledBackingStore::createTiles):
+ (WebCore::TiledBackingStore::resizeEdgeTiles):
+ * platform/graphics/texmap/coordinated/TiledBackingStore.h:
+
2017-11-23 Antti Koivisto <an...@apple.com>
RenderBlockFlow::layoutRunsAndFloatsInRange is O(n^2) for runs of inlines without any text
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp (225110 => 225111)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp 2017-11-23 10:45:26 UTC (rev 225110)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.cpp 2017-11-23 11:00:32 UTC (rev 225111)
@@ -191,9 +191,8 @@
// Resize tiles at the edge in case the contents size has changed, but only do so
// after having dropped tiles outside the keep rect.
- bool didResizeTiles = false;
if (previousRect != m_rect)
- didResizeTiles = resizeEdgeTiles();
+ resizeEdgeTiles();
// Search for the tile position closest to the viewport center that does not yet contain a tile.
// Which position is considered the closest depends on the tileDistance function.
@@ -231,10 +230,6 @@
}
requiredTileCount -= tilesToCreateCount;
- // Paint the content of the newly created tiles or resized tiles.
- if (tilesToCreateCount || didResizeTiles)
- updateTileBuffers();
-
// Re-call createTiles on a timer to cover the visible area with the newest shortest distance.
m_pendingTileCreation = requiredTileCount;
if (m_pendingTileCreation)
@@ -328,9 +323,8 @@
ASSERT(coverRect.isEmpty() || keepRect.contains(coverRect));
}
-bool TiledBackingStore::resizeEdgeTiles()
+void TiledBackingStore::resizeEdgeTiles()
{
- bool wasResized = false;
Vector<Tile::Coordinate> tilesToRemove;
for (auto& tile : m_tiles.values()) {
Tile::Coordinate tileCoordinate = tile->coordinate();
@@ -338,16 +332,12 @@
IntRect expectedTileRect = tileRectForCoordinate(tileCoordinate);
if (expectedTileRect.isEmpty())
tilesToRemove.append(tileCoordinate);
- else if (expectedTileRect != tileRect) {
+ else if (expectedTileRect != tileRect)
tile->resize(expectedTileRect.size());
- wasResized = true;
- }
}
for (auto& coordinateToRemove : tilesToRemove)
m_tiles.remove(coordinateToRemove);
-
- return wasResized;
}
void TiledBackingStore::setKeepRect(const IntRect& keepRect)
Modified: trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.h (225110 => 225111)
--- trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.h 2017-11-23 10:45:26 UTC (rev 225110)
+++ trunk/Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStore.h 2017-11-23 11:00:32 UTC (rev 225111)
@@ -68,7 +68,7 @@
void createTiles(const IntRect& visibleRect, const IntRect& scaledContentsRect, float coverAreaMultiplier);
void computeCoverAndKeepRect(const IntRect& visibleRect, IntRect& coverRect, IntRect& keepRect) const;
- bool resizeEdgeTiles();
+ void resizeEdgeTiles();
void setCoverRect(const IntRect& rect) { m_coverRect = rect; }
void setKeepRect(const IntRect&);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes