Closed Bug 1308619 Opened 8 years ago Closed 2 years ago

Assertion failure: false, at gfx/2d/DrawTargetSkia.cpp:1077 (from MediaEngineTabVideoSource::Draw) in debug build

Categories

(Core :: Graphics, defect, P3)

Unspecified
macOS
defect

Tracking

()

RESOLVED INACTIVE
Tracking Status
firefox52 --- affected

People

(Reporter: jib, Unassigned)

References

()

Details

(Keywords: assertion, Whiteboard: [gfx-noted])

A debug assert now happens when starting of Tab sharing. It didn't used to, making is a regression, though this feature was only really exposed in Firefox Hello AFAIK, and is missing a selector UX before it can be made generally available.

STR (DEBUG build):
1. In about:config:
  - add ",fiddle.jshell.net" to the tail of media.getusermedia.screensharing.allowed_domains
  - set media.navigator.permission.disabled = true
2. Open URL and click [Start] button.

Expected result:
- Tab is shared in video element.

Actual result:
- Assertion failure: false, at /Users/Jan/moz/mozilla-central/gfx/2d/DrawTargetSkia.cpp:1077

> #01: mozilla::gfx::BorrowedCGContext::BorrowCGContextFromDrawTarget(mozilla::gfx::DrawTarget*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1b95742]
> #02: mozilla::gfx::BorrowedCGContext::Init(mozilla::gfx::DrawTarget*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x20b8ebd]
> #03: gfxQuartzNativeDrawing::BeginNativeDrawing()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x20b8d14]
> #04: nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext*, nsIFrame*, unsigned char, nsRect const&, nsRect const&)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c3a8b9]
> #05: nsDisplayThemedBackground::PaintInternal(nsDisplayListBuilder*, nsRenderingContext*, nsRect const&, nsRect*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x512f678]
> #06: nsDisplayThemedBackground::Paint(nsDisplayListBuilder*, nsRenderingContext*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x512f56c]
> #07: mozilla::FrameLayerBuilder::PaintItems(nsTArray<mozilla::FrameLayerBuilder::ClippedDisplayItem>&, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, gfxContext*, nsRenderingContext*, nsDisplayListBuilder*, nsPresContext*, mozilla::gfx::IntPoin[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x506ce6a]
> #08: mozilla::FrameLayerBuilder::DrawPaintedLayer(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::layers::DrawRegionClip, mo[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x506e21a]
> #09: mozilla::layers::BasicPaintedLayer::PaintThebes(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::Unknown[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ef6117]
> #10: mozilla::layers::BasicLayerManager::PaintSelfOrChildren(mozilla::layers::PaintLayerContext&, gfxContext*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ef4646]
> #11: mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownU[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ef39c6]
> #12: mozilla::layers::BasicLayerManager::PaintSelfOrChildren(mozilla::layers::PaintLayerContext&, gfxContext*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ef47c5]
> #13: mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownU[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ef39c6]
> #14: mozilla::layers::BasicLayerManager::EndTransactionInternal(void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::lay[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ef2780]
> #15: mozilla::layers::BasicLayerManager::EndTransaction(void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::layers::Dra[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1ef21aa]
> #16: nsDisplayList::PaintRoot(nsDisplayListBuilder*, nsRenderingContext*, unsigned int)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x5125b74]
> #17: nsLayoutUtils::PaintFrame(nsRenderingContext*, nsIFrame*, nsRegion const&, unsigned int, nsDisplayListBuilderMode, nsLayoutUtils::PaintFrameFlags)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x516a675]
> #18: PresShell::RenderDocument(nsRect const&, unsigned int, unsigned int, gfxContext*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x519e04f]
> #19: mozilla::MediaEngineTabVideoSource::Draw()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x427a996]
> #20: mozilla::MediaEngineTabVideoSource::StartRunnable::Run()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4279f1e]
> #21: mozilla::MediaEngineTabVideoSource::InitRunnable::Run()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x427b33e]
> #22: nsThread::ProcessNextEvent(bool, bool*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x1c9459]
> #23: NS_ProcessPendingEvents(nsIThread*, unsigned int)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x2505bc]
> #24: nsBaseAppShell::NativeEventCallback()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4bd408e]
> #25: nsAppShell::ProcessGeckoEvents(void*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c6e2f2]
> #26: __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0xaa8b1]
> #27: __CFRunLoopDoSources0[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x8a0ac]
> #28: __CFRunLoopRun[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x895cf]
> #29: CFRunLoopRunSpecific[/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation +0x88fc8]
> #30: RunCurrentEventLoopInMode[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x30d55]
> #31: ReceiveNextEventCommon[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x30b8f]
> #32: _BlockUntilNextEventMatchingListInModeWithFilter[/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox +0x309cf]
> #33: _DPSNextEvent[/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x49d96]
> #34: -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:][/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x491c5]
> #35: -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:][/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c6ce44]
> #36: -[NSApplication run][/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit +0x3dd28]
> #37: nsAppShell::Run()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x4c6ec9c]
> #38: XRE_RunAppShell[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x618ee95]
> #39: mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0xbca103]
> #40: MessageLoop::RunInternal()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0xacdb35]
> #41: MessageLoop::RunHandler()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0xacda95]
> #42: MessageLoop::Run()[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0xacda3d]
> #43: XRE_InitChildProcess[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/XUL +0x618e5a8]
> #44: content_process_main(int, char**)[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/plugin-container.app/Contents/MacOS/plugin-container +0x2eca]
> #45: main[/Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/NightlyDebug.app/Contents/MacOS/plugin-container.app/Contents/MacOS/plugin-container +0x3132]
Summary: Debug Assertion failure: false, at gfx/2d/DrawTargetSkia.cpp:1077 (from MediaEngineTabVideoSource::Draw) → Assertion failure: false, at gfx/2d/DrawTargetSkia.cpp:1077 (from MediaEngineTabVideoSource::Draw) in debug build
Hmm, line numbers might help:

