Changeset 167717 in webkit


Ignore:
Timestamp:
Apr 23, 2014 11:47:15 AM (10 years ago)
Author:
akling@apple.com
Message:

[iOS WebKit2] IOSurfacePool should force CA to actually garbage collect surfaces.
<https://webkit.org/b/132065>
<rdar://problem/16110687>

Add a platformGarbageCollectNow() helper function to IOSurfacePool that
triggers a sweep of the IOSurfaces. Call this from collectionTimerFired()
and discardAllSurfaces().

This lets us drop all otherwise-unused 420f surfaces on memory pressure.

Reviewed by Tim Horton.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/graphics/cg/IOSurfacePool.cpp:

(WebCore::IOSurfacePool::collectionTimerFired):
(WebCore::IOSurfacePool::discardAllSurfaces):

  • platform/graphics/cg/IOSurfacePool.h:
  • platform/graphics/cocoa/IOSurfacePoolCocoa.mm: Added.

(WebCore::IOSurfacePool::platformGarbageCollectNow):

Location:
trunk/Source/WebCore
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167716 r167717  
     12014-04-23  Andreas Kling  <akling@apple.com>
     2
     3        [iOS WebKit2] IOSurfacePool should force CA to actually garbage collect surfaces.
     4        <https://webkit.org/b/132065>
     5        <rdar://problem/16110687>
     6
     7        Add a platformGarbageCollectNow() helper function to IOSurfacePool that
     8        triggers a sweep of the IOSurfaces. Call this from collectionTimerFired()
     9        and discardAllSurfaces().
     10
     11        This lets us drop all otherwise-unused 420f surfaces on memory pressure.
     12
     13        Reviewed by Tim Horton.
     14
     15        * WebCore.xcodeproj/project.pbxproj:
     16        * platform/graphics/cg/IOSurfacePool.cpp:
     17        (WebCore::IOSurfacePool::collectionTimerFired):
     18        (WebCore::IOSurfacePool::discardAllSurfaces):
     19        * platform/graphics/cg/IOSurfacePool.h:
     20        * platform/graphics/cocoa/IOSurfacePoolCocoa.mm: Added.
     21        (WebCore::IOSurfacePool::platformGarbageCollectNow):
     22
    1232014-04-23  Morten Stenshorne  <mstensho@opera.com>
    224
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r167652 r167717  
    42464246                AD726FEE16DA11BC003A4E6D /* JSStyleSheetCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD726FEC16D9F4B9003A4E6D /* JSStyleSheetCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
    42474247                AD726FEF16DA11F5003A4E6D /* JSCSSRuleCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AD726FE916D9F40A003A4E6D /* JSCSSRuleCustom.h */; settings = {ATTRIBUTES = (Private, ); }; };
     4248                AD9FF6E11908391D003B61E0 /* IOSurfacePoolCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = AD9FF6E01908391D003B61E0 /* IOSurfacePoolCocoa.mm */; };
    42484249                ADB6B29818FB90240081963E /* MemoryPressureHandlerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = ADB6B29718FB90240081963E /* MemoryPressureHandlerCocoa.mm */; };
    42494250                ADDF1AD71257CD9A0003A759 /* RenderSVGPath.h in Headers */ = {isa = PBXBuildFile; fileRef = ADDF1AD51257CD9A0003A759 /* RenderSVGPath.h */; };
     
    1137011371                AD726FEA16D9F40B003A4E6D /* JSCSSStyleDeclarationCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSStyleDeclarationCustom.h; sourceTree = "<group>"; };
    1137111372                AD726FEC16D9F4B9003A4E6D /* JSStyleSheetCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStyleSheetCustom.h; sourceTree = "<group>"; };
     11373                AD9FF6E01908391D003B61E0 /* IOSurfacePoolCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IOSurfacePoolCocoa.mm; sourceTree = "<group>"; };
    1137211374                ADB6B29718FB90240081963E /* MemoryPressureHandlerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryPressureHandlerCocoa.mm; sourceTree = "<group>"; };
    1137311375                ADDF1AD41257CD9A0003A759 /* RenderSVGPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGPath.cpp; sourceTree = "<group>"; };
     
    2037220374                                1C21E57A183ED1FF001C289D /* IOSurfacePool.cpp */,
    2037320375                                1C21E57B183ED1FF001C289D /* IOSurfacePool.h */,
     20376                                AD9FF6E01908391D003B61E0 /* IOSurfacePoolCocoa.mm */,
    2037420377                                B5320D6A122A24E9002D1440 /* FontPlatformDataCocoa.mm */,
    2037520378                        );
     
    2861228615                                86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */,
    2861328616                                8AF4E55511DC5A36000ED3DE /* PerformanceNavigation.cpp in Sources */,
     28617                                AD9FF6E11908391D003B61E0 /* IOSurfacePoolCocoa.mm in Sources */,
    2861428618                                86512EDE154A2AEF00A90426 /* PerformanceResourceTiming.cpp in Sources */,
    2861528619                                0F43C85D189E10CF00019AE2 /* PerformanceTiming.cpp in Sources */,
  • trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp

    r166886 r167717  
    289289        m_collectionTimer.stop();
    290290
     291    platformGarbageCollectNow();
    291292    DUMP_POOL_STATISTICS();
    292293}
     
    307308    m_sizesInPruneOrder.clear();
    308309    m_collectionTimer.stop();
     310    platformGarbageCollectNow();
    309311}
    310312
  • trunk/Source/WebCore/platform/graphics/cg/IOSurfacePool.h

    r166682 r167717  
    9292    bool markOlderSurfacesPurgeable();
    9393
     94    void platformGarbageCollectNow();
     95
    9496    Timer<IOSurfacePool> m_collectionTimer;
    9597    CachedSurfaceMap m_cachedSurfaces;
Note: See TracChangeset for help on using the changeset viewer.