Граф коммитов

73 Коммитов

Автор SHA1 Сообщение Дата
Martin Stransky ae1cc485f3 Bug 1581748 - [Wayland] Fixed rendering of overlapping areas, r=jhorak
- 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
2019-09-17 13:26:36 +00:00
Martin Stransky 4b928e7b91 Bug 1580152 - [Wayland] Fix rendering glitches on wayland , r=jhorak
- 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
2019-09-17 12:34:28 +00:00
Martin Stransky eee009c581 Bug 1579849 - [Wayland] Optimize cached rendering to wl_buffer for widget.wayland_cache_mode=1, r=jhorak
- 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
2019-09-11 15:32:48 +00:00
Martin Stransky 71d17fbe95 Bug 1579823 - [Wayland] remove __PRETTY_FUNCTION__ from wayland logs as it produces too long function names, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D45173

--HG--
extra : moz-landing-system : lando
2019-09-09 12:42:30 +00:00
Martin Stransky 6dbfafeb2f Bug 1579794 - [Wayland] Explicitly enable/disable direct rendering to wl_buffer, r=jhorak
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
2019-09-09 13:04:26 +00:00
Martin Stransky 2ba6437bbb Bug 1579794 - [Wayland] Use wl_surface_damage_buffer() and require wl_compositor v.4, r=jhorak
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
2019-09-10 07:58:56 +00:00
Martin Stransky 7a6c6dc9d7 Bug 1579794 - [Wayland] Copy pixel data for cached images, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D45165

--HG--
extra : moz-landing-system : lando
2019-09-10 08:09:57 +00:00
Martin Stransky 145616c1c1 Bug 1576904 [Wayland] Add WaylandDMABufSurface GL binding ability, r=jhorak
- 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
2019-09-03 09:41:32 +00:00
Martin Stransky 7ec25f9853 Bug 1577024 - [Wayland] Enable experimental wayland backend modes by widget.wayland_cache_mode pref, r=jhorak
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
2019-08-31 00:19:03 +03:00
Martin Stransky 89132239ea Bug 1574036 - [Wayland] Fix flickering during window resize, r=jhorak
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
2019-08-27 12:33:25 +00:00
Martin Stransky 6354d2287a Bug 1567434 - [Wayland] Don't use gtk_window_get_transient_for() to get parent toplevel window, r=jhorak
- 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
2019-08-05 10:37:21 +00:00
Brindusan Cristian c00617be71 Backed out 2 changesets (bug 1567434) for build bustages at nsWindow.cpp:3587:53. CLOSED TREE
Backed out changeset 10925a6df9b3 (bug 1567434)
Backed out changeset 1cd94e91245c (bug 1567434)
2019-08-05 12:23:04 +03:00
Martin Stransky 99f4b257a1 Bug 1567434 - [Wayland] Don't use gtk_window_get_transient_for() to get parent toplevel window, r=jhorak
- 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
2019-08-05 08:39:53 +00:00
Martin Stransky 91bbb7f0d9 Bug 1562023 - [Wayland] Factorize out DMABUF setup, r=ashie
Differential Revision: https://phabricator.services.mozilla.com/D36420

--HG--
extra : moz-landing-system : lando
2019-07-01 08:55:03 +00:00
Martin Stransky df9765aca2 Bug 1561883 - [Wayland] Provide WaylandDisplayGetWLDisplay() to directly get wl_display, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D36183

--HG--
extra : moz-landing-system : lando
2019-07-01 06:38:32 +00:00
Gurzau Raul 125bf10273 Backed out changeset 460bb9bef9c3 (bug 1561883) for build bustage at nsWaylandDisplay.h on a CLOSED TREE. 2019-06-29 14:24:34 +03:00
Martin Stransky 450f08a255 Bug 1561883 - [Wayland] Provide WaylandDisplayGetWLDisplay() to directly get wl_display, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D36183

--HG--
extra : moz-landing-system : lando
2019-06-28 14:58:55 +00:00
Martin Stransky f1bbfe6ec3 Bug 1557265 - Remove HAVE_LIBDRM defines as libdrm is mandatory now, r=glandium
Depends on D33918

Differential Revision: https://phabricator.services.mozilla.com/D34857

--HG--
extra : moz-landing-system : lando
2019-06-20 21:52:40 +00:00
Noemi Erli 509cc39c0f Backed out 3 changesets (bug 1557265) for causing Linux bustages CLOSED TREE
Backed out changeset 5e797f74091a (bug 1557265)
Backed out changeset f10c947516e0 (bug 1557265)
Backed out changeset f7e5ef31a50b (bug 1557265)
2019-06-20 22:13:33 +03:00
Martin Stransky e11e5a22b9 Bug 1557265 - Remove HAVE_LIBDRM defines as libdrm is mandatory now, r=glandium
Depends on D33918

Differential Revision: https://phabricator.services.mozilla.com/D34857

