Closed Bug 1337369 Opened 7 years ago Closed 7 years ago

Wayland - implement subsurface to draw to mozcontainer

Categories

(Core :: Widget: Gtk, defect, P2)

All
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox54 --- affected
firefox58 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

(Whiteboard: tpi:+)

Attachments

(5 files)

We use GdkWindow from mozcontainer to draw when CSD or Wayland is enabled. It means that the mShell's GdkWindow is used by GDK to draw decorations (usually shadows) and main firefox window is rendered to mContainer which is nested in mShell.

To draw asynchronously (off-main thread) we can no more draw directly to GdkWindow owned by mContainer. This GdkWindow (and its wl_surface) is owned by Gdk and it's updated by Gdk internals from main thread.

Instead we create wl_subsurface which overlays whole mContainer and attach it as child of wl_surface owned by mContainer. The wl_subsurface is owned by us, it's not touched by Gdk and can be drawn off main thread without any collision/deadlock.
Attached patch wipSplinter Review
WIP patch. Bug 1299083 has to be sorted out first.
Depends on: 1299083
Priority: -- → P3
Whiteboard: tpi:+
Depends on: 1341296
Assignee: nobody → stransky
Priority: P3 → P2
Comment on attachment 8921448 [details]
Bug 1337369 - [Wayland] query wayland registry to get wl_subcompositor for mozcontainer,

https://reviewboard.mozilla.org/r/192486/#review199938
Attachment #8921448 - Flags: review?(jhorak) → review+
Comment on attachment 8921449 [details]
Bug 1337369 - [Wayland] add routines to map/unmap wl_surface as overlay for MozContainer,

https://reviewboard.mozilla.org/r/192488/#review199940
Attachment #8921449 - Flags: review?(jhorak) → review+
Comment on attachment 8921450 [details]
Bug 1337369 - [Wayland] map/unmap overlay MozContainer wl_surface when running on Wayland,

https://reviewboard.mozilla.org/r/192490/#review199942
Attachment #8921450 - Flags: review?(jhorak) → review+
Comment on attachment 8921451 [details]
Bug 1337369 - [Wayland] Expose moz_container_get_wl_surface() to get MozContainer overlayfrom compositor widget,

https://reviewboard.mozilla.org/r/192492/#review199944
Attachment #8921451 - Flags: review?(jhorak) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b63c7bc7b0b1
[Wayland] query wayland registry to get wl_subcompositor for mozcontainer, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/8afcd32835fc
[Wayland] add routines to map/unmap wl_surface as overlay for MozContainer, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/63ab95c187d4
[Wayland] map/unmap overlay MozContainer wl_surface when running on Wayland, r=jhorak
https://hg.mozilla.org/integration/autoland/rev/a6aab759a52f
[Wayland] Expose moz_container_get_wl_surface() to get MozContainer overlayfrom compositor widget, r=jhorak
Keywords: checkin-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: