Fix and disallow warnings in gfx/thebes

RESOLVED FIXED in Firefox 44

Status

()

Core
Graphics
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

Trunk
mozilla44
Points:
---

Firefox Tracking Flags

(firefox44 fixed)

Details

Attachments

(3 attachments)

(Assignee)

Description

2 years ago
We get a ton of warnings like this in gfxWindowsPlatform.cpp:

> gfx/thebes/gfxWindowsPlatform.cpp(2016) : warning C4509: nonstandard extension used: 'gfxWindowsPlatform::AttemptD3D11DeviceCreation' uses SEH and 'adapter' has destructor

The problem is that desctructors don't run reliably if a structured exception is thrown. The fix is to put the SEH try/catch blocks in functions that don't involve local variables whose types have destructors.
(Assignee)

Comment 1

2 years ago
W.r.t. the incoming patches, please note that I'm a total newbie when it comes to this code. Please cast a skeptical eye.
(Assignee)

Comment 2

2 years ago
Created attachment 8664631 [details] [diff] [review]
(part 1) - Don't recompute Windows feature levels

This is valid because mFeatureLevels is set when gfxWindowsPlatform is
initialized.
Attachment #8664631 - Flags: review?(dvander)
(Assignee)

Updated

2 years ago
Assignee: nobody → n.nethercote
(Assignee)

Comment 3

2 years ago
Created attachment 8664632 [details] [diff] [review]
(part 2) - Don't re-get D3D11CreateDevice

It's always obtained during gfxWindowPlatform initialization and put into
sD3D11CreateDeviceFn.
Attachment #8664632 - Flags: review?(dvander)
(Assignee)

Comment 4

2 years ago
Created attachment 8664634 [details] [diff] [review]
(part 3) - Fix and disallow warnings in gfx/thebes/

froydnj: I'm uncertain about the handling of |aDevice| in
CreateD3D11DecoderDeviceHelper(). I've used a RefPtr<>& because of the byRef()
call but I don't know if that's right. That's the only bit I need you to look
at, but please look carefully.

dvander: please check the whole patch.

Thank you.
Attachment #8664634 - Flags: review?(nfroyd)
Attachment #8664634 - Flags: review?(dvander)
Attachment #8664631 - Flags: review?(dvander) → review+
Attachment #8664632 - Flags: review?(dvander) → review+
Comment on attachment 8664634 [details] [diff] [review]
(part 3) - Fix and disallow warnings in gfx/thebes/

Review of attachment 8664634 [details] [diff] [review]:
-----------------------------------------------------------------

Looks fine to me.
Attachment #8664634 - Flags: review?(nfroyd) → review+
Comment on attachment 8664634 [details] [diff] [review]
(part 3) - Fix and disallow warnings in gfx/thebes/

Review of attachment 8664634 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks, these warnings were really annoying.
Attachment #8664634 - Flags: review?(dvander) → review+

Comment 7

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/1621dcfac789
https://hg.mozilla.org/integration/mozilla-inbound/rev/9aab02e2871f
https://hg.mozilla.org/integration/mozilla-inbound/rev/6e0a245b7492
(Assignee)

Comment 8

2 years ago
Here's the try push I did before landing: https://treeherder.mozilla.org/#/jobs?repo=try&revision=5fe57671a098
https://hg.mozilla.org/mozilla-central/rev/1621dcfac789
https://hg.mozilla.org/mozilla-central/rev/9aab02e2871f
https://hg.mozilla.org/mozilla-central/rev/6e0a245b7492
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox44: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44

Comment 10

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/782262a94361
https://hg.mozilla.org/mozilla-central/rev/782262a94361
You need to log in before you can comment on or make changes to this bug.