Skip to content
Commit 1fe86f92 authored by Christopher Cameron's avatar Christopher Cameron Committed by Chromium LUCI CQ
Browse files

SharedImage/SkiaOutputDeviceBufferQueue: Add SetPurgeable method

To SharedImage, add the function SetPurgeable. This corresponds to
calling IOSurfaceSetPurgeable on macOS.

In SkiaOutputDeviceBufferQueue::PageFlipComplete, each time we flip
to a frame that has no primary plane, set one of the available buffers
as purgeable.

Of note is that IOSurfaces will be purged even when the
OutputPresenter::Image has an active SkiaImageRepresentation and
OverlayImageRepresentation allocated for that image. It may be that
we will want to remove these representations when calling
OutputPresenter::Image::SetPurgeable.

The reason for doing one image per flip (as opposed to setting all
images to be purgeable) in compensation for the fact that these images
do not track IOSurfaceInUse to ensure they are not changed while being
displayed by the WindowServer. With this behavior, we only purge an
IOSurface in a situation where we would have potentially written to it
(and so if purging changes its contents, it will not introduce artifacts
that didn't already exist).

Add tests.

Bug: 1347282
Change-Id: If4f0976fa5025dd05bfbcb49c497bc8d99c783c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3941643


Reviewed-by: default avatarCorentin Wallez <cwallez@chromium.org>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1076888}
parent 5e1e4828
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment