Closed Bug 1514393 Opened 8 months ago Closed 8 months ago

Export nsJPEGEncoder and isolate its internals

Categories

(Core :: Graphics, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: barret, Assigned: barret)

References

Details

Attachments

(3 files)

nsJPEGEncoder is currently in an unexported header, which means to acquire a JPEG encoder we need to use XPCOM `do_CreateInstance`. Additionally, exposing this header for use in, e.g., the compositor to capture screenshots results in duplicate type definitions on Windows (from libjpeg and windows.h). This can be mitigated by not presenting the callbacks that libjpeg uses in the public header.
Both libjpeg and windows.h typedef `boolean` to different types (`int` and
`unsiched char` respectively) and nsJPEGEncoder's public definition includes a
function that returns a `boolean`. Exposing this header results in type
conflicts.

We now isolate the internals of nsJPEGEncoder into a friend class whose
internals are hidden from the publica, allowing the header to exported.
Status: NEW → ASSIGNED
Blocks: 1514803
Keywords: checkin-needed
Pushed by rvandermeulen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d81fe57537cb
Isolate internals of nsJPEGEncoder r=aosmond
https://hg.mozilla.org/integration/autoland/rev/9d5088dfe7d3
Export nsJPEGEncoder header r=aosmond
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d81fe57537cb
https://hg.mozilla.org/mozilla-central/rev/9d5088dfe7d3
Status: ASSIGNED → RESOLVED
Closed: 8 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Status: RESOLVED → REOPENED
Keywords: checkin-needed
Resolution: FIXED → ---
Pushed by nerli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b350b5b4781e
Correct formatting in nsJPEGEncoder.cpp r=aosmond
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/d81fe57537cb
https://hg.mozilla.org/mozilla-central/rev/9d5088dfe7d3
Status: REOPENED → RESOLVED
Closed: 8 months ago8 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.