The publicly exposed WebOverlay class provides a method setContentsToImage() to assign a pointer to pixel data, which is later used to provide texture data for the underlying compositing layer. This works well for static images that stay in memory and never change, but not so well for images with changing contents or where the image data is being reassigned from different image sources that are not constantly kept around in memory. Due to the delayed upload and delayed fetching of EGLImage data by the GPU, we shouldn't assume the caller to know how long the image should be retained. Instead, we should offer another method of setting image data that takes ownership of the pixel data. This patch adds an option to setContentsToImage() that copies the passed pixel data and doesn't destroy it until both the texture is destroyed and the image contents are changed. Using this method, the caller can withdraw the passed pixel array right after the setContentsToImage() call without consequences.
Created attachment 163940 [details] Patch
Created attachment 163965 [details] Patch Not sure why the first attempt above didn't apply. Git had no rebase issues (except for ChangeLog, which is irrelevant here) but the bot uses regular patch, so let's try again with the rebased version.
Created attachment 164194 [details] Patch There, that should do it. Shoot for the sky, bots!
Comment on attachment 164194 [details] Patch Looks good.
Comment on attachment 164194 [details] Patch Clearing flags on attachment: 164194 Committed r128755: <http://trac.webkit.org/changeset/128755>
All reviewed patches have been landed. Closing bug.