Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ae38411fb04ec7370d4c9eae4fa77699f7858339
      
https://github.com/WebKit/WebKit/commit/ae38411fb04ec7370d4c9eae4fa77699f7858339
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2026-09-07 (Mon, 07 Sep 2026)

  Changed paths:
    M Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp
    M Source/WebCore/platform/graphics/cg/IOSurfacePool.h
    M Tools/TestWebKitAPI/PlatformCocoa.cmake
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebCore/cocoa/IOSurfacePoolTests.cpp

  Log Message:
  -----------
  IOSurfacePool does not try to take surfaces that were previously in use
https://bugs.webkit.org/show_bug.cgi?id=323620
rdar://186857165

Reviewed by Matt Woodrow.

Frequent 2D context self drawing allocates intermediate buffers. These
do not clear CGIOSurfaceQueue immediately. During such loops, the
IOSurface IsInUse will flip for the earlier intermediate buffers
faster than IOSurfacePool in use surface collect callback runs.

If pool lookup fails, go through the in use list. The pool has quite
modest amount of entries anyway, in use or not, since the memory use
is 256mb.

Test: Tools/TestWebKitAPI/Tests/WebCore/cocoa/IOSurfacePoolTests.cpp

* Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::takeSurface):
* Source/WebCore/platform/graphics/cg/IOSurfacePool.h:
* Tools/TestWebKitAPI/PlatformCocoa.cmake:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/IOSurfacePoolTests.cpp: Added.
(TestWebKitAPI::TEST(IOSurfacePoolTest, 
TakeSurfaceFindsSurfaceThatIsNoLongerInUse)):

Canonical link: https://commits.webkit.org/320628@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to