- moz_container_wayland_get_surface() is replaced by moz_container_wayland_surface_lock()/moz_container_wayland_surface_unlock()
pair which ensures the surface is locked and won't be destroyed by other thread when window is hidden for instance.
- nsWindow::GetWaylandSurface() is removed and nsWindow::GetMozContainer() needs to be used instead.
Differential Revision: https://phabricator.services.mozilla.com/D77698
This patch implements:
- Global surface UID for better tracking/debugging. The UID is passes acros all processes so we can track
surface usage.
- WaylandAllocateShmMemory() function which uses shm_open() instead of files at tmp for Shm memory creation.
- DMABufRefcount() class based on eventfd() which is used as a global surface reference count.
Differential Revision: https://phabricator.services.mozilla.com/D76689
- Calculate size of wl_buffer as an intersection of widget size and nsWindow bound size.
We can't use wl_buffer bigger than nsWindow bound as it leads to rendering artifacts.
Differential Revision: https://phabricator.services.mozilla.com/D69716
--HG--
extra : moz-landing-system : lando
Mutter 3.36 requests exact match of wl_surface/wl_subsurface size so we need to respect
wl_surface size (GtkWidget size) and create a wl_subsurface with the same size.
Differential Revision: https://phabricator.services.mozilla.com/D67137
--HG--
extra : moz-landing-system : lando
We need WaylandDMABufSurface to hold both RGBA and YUV surfaces co create WaylandDMABufSurface as a base
class and derive WaylandDMABufSurfaceRGBA from it.
Differential Revision: https://phabricator.services.mozilla.com/D62001
--HG--
extra : moz-landing-system : lando
The window position of the popup can be changed which does not mean that the
screen size changed. Only window dimmensions are relevant there. Also as part of this
fix, don't use HideWaylandWindow when calling gdk_window_move_to_rect because it removes
the popup from gVisibleWaylandPopupWindows which breaks popup hierarchy sometimes.
Differential Revision: https://phabricator.services.mozilla.com/D60419
--HG--
extra : moz-landing-system : lando
Lets Wayland sessions run vsync off wayland surface frame callbacks by creating
an interface for widgets to return a local VsyncSource, if applicable.
This interface is currently used for the compositor, and for refresh drivers
in the parent process. It is not yet used for vsync in content processes.
Differential Revision: https://phabricator.services.mozilla.com/D28430
--HG--
extra : moz-landing-system : lando
Remove moz_container_get_scale() and use only nsWindow::GdkScaleFactor() to get scale factor for wl_surface and wl_egl_window.
Always set the scale factor when wl_surface / wl_egl_window is queued for rendering.
Differential Revision: https://phabricator.services.mozilla.com/D51252
--HG--
extra : moz-landing-system : lando
Add IsDMABufBuffer identification to WindowBackBuffer
Use two sets of wayland buffers (shm and dmabuf) and use dmabuf for fullscreen updates only
when dmabuf is enabled.
Split GetWaylandBufferToDraw() to GetWaylandBufferRecent() and GetWaylandBufferWithSwitch()
to better reflect actual function.
Add CreateWaylandBuffer() to create and store Wayland buffer and use it at SetNewWaylandBuffer()
to change an active wayland buffer or create a new one.
When CACHE_MISSING image cache is selected we draw directly to wayland buffer if it's available
and cache drawing when wayland buffer is missing only. That produces flickering when small buffer parts are
sent to compositor early and the buffer is blocked for further rendering.
This patch enables direct rendering of bigger screen parts only (like page scrolling) to eliminate small
buffer updates.
Differential Revision: https://phabricator.services.mozilla.com/D50055
--HG--
extra : moz-landing-system : lando
- Don't store whole buffer update information at mWholeWindowBufferDamage but use damage region instead.
- Check and remove overlapped images when they are stored at image cache.
- Remove CanDrawToWaylandBufferDirectly() as it's not very useful.
This commit depends on Bug 1580152 which needs to land first.
Differential Revision: https://phabricator.services.mozilla.com/D46140
--HG--
extra : moz-landing-system : lando
- Recently we're missing some drawings as we disabled flushing cached images in frame callback. Let's enable it again and make sure we don't flush the drawings between Lock()/Commit() compositor calls which is controlled by mBufferCommitAllowed.
- When we draw directly to wl_buffer, flush all cached drawings we have or clear them if there's fullscreen update. It prevents potential rendering of cached images over unrelevant buffer content.
- Flush cached images when wl_buffer is detached by wayland compositor. It allows to paint delayed drawings and ensures they won't stay in the queue infinitely.
- Use mBufferPendingCommit to indicate that the WaylandBuffer contains updates from gecko which has not been submitted to wayland compositor yet. Allows delated commit handlers (frame callback, delayed commit and when wl_buffer is detached) to send WaylandBuffer content to wayland compositor.
- Record time of last finished commit to mLastCommitTime and throws warning when wayland compositor does not release wl_buffer in 200ms.
- Use wl_display_sync() to synchronize wl_display events. Wait for events from wl_display until all pending events are processed before we start drawing at WindowSurfaceWayland::Lock(). There may wl_buffer release event waiting which releases wl_buffer for rendering.
- Don't use XMost()/YMost() to get drawing area size.
- Remove mDisplayThreadMessageLoop as it's no longer used.
Differential Revision: https://phabricator.services.mozilla.com/D45661
--HG--
extra : moz-landing-system : lando
- When widget.wayland_cache_mode=1 use direct rendering to wl_buffer only when there isn't any
cached rendering pending and we're updating one big piece of screen (video playback/scrolling etc..)
- Disable frame callback commits between WindowSurfaceWayland::Lock and WindowSurfaceWayland::Commit
as the buffer can be updated by gecko compositor
Differential Revision: https://phabricator.services.mozilla.com/D45184
--HG--
extra : moz-landing-system : lando
Recently direct wl_buffer rendering is kept enabled until we have wl_buffer available which
produces rendering artifacts when screen damage rects overlaps.
Let's enable/disable it explicitly at every rendering cycle start to avoid
screen flickering.
Depends on D45166
Differential Revision: https://phabricator.services.mozilla.com/D45167
--HG--
extra : moz-landing-system : lando
Use wl_surface_damage_buffer() to propagate wl_buffer damage to avoid rounding errors and
rendering artifacts for HiDPI wl_buffers.
Depends on D45165
Differential Revision: https://phabricator.services.mozilla.com/D45166
--HG--
extra : moz-landing-system : lando
- Allow to create WaylandDMABufSurface with wl_buffer or EGLImage on top of it
- Disable dmabuf modifiers as they slow down the data upload
- Add ability to export/import WaylandDMABufSurface via. file descriptors
Differential Revision: https://phabricator.services.mozilla.com/D43609
--HG--
extra : moz-landing-system : lando
Image cache mode can be set by widget.wayland_cache_mode.
- widget.wayland_cache_mode = 0 (or missing):
Cache and clip all drawings, default. It's slowest
but also without any rendered artifacts.
- widget.wayland_cache_mode = 1:
Cache drawing only when back buffer is missing. May produce
some rendering artifacts and flickering when partial screen update
is rendered.
- widget.wayland_cache_mode = 2:
Don't cache anything, draw only when back buffer is available.
Suitable for fullscreen content only like fullscreen video playback and
may work well with dmabuf backend.
Differential Revision: https://phabricator.services.mozilla.com/D43681
Recently window resize on Wayland produces flickering/rendering artifacts because
window background is randomly cleared due to actual window size changes.
We recently query widget size and do clear/fullscreen update when the size changes.
To avoid that, get widget size once at WindowSurfaceWayland::Lock() and use it
until next WindowSurfaceWayland::Lock(). Also don't to switch wayland back buffers
until there's really fullscreen update from compositor.
This patch:
- Use mLockedScreenRect to store window size at WindowSurfaceWayland::Lock(). It's used
to detect widget resize, when it happens throw away all cached painting and wait for
full screen update.
- Use mBufferScreenRect to store size of wayland back buffer and pass it
instead of actual widget size we used before this patch. This ensures all our
drawing matches the buffer size.
- Rename aFullScreenUpdate to aCanSwitchBuffer at LockWaylandBuffer() to stress
actual meaning - we can/can't switch back buffers for partial drawing and we need to
wait until recent back buffer is released by compositor.
Differential Revision: https://phabricator.services.mozilla.com/D43263
--HG--
extra : moz-landing-system : lando
- gtk_window_get_transient_for() fails to return correct toplevel window as the toplevel window changes
when popup is moved in popup hierarchy. So store the toplevel given at nsWindow::Create() and
use it instead.
- Remove some redundat NS_WARNING() from wayland code
- Attach "moved-to-rect" signal handler to GdkWindow only once a update
NativeMoveResizeWaylandPopupCallback() loging.
- Add more logging to Wayland popup related code.
Differential Revision: https://phabricator.services.mozilla.com/D39347
--HG--
extra : moz-landing-system : lando
- gtk_window_get_transient_for() fails to return correct toplevel window as the toplevel window changes
when popup is moved in popup hierarchy. So store the toplevel given at nsWindow::Create() and
use it instead.
- Remove some redundat NS_WARNING() from wayland code
- Attach "moved-to-rect" signal handler to GdkWindow only once a update
NativeMoveResizeWaylandPopupCallback() loging.
- Add more logging to Wayland popup related code.
Differential Revision: https://phabricator.services.mozilla.com/D39347
--HG--
extra : moz-landing-system : lando