Partially deCOMtaminate gfxUtils::EncodeSourceSurface

RESOLVED FIXED in Firefox 66

Status

()

enhancement
P3
normal
RESOLVED FIXED
6 months ago
5 months ago

People

(Reporter: brennie, Assigned: brennie)

Tracking

unspecified
mozilla66
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox66 fixed)

Details

Attachments

(4 attachments)

Assignee

Description

6 months ago
`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.
Assignee

Updated

6 months ago
Summary: DeCOMtamingate gfxUtils::EncodeSourceSurface → DeCOMtaminate gfxUtils::EncodeSourceSurface
Assignee

Comment 1

6 months ago
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
Assignee

Comment 3

6 months ago
Depends on D14814
Assignee

Comment 4

6 months ago
Depends on D14815
Assignee

Comment 5

6 months ago
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
Assignee

Updated

5 months ago
Keywords: checkin-needed

Comment 7

5 months ago

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.