> Thread 1Queue : com.apple.main-thread (serial)
> #0	0x0000000102013752 in mozilla::gfx::BorrowedCGContext::BorrowCGContextFromDrawTarget(mozilla::gfx::DrawTarget*) at /Users/Jan/moz/mozilla-central/gfx/2d/DrawTargetSkia.cpp:1077
> #1	0x0000000102536ebd in mozilla::gfx::BorrowedCGContext::Init(mozilla::gfx::DrawTarget*) at /Users/Jan/moz/mozilla-central/obj-x86_64-apple-darwin12.2.1-debug/dist/include/mozilla/gfx/BorrowedContext.h:175
> #2	0x0000000102536d14 in gfxQuartzNativeDrawing::BeginNativeDrawing() at /Users/Jan/moz/mozilla-central/gfx/thebes/gfxQuartzNativeDrawing.cpp:52
> #3	0x00000001050b88b9 in nsNativeThemeCocoa::DrawWidgetBackground(nsRenderingContext*, nsIFrame*, unsigned char, nsRect const&, nsRect const&) at /Users/Jan/moz/mozilla-central/widget/cocoa/nsNativeThemeCocoa.mm:2308
> #4	0x00000001055ad678 in nsDisplayThemedBackground::PaintInternal(nsDisplayListBuilder*, nsRenderingContext*, nsRect const&, nsRect*) at /Users/Jan/moz/mozilla-central/layout/base/nsDisplayList.cpp:3314
> #5	0x00000001055ad56c in nsDisplayThemedBackground::Paint(nsDisplayListBuilder*, nsRenderingContext*) at /Users/Jan/moz/mozilla-central/layout/base/nsDisplayList.cpp:3298
> #6	0x00000001054eae6a in mozilla::FrameLayerBuilder::PaintItems(nsTArray<mozilla::FrameLayerBuilder::ClippedDisplayItem>&, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const&, gfxContext*, nsRenderingContext*, nsDisplayListBuilder*, nsPresContext*, mozilla::gfx::IntPointTyped<mozilla::gfx::UnknownUnits> const&, float, float, int) at /Users/Jan/moz/mozilla-central/layout/base/FrameLayerBuilder.cpp:5706
> #7	0x00000001054ec21a in mozilla::FrameLayerBuilder::DrawPaintedLayer(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::layers::DrawRegionClip, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, void*) at /Users/Jan/moz/mozilla-central/layout/base/FrameLayerBuilder.cpp:5881
> #8	0x0000000102374117 in mozilla::layers::BasicPaintedLayer::PaintThebes(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::layers::DrawRegionClip, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, void*), void*) at /Users/Jan/moz/mozilla-central/gfx/layers/basic/BasicPaintedLayer.cpp:94
> #9	0x0000000102372646 in mozilla::layers::BasicLayerManager::PaintSelfOrChildren(mozilla::layers::PaintLayerContext&, gfxContext*) at /Users/Jan/moz/mozilla-central/gfx/layers/basic/BasicLayerManager.cpp:712
> #10	0x00000001023719c6 in mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::layers::DrawRegionClip, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, void*), void*) at /Users/Jan/moz/mozilla-central/gfx/layers/basic/BasicLayerManager.cpp:893
> #11	0x00000001023727c5 in mozilla::layers::BasicLayerManager::PaintSelfOrChildren(mozilla::layers::PaintLayerContext&, gfxContext*) at /Users/Jan/moz/mozilla-central/gfx/layers/basic/BasicLayerManager.cpp:733
> #12	0x00000001023719c6 in mozilla::layers::BasicLayerManager::PaintLayer(gfxContext*, mozilla::layers::Layer*, void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::layers::DrawRegionClip, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, void*), void*) at /Users/Jan/moz/mozilla-central/gfx/layers/basic/BasicLayerManager.cpp:893
> #13	0x0000000102370780 in mozilla::layers::BasicLayerManager::EndTransactionInternal(void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::layers::DrawRegionClip, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, void*), void*, mozilla::layers::LayerManager::EndTransactionFlags) at /Users/Jan/moz/mozilla-central/gfx/layers/basic/BasicLayerManager.cpp:621
> #14	0x00000001023701aa in mozilla::layers::BasicLayerManager::EndTransaction(void (*)(mozilla::layers::PaintedLayer*, gfxContext*, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, mozilla::layers::DrawRegionClip, mozilla::gfx::IntRegionTyped<mozilla::gfx::UnknownUnits> const&, void*), void*, mozilla::layers::LayerManager::EndTransactionFlags) at /Users/Jan/moz/mozilla-central/gfx/layers/basic/BasicLayerManager.cpp:547
> #15	0x00000001055a3b74 in nsDisplayList::PaintRoot(nsDisplayListBuilder*, nsRenderingContext*, unsigned int) at /Users/Jan/moz/mozilla-central/layout/base/nsDisplayList.cpp:1941
> #16	0x00000001055e8675 in nsLayoutUtils::PaintFrame(nsRenderingContext*, nsIFrame*, nsRegion const&, unsigned int, nsDisplayListBuilderMode, nsLayoutUtils::PaintFrameFlags) at /Users/Jan/moz/mozilla-central/layout/base/nsLayoutUtils.cpp:3638
> #17	0x000000010561c04f in PresShell::RenderDocument(nsRect const&, unsigned int, unsigned int, gfxContext*) at /Users/Jan/moz/mozilla-central/layout/base/nsPresShell.cpp:4727
> #18	0x00000001046f8996 in mozilla::MediaEngineTabVideoSource::Draw() at /Users/Jan/moz/mozilla-central/dom/media/webrtc/MediaEngineTabVideoSource.cpp:323
> #19	0x00000001046f7f1e in mozilla::MediaEngineTabVideoSource::StartRunnable::Run() at /Users/Jan/moz/mozilla-central/dom/media/webrtc/MediaEngineTabVideoSource.cpp:51
> #20	0x00000001046f933e in mozilla::MediaEngineTabVideoSource::InitRunnable::Run() at /Users/Jan/moz/mozilla-central/dom/media/webrtc/MediaEngineTabVideoSource.cpp:118
> #21	0x0000000100647459 in nsThread::ProcessNextEvent(bool, bool*) at /Users/Jan/moz/mozilla-central/xpcom/threads/nsThread.cpp:1082
> #22	0x00000001006ce5bc in NS_ProcessPendingEvents(nsIThread*, unsigned int) at /Users/Jan/moz/mozilla-central/xpcom/glue/nsThreadUtils.cpp:232
> #23	0x000000010505208e in nsBaseAppShell::NativeEventCallback() at /Users/Jan/moz/mozilla-central/widget/nsBaseAppShell.cpp:97
> #24	0x00000001050ec2f2 in nsAppShell::ProcessGeckoEvents(void*) at /Users/Jan/moz/mozilla-central/widget/cocoa/nsAppShell.mm:386
> #25	0x00007fff8c4748b1 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
> #26	0x00007fff8c4540ac in __CFRunLoopDoSources0 ()
> #27	0x00007fff8c4535cf in __CFRunLoopRun ()
> #28	0x00007fff8c452fc8 in CFRunLoopRunSpecific ()
> #29	0x00007fff973c9d55 in RunCurrentEventLoopInMode ()
> #30	0x00007fff973c9b8f in ReceiveNextEventCommon ()
> #31	0x00007fff973c99cf in _BlockUntilNextEventMatchingListInModeWithFilter ()
> #32	0x00007fff97c81d96 in _DPSNextEvent ()
> #33	0x00007fff97c811c5 in -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] ()
> #34	0x00000001050eae44 in -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] at /Users/Jan/moz/mozilla-central/widget/cocoa/nsAppShell.mm:121
> #35	0x00007fff97c75d28 in -[NSApplication run] ()
> #36	0x00000001050ecc9c in nsAppShell::Run() at /Users/Jan/moz/mozilla-central/widget/cocoa/nsAppShell.mm:660
> #37	0x000000010660ce95 in XRE_RunAppShell at /Users/Jan/moz/mozilla-central/toolkit/xre/nsEmbedFunctions.cpp:869
> #38	0x0000000101048103 in mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) at /Users/Jan/moz/mozilla-central/ipc/glue/MessagePump.cpp:269
> #39	0x0000000100f4bb35 in MessageLoop::RunInternal() at /Users/Jan/moz/mozilla-central/ipc/chromium/src/base/message_loop.cc:232
> #40	0x0000000100f4ba95 in MessageLoop::RunHandler() at /Users/Jan/moz/mozilla-central/ipc/chromium/src/base/message_loop.cc:225
> #41	0x0000000100f4ba3d in MessageLoop::Run() at /Users/Jan/moz/mozilla-central/ipc/chromium/src/base/message_loop.cc:205
> #42	0x000000010660c5a8 in XRE_InitChildProcess at /Users/Jan/moz/mozilla-central/toolkit/xre/nsEmbedFunctions.cpp:701
> #43	0x0000000100002eca in content_process_main(int, char**) at /Users/Jan/moz/mozilla-central/ipc/app/../contentproc/plugin-container.cpp:197
> #44	0x0000000100003132 in main at /Users/Jan/moz/mozilla-central/ipc/app/MozillaRuntimeMain.cpp:18
> #45	0x0000000100001724 in start ()
Component: WebRTC: Audio/Video → Graphics
Hi :nical,