--HG--
extra : moz-landing-system : lando
2019-06-20 18:05:27 +00:00
Daniel Varga a50d7d7a01 Backed out 3 changesets (bug 1557265) for build bustage at /obj-firefox/dist/include/mozilla/widget/nsWaylandDisplay.h. On a CLOSED TREE
Backed out changeset 7b180f98ba3e (bug 1557265)
Backed out changeset 0739231e0456 (bug 1557265)
Backed out changeset 5fc2424b9085 (bug 1557265)

--HG--
extra : rebase_source : b681bd09fc7b066f8caf157c6990927755a44d36
2019-06-20 03:34:20 +03:00
Martin Stransky 6d7a459e88 Bug 1557265 - Remove HAVE_LIBDRM defines as libdrm is mandatory now, r=glandium
Depends on D33918

Differential Revision: https://phabricator.services.mozilla.com/D34857

--HG--
extra : moz-landing-system : lando
2019-06-19 21:55:35 +00:00
Martin Stransky 6ada4a5f73 Bug 1555899 - [Wayland] Don't wait to fullscreen update as it can block forever, r=jhorak"
- Don't block all drawing until whole screen was painted, clear the screen and
allow partial drawing instead.
- Detect window resize and allow partial drawing directly to wayland buffer in this case.
- Remove backbuffer copy - wait to buffer release instead.

Depends on D33910

Differential Revision: https://phabricator.services.mozilla.com/D33911

--HG--
extra : moz-landing-system : lando
2019-06-11 20:38:56 +00:00
Martin Stransky d9c5ad8e86 Bug 1555899 - [Wayland] Added more wayland logging, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D33910

--HG--
extra : moz-landing-system : lando
2019-06-11 20:38:44 +00:00
Martin Stransky 2c519e8d1b Bug 1557266 - [Wayland] Use widget.wayland_dmabuf_backend.enabled preference to enable wayland dmabuf backend, r=jhorak
- Add widget.wayland_dmabuf_backend.enabled
- Expose it to Wayland backend by WaylandDisplay object
- Add more logging to Wayland DMABuf backend

Differential Revision: https://phabricator.services.mozilla.com/D33919

--HG--
extra : moz-landing-system : lando
2019-06-10 12:37:06 +00:00
Dorel Luca 486b17b628 Backed out 2 changesets (bug 1555899) for Build bustage. CLOSED TREE
Backed out changeset 2de31fc4c99c (bug 1555899)
Backed out changeset 335510024f81 (bug 1555899)
2019-06-08 00:37:35 +03:00
Dorel Luca f304631202 Backed out changeset 37138554f34a (bug 1557266) for Build bustage in /builds/worker/workspace/build/src/widget/gtk/WindowSurfaceWayland.cpp. CLOSED TREE 2019-06-08 00:31:56 +03:00
Martin Stransky 5d9ce4b333 Bug 1557266 - [Wayland] Use widget.wayland_dmabuf_backend.enabled preference to enable wayland dmabuf backend, r=jhorak
- Add widget.wayland_dmabuf_backend.enabled
- Expose it to Wayland backend by WaylandDisplay object
- Add more logging to Wayland DMABuf backend

Differential Revision: https://phabricator.services.mozilla.com/D33919

--HG--
extra : moz-landing-system : lando
2019-06-07 14:34:25 +00:00
Martin Stransky 355ef12f87 Bug 1555899 - [Wayland] Don't wait to fullscreen update as it can block forever, r=jhorak"
- Don't block all drawing until whole screen was painted, clear the screen and
allow partial drawing instead.
- Detect window resize and allow partial drawing directly to wayland buffer in this case.
- Remove backbuffer copy - wait to buffer release instead.

Depends on D33910

Differential Revision: https://phabricator.services.mozilla.com/D33911

--HG--
extra : moz-landing-system : lando
2019-06-07 14:28:31 +00:00
Martin Stransky 6b29386225 Bug 1555899 - [Wayland] Added more wayland logging, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D33910

--HG--
extra : moz-landing-system : lando
2019-06-06 09:38:28 +00:00
Martin Stransky ce7abe5c5c Bug 1534936 - [Wayland] Clear transparent popup window background, r=jhorak
When transparent popup window is rendered clear window background to clear
visual artifacts and bold shadows over the popup.

Differential Revision: https://phabricator.services.mozilla.com/D33155

--HG--
extra : moz-landing-system : lando
2019-05-31 13:26:58 +00:00
Jan Horak 89fcedf92d Bug 1555653 Fix asserts in WindowBackBufferShm; r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D33147

--HG--
extra : moz-landing-system : lando
2019-05-30 11:33:29 +00:00
Martin Stransky eb09749a72 Bug 1554525 - [Wayland] Implement WindowBackBufferDMABuf backend for Wayland renderer, r=jhorak
- Rename recent WindowBackBuffer class to WindowBackBufferShm to clearly state that it uses Shm memory to store the pixel buffer.
- Implement WindowBackBufferDMABuf which stores pixel data in GPU memory in WaylandDMABufSurface object.
- Use WaylandDMABufSurface as a wayland backend when DMABuf is available and gfx.wayland_dmabuf_backend.enabled is set.
- Implement WindowImageSurface which temporary stores front buffer pixel data. It's used when front buffer is used by compositor and we want to draw.
  Instead of the front/back buffer flip and read-back data from front buffer, don't flip, store the drawing and draw the pixels when compositor
  releases the front buffer.

