In the interests of allowing the operating system to clean up snapshots when the system is under memory pressure, they should be made purgeable. We could even assign purgeability priority outwards from the current back-forward item to help further-away snapshots get thrown away first.
<rdar://problem/15876775>
Created attachment 222427 [details] patch take 1 Not sure if scanning the b-f list is too expensive. I'm sure there's a faster way... Not sure if we actually want to wait, with a white snapshot view, if the image has been purged/evicted; maybe we should just switch immediately in that case. I would kind of like ViewSnapshotStore to own the purgeability story, but I'm not totally sure how to make that work yet. Would love it if someone had an easy way to make CGImage purgeable, but I don't see anything.
Created attachment 222467 [details] patch
Comment on attachment 222467 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=222467&action=review > Source/WebKit2/UIProcess/mac/ViewGestureController.mm:51 > +static const uint32_t WebKitIOSurfacePurgeableNonVolatile = 0; > +static const uint32_t WebKitIOSurfacePurgeableVolatile = 1; > +static const uint32_t WebKitIOSurfacePurgeableEmpty = 2; I think you should use a real enum here with real IOSurface names. > Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm:46 > +static const uint32_t WebKitIOSurfacePurgeableVolatile = 1; Real enum.
http://trac.webkit.org/changeset/162946
*** Bug 127389 has been marked as a duplicate of this bug. ***