Allow more buffer formats in the IOSurface pool
https://bugs.webkit.org/show_bug.cgi?id=151516
Reviewed by Tim Horton.
Source/WebCore:
Previously IOSurface::create was only looking in the pool for RGBA-format surfaces. Change that to
always look in the pool, and to cache all format types. We include format in the criteria used
to pick a surface from the pool.
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::surfaceMatchesParameters):
(WebCore::IOSurfacePool::takeSurface):
(WebCore::IOSurfacePool::shouldCacheFormat):
(WebCore::IOSurfacePool::shouldCacheSurface):
(WebCore::IOSurfacePool::addSurface):
* platform/graphics/cg/IOSurfacePool.h:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::surfaceFromPool):
(IOSurface::create):
(IOSurface::IOSurface):
Source/WebKit2:
Have RemoteLayerBackingStore go through a static function on IOSurface to return
a surface to the pool, rather than knowing about IOSurfacePool directly.
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::Buffer::discard):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192701
268f45cc-cd09-0410-ab3c-
d52691b4dbfc