Closed
Bug 986526
Opened 11 years ago
Closed 10 years ago
Create a helper function to encode SourceSurfaces to PNG/JPEG/BMP/ICO
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
mattwoodrow
:
review+
jwatt
:
checkin+
|
Details | Diff | Splinter Review |
We currently have methods on gfxASurface to encode the surface to PNG/JPEG/BMP/ICO and write out the encoded data to file, stdout or to the clipboard. We don't want to create a gfxASurface in order to do these things for a SourceSurface though. We should create separate helpers for SourceSurface then start to migrate code over to these new helpers.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•10 years ago
|
||
I've made this fairly general because I have more WIP code to make other parts of the codebase use these helpers rather than create their own encoder. I keep getting bitrotted though, so I'd like to get this part out of my queue.
This is prerequisite work to getting rid of various Thebes backed gfxContexts.
Attachment #8394836 -
Attachment is obsolete: true
Attachment #8446794 -
Flags: review?(matt.woodrow)
Comment 3•10 years ago
|
||
Comment on attachment 8446794 [details] [diff] [review]
patch
Review of attachment 8446794 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxUtils.h
@@ +269,5 @@
> +#ifdef DEBUG
> + static void WriteAsPNG(nsIPresShell* aShell, const char* aFile);
> +#endif
> +
> +#if defined(DEBUG) || defined(MOZ_DUMP_PAINTING)
Let's just make these always defined. There shouldn't be any runtime overhead for having them around, and they can be useful in opt builds.
::: layout/reftests/svg/as-image/lime100x100-noSVGDimensions.svg
@@ +1,3 @@
> <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
> <rect width="100" height="100" fill="lime"/>
> + <circle cx="50" cy="50" r="50" fill="red"/>
I assume this change wasn't meant to be here?
Attachment #8446794 -
Flags: review?(matt.woodrow) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Comment on attachment 8446794 [details] [diff] [review]
patch
https://hg.mozilla.org/integration/mozilla-inbound/rev/54bccb704e1f
Attachment #8446794 -
Flags: checkin+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Comment 6•6 years ago
|
||
Please do not use fopen(NS_ConvertUTF16toUTF8(mIconPath), ...)
. It will break if mIconPath contains a non-ASCII character. Use _wfopen(mIconPath, ...)
instead.
You need to log in
before you can comment on or make changes to this bug.
Description
•