Commit Graph

18 Commits

Author SHA1 Message Date
Martin Stransky
d0936bdcf2 Bug 1467128 - [Wayland] Get VSync from Gtk/Wayland, r=lsalzman
VSync on Wayland is a bit tricky as we can get only "last VSync" event signal with
CLOCK_MONOTONIC timestamp or none (if application is hidden/minimized).

That means we should draw a next frame at "last Vsync + frame delay" time and also
approximate next VSync event when we don't get any.

MozReview-Commit-ID: FI3Z4nkmDNK
2018-06-29 13:15:41 +02:00
Martin Stransky
d5e66af3e5 Bug 1467125 - [Wayland] Get events from Wayland display faster on compositor thread, r=jhorak
MozReview-Commit-ID: AmarsYA2INc
2018-06-06 15:25:15 +02:00
Martin Stransky
338daa396b Bug 1441743 - [Wayland] Don't draw directly to frame buffer for partial window updates, r=jhorak
When only a part of window is updated we need to clip that drawing.
We use image surface for that as WindowSurfaceX11Image does.

MozReview-Commit-ID: 13znE1ZszB8
2018-06-15 09:41:56 +02:00
Jan Horak
f82532e89c Bug 1431337 - Scale content for the actual monitor, not the first one; r=stransky
We need to use scaling factor of the monitor on which application is actually positioned.
Previously we used ScreenHelperGTK::GetGTKMonitorScaleFactor() which use the first monitor.
This does not work on hidpi+normal dpi monitors setup.

The GetSystemFontInfo() cannot return scaled value of the font by default monitor
scale factor. We need to scale it in nsLookAndFeel::GetFontImpl
by aDevPixPerCSSPixel like implementation for Windows does.

We also need to check layout.css.devPixelsPerPx because we cannot
scale per monitor when this preference is set to positive number.

MozReview-Commit-ID: AwT2NvkEqvz
2018-01-18 11:52:59 +01:00
Andreea Pavel
dde1c0fec7 Backed out changeset cf44885dc2ac (bug 1431337) for failing mochitest browser chrome at browser/base/content/test/performance/browser_startup_images.js on a CLOSED TREE 2018-02-15 16:03:40 +02:00
Jan Horak
e64b2123e5 Bug 1431337 - Scale content for the actual monitor, not the first one; r=stransky
We need to use scaling factor of the monitor on which application is actually positioned.
Previously we used ScreenHelperGTK::GetGTKMonitorScaleFactor() which use the first monitor.
This does not work on hidpi+normal dpi monitors setup.

The GetSystemFontInfo() cannot return scaled value of the font by default monitor
scale factor. We need to scale it in nsLookAndFeel::GetFontImpl
by aDevPixPerCSSPixel like implementation for Windows does.

We also need to check layout.css.devPixelsPerPx because we cannot
scale per monitor when this preference is set to positive number.

MozReview-Commit-ID: AwT2NvkEqvz
2018-01-18 11:52:59 +01:00
Martin Stransky
d3d4827b74 Bug 1435244 - don't call wl_display_roundtrip_queue() with null wl_queue but rather use wl_display_roundtrip(), r=jhorak
MozReview-Commit-ID: BQzAuCFJgBS
2018-02-02 14:42:32 +01:00
Martin Stransky
48461b0383 Bug 1430018 - Add runnable function name to NewRunnableFunction() calls, r=jhorak
MozReview-Commit-ID: CmN0U8WH8De
2018-01-12 10:33:28 +01:00
Martin Stransky
9793925005 Bug 1426351 - WindowSurfaceWayland - delete WaylandDisplay owned by compositor thread at compositor thread, r=jhorak
MozReview-Commit-ID: 6jtdXuiTj1F
2017-12-20 14:18:18 +01:00
Martin Stransky
fb5aa0db50 Bug 1426377 - Assert when aImageDataSize is bigger than allocated pool size, r=jhorak
MozReview-Commit-ID: DSMb5W2bGd0
2017-12-20 15:47:08 +01:00
Martin Stransky
34a54a2507 Bug 1425820 - build fix of SetImageDataFromBackBuffer definition/call, r=jhorak
MozReview-Commit-ID: 7NJMCdhd400
2017-12-18 11:53:30 +01:00
Martin Stransky
3195250269 Bug 1422966 - Implement SurfaceWayland for Wayland, r=jhorak
WindowSurfaceWayland is Wayland implementation of WindowSurface class.
One WindowSurfaceWayland object manages drawing of one nsWindow so
those are tied 1:1. It implements base Lock() and Commit() interfaces
from WindowSurface. At Wayland side it represents one wl_surface object.

To perform visualiation of nsWindow, WindowSurfaceWayland contains
one wl_surface and two wl_buffer (by WindowBackBuffer) objects
(as we use double buffering). When nsWindow drawing is finished to
wl_buffer, the wl_buffer is attached to wl_surface and it's sent to
Wayland compositor.

MozReview-Commit-ID: 9NoamtF87e6
2017-12-04 22:29:08 +01:00
Martin Stransky
bf1bdce7ad Bug 1422966 - implemented WindowBackBuffer to encapsulate wl_buffer, r=jhorak
wl_buffer is a main Wayland object with graphics data. wl_buffer basically represent one complete window screen.
When double buffering is involved every window (GdkWindow in our case) utilises two wl_buffers which are cycled.
One is filed with data by application and one is rendered by compositor.

WindowBackBuffer class manages one wl_buffer. It owns wl_buffer object, owns WaylandShmPool (which provides shared memory)
and ties them together.

MozReview-Commit-ID: v8Hlezo7oD
2017-12-04 22:25:26 +01:00
Martin Stransky
fa28d4d496 Bug 1422966 - implement WaylandShmPool to manage shared memory for wl_buffer, r=jhorak
We allocate shared memory (shm) by mmap(..., MAP_SHARED,...) as an interface between wayland based application
and wayland compositor. We draw our graphics data to the shm and handle to wayland compositor by wl_buffer/wl_surface.

WaylandShmPool acts as a manager of the allocated memory. Allocates it, holds reference to it and releases it.

MozReview-Commit-ID: CY6oEIl4Vxa
2017-12-04 22:22:04 +01:00
Martin Stransky
1b7211d83d Bug 1422966 - Update mDisplay attribute initialization at nsWaylandDisplay::nsWaylandDisplay(), r=jhorak
MozReview-Commit-ID: GQrCtvKDjfF
2017-12-04 22:31:23 +01:00
Martin Stransky
801a48b426 Bug 1422966 - Comment Wayland rendering scheme, r=jhorak
MozReview-Commit-ID: 7ZV97xcRskV
2017-12-05 10:12:37 +01:00
Martin Stransky
2a421711f7 Bug 1281425 - Implement wayland loop to process wl_display events for threads and bind wl_registry for wl_shm, r=jhorak
MozReview-Commit-ID: 1pS1wfOiOo4
2017-11-02 17:08:33 +01:00
Martin Stransky
3e7afd36fb Bug 1281425 - Added nsWaylandDisplay class to support access to Wayland display, r=jhorak
MozReview-Commit-ID: 6IU5hS15MmM
2017-10-26 20:19:36 +02:00