Long hangs under IOSurfacePool::evict
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 May 2014 00:21:32 +0000 (00:21 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 May 2014 00:21:32 +0000 (00:21 +0000)
commita39465baf98665307659da24809aca8c8b5f723d
tree044cf6b106b10cba419e82e6cf403f8ab97caf8f
parent1d2d6e50980c22a951e30f3e62e6309687f11fb3
Long hangs under IOSurfacePool::evict
https://bugs.webkit.org/show_bug.cgi?id=132549
<rdar://problem/16769469>

Reviewed by Simon Fraser.

* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::willAddSurface):
Run eviction before adding the new surface to m_bytesCached/m_inUseBytesCached.
We use the additionalSize parameter to make space for the new surface.

(WebCore::IOSurfacePool::evict):
If we want to free up the entire pool, we can do so by throwing away everything.
This also avoids an underflow if additionalSize is larger than the maximum pool size.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp