Closed Bug 1402004 Opened 4 years ago Closed 4 years ago

Assertion failure: aMaskContext->GetDrawTarget()->GetFormat() == SurfaceFormat::A8

Categories

(Core :: Graphics: WebRender, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox57 --- unaffected
firefox58 --- fixed

People

(Reporter: nical, Assigned: jrmuizel)

References

Details

(Whiteboard: [wr-mvp] [gfx-noted])

Attachments

(1 file)

I keep running into this assertion.

> #5  in <signal handler called> () at /lib64/libpthread.so.0
> #6  in nsDisplayMask::PaintMask at layout/painting/nsDisplayList.cpp:8882
> #7  in mozilla::layers::PaintItemByDrawTarget at gfx/layers/wr/WebRenderLayerManager.cpp:482
> #8  in mozilla::layers::WebRenderLayerManager::GenerateFallbackData at gfx/layers/wr/WebRenderLayerManager.cpp:595
> #9  in mozilla::layers::WebRenderLayerManager::BuildWrMaskImage at gfx/layers/wr/WebRenderLayerManager.cpp:653
> #10 in nsDisplayMask::CreateWebRenderCommands at layout/painting/nsDisplayList.cpp:9028
> #11 in mozilla::layers::WebRenderLayerManager::CreateWebRenderCommandsFromDisplayList at gfx/layers/wr/WebRenderLayerManager.cpp:344
> #12 in mozilla::layers::WebRenderLayerManager::EndTransactionInternal at gfx/layers/wr/WebRenderLayerManager.cpp:746
> #13 in nsDisplayList::PaintRoot at layout/painting/nsDisplayList.cpp:2169
> #14 in nsLayoutUtils::PaintFrame at layout/base/nsLayoutUtils.cpp:3772
> #15 in mozilla::PresShell::Paint at layout/base/PresShell.cpp:6454

The DrawTarget in the gfxContext is a recording DrawTarget wrapped around a dummy DrawTarget of format B8G8R8A8 created a few stack frames higher in here: https://searchfox.org/mozilla-central/rev/2ef8bd8a46a02c68ddbb1d5f25fa254dd7be1fbd/gfx/layers/wr/WebRenderLayerManager.cpp#586

The recodring DrawTarget returns the format of its wrapping target so we need to make sure we we create an A8 target when we are going to write into a mask, or remove the assertion and hope that nothing else depends on the exposed format.
Whiteboard: [wr-mvp][triage]
Priority: -- → P3
Whiteboard: [wr-mvp][triage] → [wr-reserve]
Whiteboard: [wr-reserve] → [gfx-noted]
Priority: P3 → P2
Whiteboard: [gfx-noted] → [wr-mvp] [gfx-noted]
Attached patch Use A8Splinter Review
I don't know what was broken. Let's try to use it.
Assignee: nobody → jmuizelaar
Status: NEW → ASSIGNED
Priority: P2 → P1
Comment on attachment 8912395 [details] [diff] [review]
Use A8

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

Tried locally, fixes all the crashers I know of.
Attachment #8912395 - Flags: review+
Pushed by jmuizelaar@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a28263319f14
Use A8 as the format for the dummy drawtarget. r=Gankro
https://hg.mozilla.org/mozilla-central/rev/a28263319f14
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.