This crash can be reproduced on my local gecko-dev build. A little look into this I saw the reason why it crash in [1] is the backend of DrawTarget was Cario. In current implementation, gecko doesn't support it.

[1]: https://dxr.mozilla.org/mozilla-central/source/gfx/2d/DrawTargetSkia.cpp#1077

More looked into it, why choosing Cairo as DrawTarget backend might track back when nsDisplayList::PaintRoot() with aFlags(0) was called. This aFlags caused gecko using BasicLayerManager witht Cairo backend. It seems that aFlags can be decided when RenderDocument() in [2] was called. renderDocFlags can determine whether gecko using BasicLayerManager or not.

[2]:https://dxr.mozilla.org/mozilla-central/source/dom/media/webrtc/MediaEngineTabVideoSource.cpp#323

IMHO, it might have two approaches.

1. Implement code and let gecko can BorrowCGContextFromDrawTarget with Cairo backend. At this moment I don't know if we can do this or not.
2. Try to have aFlag combinations and not using BasicLayerManager but ClientLayerManager. For this, I have no idea how to decide this value.

:nical, could you please have input for what I saw. Please correct me if I got anything wrong. Thanks
Flags: needinfo?(nical.bugzilla)
3. Stop defaulting to cairo when we need a software backend. Unfortunately we can't blindly replace cairo by skia everywhere due to a few but nasty details such as the way the unused channel in the BGRX format is treated, and maybe some font stuff.

