Bug 96684

Summary: [BlackBerry] Support copying image data in WebOverlay
Product: WebKit Reporter: Jakob Petsovits <jpetsovits>
Component: WebKit BlackBerryAssignee: Jakob Petsovits <jpetsovits>
Status: RESOLVED FIXED    
Severity: Normal CC: anilsson, anlo, mifenton, rwlbuis, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Jakob Petsovits 2012-09-13 12:43:58 PDT
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.
Comment 1 Jakob Petsovits 2012-09-13 12:49:56 PDT
Created attachment 163940 [details]
Patch
Comment 2 Jakob Petsovits 2012-09-13 14:22:45 PDT
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.
Comment 3 Jakob Petsovits 2012-09-14 11:10:02 PDT
Created attachment 164194 [details]
Patch

There, that should do it. Shoot for the sky, bots!
Comment 4 Rob Buis 2012-09-17 07:41:13 PDT
Comment on attachment 164194 [details]
Patch

Looks good.
Comment 5 WebKit Review Bot 2012-09-17 07:57:13 PDT
Comment on attachment 164194 [details]
Patch

Clearing flags on attachment: 164194

Committed r128755: <http://trac.webkit.org/changeset/128755>
Comment 6 WebKit Review Bot 2012-09-17 07:57:17 PDT
All reviewed patches have been landed.  Closing bug.