mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-19 15:51:33 +00:00

When one uses SourceSurfaceRawData to wrap a data pointer, it will perform a copy of said data if GuaranteePersistence is called. This is done for DrawTargetCapture, which is used with OMTP. Prior to this patch, image surfaces would be wrapped by a SourceSurfaceRawData when using the basic compositor on any non-Linux platform (since Linux does not support volatile memory). This means every time imgFrame::Draw is called with OMTP, a copy of the image will be made. Images don't need this property since the data is already going to persist, so this patch adds a new class SourceSurfaceMappedData, which takes a ScopedMap keeping the underlying surface open and readable. Differential Revision: https://phabricator.services.mozilla.com/D58199 --HG-- extra : moz-landing-system : lando