Utility function to convert a surface into an image surface

RESOLVED FIXED

Status

()

Core
Graphics
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

Tracking

unspecified
x86
All
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(blocking2.0 betaN+)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

7 years ago
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.
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"
(Assignee)

Comment 3

7 years ago
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.
(Assignee)

Comment 5

7 years ago
Created attachment 484558 [details] [diff] [review]
Add interface v2

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)
(Assignee)

Updated

7 years ago
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+
(Assignee)

Comment 7

7 years ago
Patches for that (originally by joe) are attached to bug 575521
(Assignee)

Updated

7 years ago
blocking2.0: --- → ?
We need this for perf improvements.
blocking2.0: ? → betaN+
Assignee: nobody → matt.woodrow+bugzilla
http://hg.mozilla.org/mozilla-central/rev/44a537c00ab6
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.