Closed Bug 1514803 Opened 2 years ago Closed 2 years ago

Partially deCOMtaminate gfxUtils::EncodeSourceSurface


(Core :: Graphics, enhancement, P3)




Tracking Status
firefox66 --- fixed


(Reporter: barret, Assigned: barret)




(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
Depends on D14814
Depends on D14815
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
Keywords: checkin-needed

Pushed by
Expose nsPNGEncoder header r=aosmond
Export nsBMPEncoder r=aosmond
Export nsICOEncoder r=aosmond
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.