WebKit GIT trees - WebKit-https.git/rss - Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStoreClient.h historyhttp://git.webkit.org/?p=WebKit-https.git;a=history;f=Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStoreClient.h
Mirror of the WebKit open source project from svn.webkit.org.enJon Davis/static/git-logo.pngWebKit GIT trees - WebKit-https.git/rss - Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStoreClient.h historyhttp://git.webkit.org/?p=WebKit-https.git;a=history;f=Source/WebCore/platform/graphics/texmap/coordinated/TiledBackingStoreClient.h
Thu, 23 Nov 2017 14:19:52 +0000Thu, 23 Nov 2017 14:19:52 +0000gitweb v.1.8.3.1/1.8.3.1[CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updateszandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>Thu, 23 Nov 2017 14:19:52 +0000http://git.webkit.org/?p=WebKit-https.git;a=commitdiff;h=80a6d6b482c39b25c923465a24261fc334daefc7http://git.webkit.org/?p=WebKit-https.git;a=commitdiff;h=80a6d6b482c39b25c923465a24261fc334daefc7
[CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
[CoordGraphics] Simplify CoordinatedGraphicsLayer's content buffer updates
https://bugs.webkit.org/show_bug.cgi?id=179972
Reviewed by Carlos Garcia Campos.
Source/WebCore:
During layer flushes, when a CoordinatedGraphicsLayer's tiled backing store
has dirty tiles that need to be updated, the following chain of calls would
be invoked to perform the painting, starting in
CoordinatedGraphicsLayer::updateContentBuffers():
|- CoordinatedGraphicsLayer::updateContentBuffers()
|- TiledBackingStore::updateTileBuffers()
|- Tile::updateBackBuffer()
|- CoordinatedGraphicsLayer::paintToSurface()
|- CompositingCoordinator::paintToSurface()
|- UpdateAtlas::paintOnAvailableBuffer()
|- ThreadSafeCoordinatedSurface::paintToSurface()
|- Tile::paintToSurfaceContext()
|- CoordinatedGraphicsLayer::tiledBackingStorePaint()
|- GraphicsLayer::paintGraphicsLayerContents()
That's a bit much.
In CoordinatedGraphicsLayer::updateContentBuffers(), we now first retrieve
all the dirty layers in our TiledBackingStore. We then iterate through them,
first establishing their ID and then retrieving an available CoordinatedBuffer
that we can use for painting. The CoordinatedBuffer is retrieved through
CompositingCoordinator, which is still caching these buffers via UpdateAtlas
objects.
With a CoordinatedBuffer available, we can then proceed with painting. The
painting context has to be properly set up to paint into the correct area of
the given buffer, and the alpha channel, if necessary, has to be addressed.
After properly positioning and scaling ourselves on the given context, we
can proceed with the GraphicsLayer::paintGraphicsLayerContents() call.
What's left is filling out the missing SurfaceUpdateInfo information which is
then passed to the updateTile() method that properly registers the tile
update we've just performed. The tile itself is marked clean. After the
iteration, we call the didUpdateTileBuffers() method in case any successful
tile update was indeed performed, incrementing the repaint counter.
That's it -- we clipped 8 calls from the call chain. We can now also remove
the CoordinatedBuffer::Client interface, as well as slim down the
TiledBackingStore interface. The Tile class is cleaned up a bit, with methods
shifted into a more sensible order.
No new tests -- no change in functionality.
* platform/graphics/texmap/coordinated/CoordinatedBuffer.cpp:
* platform/graphics/texmap/coordinated/CoordinatedBuffer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
(WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaint): Deleted.
(WebCore::CoordinatedGraphicsLayer::paintToSurface): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/Tile.cpp:
(WebCore::Tile::ensureTileID):
(WebCore::Tile::isDirty const):
(WebCore::Tile::invalidate):
(WebCore::Tile::markClean):
(WebCore::Tile::updateBackBuffer): Deleted.
(WebCore::Tile::paintToSurfaceContext): Deleted.
* platform/graphics/texmap/coordinated/Tile.h:
(WebCore::Tile::tileID const):
(WebCore::Tile::dirtyRect const):
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::dirtyTiles):
(WebCore::TiledBackingStore::updateTileBuffers): Deleted.
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
* platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
Source/WebKit:
In CompositingCoordinator, add the getCoordinatedBuffer() method, replacing
paintToSurface(). The new method traverses the list of UpdateAtlases and
returns any CoordinatedBuffer object that was free to use. If none exist,
a new UpdateAtlas object is created, and its CoordinatedBuffer is returned.
In UpdateAtlas, the paintOnAvailableBuffer() method is replaced with
getCoordinatedBuffer(). The latter allocates the necessary area but then
returns a reference to the CoordinatedBuffer buffer, along with the atlas ID
and the allocated rectangle information, and does not invoke any painting
operation like paintOnAvailableBuffer() did.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::getCoordinatedBuffer):
(WebKit::CompositingCoordinator::paintToSurface): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
(WebKit::UpdateAtlas::getCoordinatedBuffer):
(WebKit::UpdateAtlas::paintOnAvailableBuffer): Deleted.
* WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225115 268f45cc-cd09-0410-ab3c-d52691b4dbfc