[GTK] Recycle textures while handling tiles
authoryoon@igalia.com <yoon@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 May 2017 22:15:59 +0000 (22:15 +0000)
committeryoon@igalia.com <yoon@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 May 2017 22:15:59 +0000 (22:15 +0000)
commit76bee4e8fd8bf8289d92e68f2ada2948f4402624
treeb3b95bb374dd702701fe2e7a7b77e8ce7512440d
parent6badbc01b8639a9745eff8e8fe8330040235c32e
[GTK] Recycle textures while handling tiles
https://bugs.webkit.org/show_bug.cgi?id=171541

Reviewed by Žan Doberšek.

Source/WebCore:

* platform/graphics/texmap/TextureMapperTile.h:
Modified m_texture as a protected member to avoid unnessary
refcountings from the CoordinatedBackingStore.
* platform/graphics/texmap/coordinated/CoordinatedSurface.h:
Use reference instead of RefPtr to pass BitmapTexture

No new tests since there should be no change in behavior.

Source/WebKit2:

* Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStoreTile::swapBuffers):
Whenever we create new tiles or delete tiles, CoordGfx creates and
deletes textures accordingly.  We should avoid this kind of heavy
operations whenever possible.  This patch modifies to use the texture
pool to reduce texture allocations.  Also this patch reduces number of
resetting textures, which is also expensive operation.
* Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
(WebKit::WebCoordinatedSurface::copyToTexture):
Modified to pass BitmapTexture as a reference.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
(WebKit::ThreadSafeCoordinatedSurface::copyToTexture): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapperTile.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedSurface.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp
Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp
Source/WebKit2/Shared/CoordinatedGraphics/WebCoordinatedSurface.h
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h