Closed Bug 1514803 Opened 5 years ago Closed 5 years ago

Partially deCOMtaminate gfxUtils::EncodeSourceSurface

Categories

(Core :: Graphics, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: barret, Assigned: barret)

References

Details

Attachments

(4 files)

`gfxUtils::EncodeSourceSurface` is used by the profiler to output screenshots. However, this function uses XPCOM to acquire the relevant encoder. On Windows platforms, this will be running in the GPU process, which cannot instantiate most XPCOM contracts (and adding a new exception here doesn't seem ideal). DeCOMtamination will solve this and we can get rid of a stringly-typed API in the process.
Summary: DeCOMtamingate gfxUtils::EncodeSourceSurface → DeCOMtaminate gfxUtils::EncodeSourceSurface
After further investigation, one of the code paths through this function makes
use of XPCOM to acquire an instance of a nsIClipboardHelper, which itself does
several XPCOM methods. This code path is not the code path that is executed
when the profiler is running, so I'm going to limit the scope of this work (for
now) to just acquiring the specific imgIEncoder for the specified image type
(which is what was not working on the GPU process on Windows and motivated this
work in the first place).
Summary: DeCOMtaminate gfxUtils::EncodeSourceSurface → Partially deCOMtaminate gfxUtils::EncodeSourceSurface
gfxUtils::EncodeSourceSurface no longer uses a stringly-typed API to create a
`imgIEncoder` for the relevant MIME type. Instead, we now use an enum class and
switch on it to create the encoder.

Depends on D14816
Priority: -- → P3

Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a72d578c3a83
Expose nsPNGEncoder header r=aosmond
https://hg.mozilla.org/integration/autoland/rev/53a37a8d97ee
Export nsBMPEncoder r=aosmond
https://hg.mozilla.org/integration/autoland/rev/ebeed768822e
Export nsICOEncoder r=aosmond
https://hg.mozilla.org/integration/autoland/rev/cf9a58cbb904
Replace XPCOM image encoder instance creation in gfxUtils::EncodeSourceSurface r=jrmuizel

Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: