Created attachment 483884 [details] [diff] [review] Add interface First patch takes the existing function from gfxQuartzImageSurface and makes it available for all gfxASurfaces. We should add follow-up patches for other supported surface types as we need them.
Comment on attachment 483884 [details] [diff] [review] Add interface Expand the comment to say that this will not perform a copy, it will only wrap an image surface around pixel data that's already available in memory.
I'd also call this "GetAsImageSurface"
That was my original thought. I went with this name to avoid breaking bcompat for gfxQuartzImageSurface. Worth going through and changing all instances of this?
Should only be a few, no? But either way, just seems clearer. The awkward thing (and I'm to blame for this) is that for win32, it's easier to create the image surface and then wrap it with a win32 surface, whereas for the Quartz case it's easier to create the quartz surface and then get an image surface pointing to the data. I guess thebes hides all that.
Created attachment 484558 [details] [diff] [review] Add interface v2 Renamed to GetAsImageSurface, updated all usage of the old function. Implemented it for gfxImageSurface.
Comment on attachment 484558 [details] [diff] [review] Add interface v2 This is OK. We can implement GetAsImageSurface for (some) gfxQuartzSurfaces too, but I guess we can do that when it matters.
Patches for that (originally by joe) are attached to bug 575521
We need this for perf improvements.