Differential Revision: https://phabricator.services.mozilla.com/D32635

--HG--
extra : moz-landing-system : lando
2019-05-29 12:50:18 +00:00
Kenny Levinsen 6bb9951cf7 Bug 1467127 - Post wl_display_dispatch_queue_pending tasks from ProcessNextNativeEvent. r=stransky
Send tasks to dispatch our other wayland event queues from their respective threads whenever we service the GTK main event loop.

Differential Revision: https://phabricator.services.mozilla.com/D28819

--HG--
extra : moz-landing-system : lando
2019-04-30 09:37:37 +00:00
Martin Stransky b74e545b1d Bug 1546669 - [Wayland] Update WindowSurfaceWayland::CalcRectScale() for higher scales (3+), r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D28653

--HG--
extra : moz-landing-system : lando
2019-04-24 19:30:58 +00:00
Sylvestre Ledru 7f60810d86 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D27245

--HG--
extra : moz-landing-system : lando
2019-04-12 13:14:25 +00:00
Martin Stransky f8f3c43a24 Bug 1508378 - Fix round error when damage rect size/position is odd number and scale factor is used, r=lsalzman
We have rendering artifacts when sceen scale is set and damage size/position is odd number.
It's caused by round error so update the size/position accordingly.

Differential Revision: https://phabricator.services.mozilla.com/D26903

--HG--
extra : moz-landing-system : lando
2019-04-10 14:17:28 +00:00
Martin Stransky 1ffeea40ca Bug 1517205 - Make nsWaylandDisplay() global, r=lsalzman
Lazilly create nsWaylandDisplay objects and remove them at Firefox quit.

nsWaylandDisplay objects should stay as global objects and don't be created/released.
The creation/removal wastes resources on server side as the wl_registry objects at nsWaylandDisplay has to be stored at server
side and can't be removed until firefox ends [1] anyway.

Also the removed nsWaylandDisplay causes crashes when display
topology changes due to the global nature of the wl_registry.

[1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_registry

Differential Revision: https://phabricator.services.mozilla.com/D26673

--HG--
extra : moz-landing-system : lando
2019-04-09 21:39:51 +00:00
Martin Stransky 706514741c Bug 1468911 - [Wayland] Visible artifacts during window resize, r=ashie
When wayland surface is newly created or resized,
postpone buffer commit (drawing) until gecko updates whole screen
and don't publish partial updates.

Differential Revision: https://phabricator.services.mozilla.com/D23857

--HG--
extra : moz-landing-system : lando
2019-03-23 03:02:24 +00:00
Martin Stransky 0961433659 Bug 1536099 - [Wayland] Provide logging to Wayland surface, r=ashie
Differential Revision: https://phabricator.services.mozilla.com/D23854

--HG--
extra : moz-landing-system : lando
2019-03-23 02:53:07 +00:00
Martin Stransky d704841235 Bug 1519355 - [Wayland] Produce better error message when mozilla::widget::WaylandShmPool::CreateTemporaryFile() fails, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D16297

--HG--
extra : moz-landing-system : lando
2019-01-11 15:15:10 +00:00
Tooru Fujisawa 7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Martin Stransky 786a526298 Bug 1507475 - [Wayland] Implement global wayland registry, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D12255

--HG--
extra : moz-landing-system : lando
2018-11-23 07:04:16 +00:00
Noemi Erli c00dbe5749 Backed out changeset bafd708f5788 (bug 1507475) for bustages in builds/worker/workspace/build/src/widget/gtk/mozcontainer.cpp CLOSED TREE 2018-11-22 20:09:34 +02:00
Martin Stransky d78c51a229 Bug 1507475 - [Wayland] Implement global wayland registry, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D12255

--HG--
extra : moz-landing-system : lando
2018-11-22 13:24:09 +00:00
Martin Stransky b18cbdec0a Bug 1505743 - [Wayland] Clear Wayland buffer when GtkWindow is mapped. r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D11999

--HG--
extra : moz-landing-system : lando
2018-11-20 15:39:32 +00:00
Narcis Beleuzu 67221429e3 Backed out changeset 06d83f08f7a0 (bug 1505164) for bustages on WindowSurfaceWayland.cpp . CLOSED TREE 2018-11-15 22:47:57 +02:00
Martin Stransky dc82a88ccf Bug 1505164 - Express explicit wailand interface versions r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D11757

--HG--
extra : moz-landing-system : lando
2018-11-15 14:52:04 +00:00
Martin Stransky 4e638efc71 Bug 1505307 - Don't use nsCOMPtr array to track Wayland display connections, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D11477

--HG--
extra : moz-landing-system : lando
2018-11-09 14:50:29 +00:00