Closed Bug 605057 Opened 9 years ago Closed 9 years ago

Utility function to convert a surface into an image surface


(Core :: Graphics, defect)

Not set



Tracking Status
blocking2.0 --- betaN+


(Reporter: mattwoodrow, Assigned: mattwoodrow)




(1 file, 1 obsolete file)

Attached patch Add interface (obsolete) — Splinter Review
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.
Attachment #483884 - Flags: review?(roc)
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.
Attachment #483884 - Flags: review?(roc) → review+
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.
Attached patch Add interface v2Splinter Review
Renamed to GetAsImageSurface, updated all usage of the old function.

Implemented it for gfxImageSurface.
Attachment #483884 - Attachment is obsolete: true
Attachment #484558 - Flags: review?(roc)
Blocks: 575521
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.
Attachment #484558 - Flags: review?(roc) → review+
Patches for that (originally by joe) are attached to bug 575521
blocking2.0: --- → ?
We need this for perf improvements.
blocking2.0: ? → betaN+
Assignee: nobody → matt.woodrow+bugzilla
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.