We should add something like gfxPlatform::GetSoftwareContentBackend() which would return the default content backend (either cairo or skia depending on the platform), and use that instead of hard-coding cairo every time we want a software backend. Or just acknowledge that Skia is soon going to be our only software backend and hard-code skia everywhere we currently hard-code cairo.

Lee, what do you think?

I am not sure it would make sense to use ClientLayerManager with MediaEngineTabVideoSource, because the latter is used to render a tab into a video stream, so we probably want the content of the rendered frame in the content process, in order to encode it there (I haven't checked).
Flags: needinfo?(nical.bugzilla) → needinfo?(lsalzman)
(In reply to Nicolas Silva [:nical] from comment #3)
> Lee, what do you think?
> 
> I am not sure it would make sense to use ClientLayerManager with
> MediaEngineTabVideoSource, because the latter is used to render a tab into a
> video stream, so we probably want the content of the rendered frame in the
> content process, in order to encode it there (I haven't checked).

In most cases, it will be encoded and not otherwise used locally.  In a few cases it might be dumped into a canvas or a video element (or dumped there in addition to being encoded).

For encoding, almost all encoders are in content space (and in SW) currently; we are adding some support for HW encoders now. I don't see a need to optimize this case for that use.
(In reply to Nicolas Silva [:nical] from comment #3)
> 3. Stop defaulting to cairo when we need a software backend. Unfortunately
> we can't blindly replace cairo by skia everywhere due to a few but nasty
> details such as the way the unused channel in the BGRX format is treated,
> and maybe some font stuff.
> 
> We should add something like gfxPlatform::GetSoftwareContentBackend() which
> would return the default content backend (either cairo or skia depending on
> the platform), and use that instead of hard-coding cairo every time we want
> a software backend. Or just acknowledge that Skia is soon going to be our
> only software backend and hard-code skia everywhere we currently hard-code
> cairo.
> 
> Lee, what do you think?
> 
> I am not sure it would make sense to use ClientLayerManager with
> MediaEngineTabVideoSource, because the latter is used to render a tab into a
> video stream, so we probably want the content of the rendered frame in the
> content process, in order to encode it there (I haven't checked).

In an ideal world, we'd just assume everything is Skia. But since Windows is still a work-in-progress holdout, and there are tier-3 (big-endian) platforms that build without Skia, I'd advise we just go with the gfxPlatform::GetSoftwareContentBackend() idea so everyone is happy.
Flags: needinfo?(lsalzman)
Keywords: assertion
(In reply to Nicolas Silva [:nical] from comment #3)

> We should add something like gfxPlatform::GetSoftwareContentBackend() which
> would return the default content backend (either cairo or skia depending on
> the platform), and use that instead of hard-coding cairo every time we want
> a software backend. Or just acknowledge that Skia is soon going to be our
> only software backend and hard-code skia everywhere we currently hard-code
> cairo.

Your idea is great for the case adding something like gfxPlatform::GetSoftwareContentBackend()to replace hard-code cairo. But some platforms like Windows and Linux are using Cario as their default Content backend. Does gfxPlatform::GetSoftwareContentBackend() fix this issue on all platforms?
Flags: needinfo?(nical.bugzilla)
(In reply to Vincent Liu[:vliu] from comment #6)
> Your idea is great for the case adding something like
> gfxPlatform::GetSoftwareContentBackend()to replace hard-code cairo. But some
> platforms like Windows and Linux are using Cario as their default Content
> backend. Does gfxPlatform::GetSoftwareContentBackend() fix this issue on all
> platforms?

Yes, the idea is to default to the content backend we would be using if acceleration was disabled. So platforms that default to cairo would get cairo, and platforms that favor skia over cairo would get to skia. I have a few patches that I am trying out locally, I'll upload them in bug 1309200 soon.
Flags: needinfo?(nical.bugzilla)
Priority: -- → P3
Whiteboard: [gfx-noted]
(In reply to Nicolas Silva [:nical] from comment #7)
> (In reply to Vincent Liu[:vliu] from comment #6)
> > Your idea is great for the case adding something like
> > gfxPlatform::GetSoftwareContentBackend()to replace hard-code cairo. But some
> > platforms like Windows and Linux are using Cario as their default Content
> > backend. Does gfxPlatform::GetSoftwareContentBackend() fix this issue on all
> > platforms?
> 
> Yes, the idea is to default to the content backend we would be using if
> acceleration was disabled. So platforms that default to cairo would get
> cairo, and platforms that favor skia over cairo would get to skia. I have a
> few patches that I am trying out locally, I'll upload them in bug 1309200
> soon.

Thanks for the reply. I will fix this issue when the patch in bug 1309200 is done.
Assignee: nobody → vliu
See Also: → 1310064

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: vincent.liu1013 → nobody
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.