summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cogl tests: Show the actual output from tests if VERBOSE is setwip/smcv/cogl-show-test-outputSimon McVittie2020-05-271-1/+8
| | | | | | | | | | | | | | | | | | Writing tests' output to a log file makes them difficult to debug when the test might be running on an autobuilder or CI system where only stdout/stderr are recorded. This is particularly troublesome if a failure is only reproducible on a particular autobuilder. Recent Automake versions have the convention that detailed output from failing tests is written to stdout/stderr, not just to log files, when the VERBOSE environment variable is set; borrow that convention as a trigger for producing detailed test output. This was originally cogl!14, but applies equally to mutter's fork of cogl. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1273 Signed-off-by: Simon McVittie <smcv@debian.org>
* clutter/text: Also queue relayout if the actor has no valid allocationJonas Dreßler2020-05-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In clutter_text_queue_redraw_or_relayout() we check whether the size of the layout has changed and queue a relayout if it did, otherwise we only queue a redraw and save some resources. The current check for this also queues a redraw if the actor has no valid allocation. That seems right on the first glance since the actor will be allocated anyway, but we actually want to call clutter_actor_queue_relayout() again here because that also invalidates the size cache of the actor which might have been updated and marked valid in the meantime. So make sure the size cache is always properly invalidated after the size of the layout changed and also call clutter_actor_queue_relayout() in case the actor has no allocation. This fixes a bug where getting the preferred width of a non-allocated ClutterText, then changing the string of the ClutterText, and then getting the preferred width again would return the old cached width (the width before we changed the string). The only place where this bug is currently happening is in the overview, where we call get_preferred_width() on the unallocated ClutterText of the window clone title: When the window title changes while the ClutterText is unallocated the size of the title is going to be wrong and the text might end up ellipsized or too large. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1150
* wayland: Drive frame callbacks from stage updatesJonas Ådahl2020-05-2614-149/+122
| | | | | | | | | | | | | | | Don't tie frame callbacks to actor painting, as it may end up in situations where we miss sending frame callbacks when we should have. An example of this is when a surface is partially off screen, and then reports damage that is fully off screen. When this happen, we are likely not to repaint anything, thus we won't send any frame callbacks even though it's "suitable" for rendering again, as the surface is not on a separate workspace or fully obscured. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/817 Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1152 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
* wayland/compositor: Pass backend when constructingJonas Ådahl2020-05-264-4/+11
| | | | | | | This is so that it can be retrieved later without going via the global singleton. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
* Reshuffle Wayland initailizationJonas Ådahl2020-05-269-128/+214
| | | | | | | | | | | | | | Move Wayland support (i.e. the MetaWaylandCompositor object) made to be part of the backend. This is due to the fact that it is needed by the backend initialization, e.g. the Wayland EGLDisplay server support. The backend is changed to be more involved in Wayland and clutter initialization, so that the parts needed for clutter initialization happens before clutter itself initialization happens, and the rest happens after. This simplifies the setup a bit, as clutter and Wayland init now happens as part of the backend initialization. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
* surface-actor: Move out some X11-ism to X11 subclassJonas Ådahl2020-05-266-34/+20
| | | | | | | | | | | | | | | On X11 we don't update the texture in certain circumstances, such as if the surface is a fullscreen unredirect, or doesn't have a Pixmap. On Wayland we only want to avoid updating the texture if there is no texture, but as this is handled implicitly by MetashapedTexture, we don't need to try to emulate the X11-y conditions in the generic layer and instead just have the implementations handle update processing themself. This doesn't have any functional changes, but removes a vfunc from MetaSurfaceActorClass. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
* clutter/stage: Make clutter_stage_schedule_update() public APIJonas Ådahl2020-05-264-11/+13
| | | | | | | | | It's effectively used by mutter by abusing a ClutterTimeline to scedule updates. Timelines are not really suited in places that is done, as it is really just about getting a single new update scheduled whenever suitable, so expose the API so we can use it directly. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
* clutter/stage: Make clutter_stage_schedule_update() always scheduleJonas Ådahl2020-05-261-1/+9
| | | | | | | | | | | | | | | | We could call clutter_stage_schedule_update() and it wouldn't actually schedule anything, as the master frame clock only tries to reschedule if 1) there is an active timeline, 2) there are pending relayouts, 3) there are pending redraws, or 4) there are pending events. Thus, a call to clutter_stage_schedule_update() didn't have any effect if it was called at the wrong time. Fix this by adding a boolean state "needs_update" to the stage, set on clutter_stage_schedule_update() and cleared on _clutter_stage_do_update(), that will make the master clock reschedule an update if it is TRUE. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
* clutter/stage-cogl: Use view fb instead of onscreen fb for debug-drawingJonas Dreßler2020-05-261-1/+1
| | | | | | | | We need to use the framebuffer of the view instead of the onscreen framebuffer when painting the damage region, otherwise the redraw clips on rotated monitors won't be shown correctly. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-cogl: Remove unneeded helperJonas Ådahl2020-05-261-11/+2
| | | | | | The helper called a single function; lets just call it directly instead. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Add tile based shadow damage detectionJonas Ådahl2020-05-261-44/+431
| | | | | | | | | | | | | | | | | | | | Compare, tile by tile, whether actual damage actually changed any pixels. While this requires mmap():ing DMA buffers and comparing their content, we should only ever use shadow buffers when we're using the software renderer, meaning mmap() is cheap as it doesn't involve any downloading. This works by making the shadow framebuffer double buffered, while keeping track of damage history. When we're about to swap the onscreen buffer, we compare what part of the posted damage actually changed, records that into a damage history, then given the onscreen buffer age, collect all actual damage for that age. The intersection of these tiles, and the actual damage, is then used when blitting the shadow buffer to the onscreen framebuffer. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1157 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* cogl/dma-buf: Add mmap/munmap helpersJonas Ådahl2020-05-262-0/+50
| | | | | | Avoids dealing directly with mmap() and munmap(). https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* cogl/dma-buf: Add API to synchronize readingJonas Ådahl2020-05-263-0/+60
| | | | | | Used before and after accessing DMA buffer content using mmap(). https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-cogl: Extract damage history logicJonas Ådahl2020-05-264-34/+169
| | | | | | | | Move the damage history tracking to a new ClutterDamageHistory helper type. The aim is to be able to track damage history elsewhere without reimplementing the data structure and tracking logic. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Only blit the damage part of the shadow bufferJonas Ådahl2020-05-263-4/+40
| | | | | | | | | | This fixes the last "copy everything" paths when clutter doesn't directly paint onto the onscreen framebuffer. It adds a new hook into the stage view called before the swap buffer, as at this point, we have the swap buffer damag regions ready, which corresponds to the regions we must blit according to the damage reported to clutter. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-cogl: Only construct damage array if it'll be usedJonas Ådahl2020-05-261-14/+14
| | | | | | | It's only used when we actually swap buffers, which we only do if the target framebuffer is an onscreen. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Only paint redraw clip from offscreenJonas Ådahl2020-05-263-14/+82
| | | | | | | | | | The rest didn't change, so only actually paint the part of the offscreen that was composited as part of the stage painting. In practice, this means that, unless a shadow buffer is used, we now only paint the damaged part of the stage, and copy the damage part of the offscreen to the onscreen. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-cogl: Use buffer age when view monitor is rotatedJonas Ådahl2020-05-265-50/+64
| | | | | | | | | | | | | | We failed to use the buffer age when monitors were rotated, as when they are, we first composite to an offscreen framebuffer, then later again to the onscreen. The buffer age checking happened on the offscreen, and an offscreen being single buffered, they can't possible support buffer ages. Instead, move the buffer age check to check the actual onscreen framebuffer. The offscreen to onscreen painting is still always full frame, but that will be fixed in a later commit. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* region-utils: Make transform util const correctJonas Ådahl2020-05-262-2/+2
| | | | | | The input should be const, as it will not be altered. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Simplify painting of offscreen slightlyJonas Ådahl2020-05-261-34/+12
| | | | | | | We will only ever have an "offscreen" if we're painting transformed in some way, so the 'can_blit' checking is unnecessary. Remove it. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Always use cogl_blit_framebuffer() from shadowfbJonas Ådahl2020-05-261-21/+15
| | | | | | | | It should only be used when direct blitting is supported, so there is no reason we should have to deal with pipelines etc when blitting from the shadow buffer to the onscreen. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* renderer/native: Only enable shadowfbs if we can blitJonas Ådahl2020-05-261-0/+5
| | | | | | | There is no point in enabling shadow buffers if we can't as that'd be even slower than not having them at all. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* cogl: Make private BLIT_FRAMEBUFFER feature publicJonas Ådahl2020-05-268-10/+12
| | | | | | Will be a requirement for enabling shadow buffers. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Change set_dirty..() API to invalidate..()Jonas Ådahl2020-05-263-12/+8
| | | | | | | | The manual "cleaning" of the viewport and projection state is removed, and we only ever try to invalidate the state so that it'll be updated next time. Change the API used to reflect this. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Move fb viewport and projection setting to hereJonas Ådahl2020-05-263-10/+42
| | | | | | | | | The stage would fetch the front framebuffer and set the viewport and projection matrix, but if we are going to more than one front buffer, that won't work, so let the stage just pass the viewport and projection matrix to the view and have the view deal with the framebuffer(s). https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Move shadowfb struct fields into anonymous structJonas Ådahl2020-05-261-15/+17
| | | | | | | With the aim to collect shadow buffer related things in one place, place them in an anonymous struct. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* renderer-native: Move shadow fb construction to the stage viewJonas Ådahl2020-05-262-34/+106
| | | | | | | | The stage view will need a more involved approach to shadow buffers, in order to implement things such double buffered shadow buffers and damage detection. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* clutter/stage-view: Add name propertyJonas Ådahl2020-05-264-0/+22
| | | | | | | | | | Will be used for logging to identify what view a log entry concerns. For the native and nested backend this is the name of the output the CRTC is assigned to drive; for X11 it's just "X11 screen", and for the legacy "X11 screen" emulation mode of the nested backend it's called "legacy nested". https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* output: Add name getterJonas Ådahl2020-05-262-0/+8
| | | | | | This will return the name of the connector, e.g. DP-2. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* cogl/dma-buf-handle: Pass more metadata to handle constructorJonas Ådahl2020-05-263-4/+101
| | | | | | | Could be useful would one want to mmap the dmabuf and deal with its content manually in CPU space. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1237
* wayland/actor-surface: Don't notify geometry-changed on mapped changesJonas Dreßler2020-05-261-1/+4
| | | | | | | | There's no reason to notify the surface that its geometry changed when the visibility of the actor changes. This is only needed to update the outputs of the surface, so do that directly instead. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1235
* wayland/actor-surface: Factor in mapped clones in mapped checkJonas Dreßler2020-05-261-1/+2
| | | | | | | | | | | | | | | | | We started listening to notify::mapped with commit 5eb5f724347ae8d141ef38b36565169c60c53ab1 in order to emit wl_surface.leave events consistently when a surface gets hidden. This caused a problem with the ClutterClones used in the overview, since those temporarily map and unmap the windows for painting, spamming wl_surface.leave and enter events to all surfaces. We can easily fix that by also treating mapped clones as mapped, which means the surface should also be on a wl_output when the overview is shown. Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1141 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1235
* clutter/actor: Make has_mapped_clones() factor in parent actorsJonas Dreßler2020-05-262-30/+29
| | | | | | | | | | | | All existing users of clutter_actor_has_mapped_clones() actually want to know whether the actor is being cloned by a visible clone, it doesn't matter to them if that clone is attached to an actor somewhere else in the tree or to the actor itself. So make clutter_actor_has_mapped_clones() a bit more convenient to use and also check the clones of the parent-actors in that function. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1235
* wayland/actor-surface: Don't listen to notify::position signalJonas Dreßler2020-05-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | We started listening to "notify::position" on surface actors with commit 08e4cb54. This commit was done to fix a regression from commit cf1edff9, which forgot to handle some cases like the actual WindowActor and not the SurfaceActor (which is a child of the WindowActor) moving (that was fixed by listening to MetaWindows "position-changed" signal). Also that commit introduced meta_wayland_surface_update_outputs_recursively(), which updates the outputs of all (sub-)surfaces in case any position changed and made sure subsurfaces also get their outputs updated in case the parent actor moved. Connecting to the "notify::position" signal, which the above commit also did is now superflous though because position changes will queue a relayout and the actors allocation will change during the next allocation cycle, notifying the "allocation" property which we also listen to. So save some resources and stop listening to that signal. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1235
* clutter/actor: Use priv->allocation instead of get_allocation_box()Jonas Dreßler2020-05-231-14/+3
| | | | | | | | | | | | | The comment in _clutter_actor_get_allocation_clip() explicitely notices that it doesn't need the behavior of doing an immediate relayout as clutter_actor_get_allocation_box() does. The comment is also still valid since the code calling _clutter_actor_get_allocation_clip() checks for priv->needs_allocation just before. So let's just use the allocation directly here instead of going through that function. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1264
* native: Return an error if no drm devices are foundJonas Ådahl2020-05-221-0/+7
| | | | | | | Without this, we'll end up segfaulting when trying to log the non-existing error. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1217
* backend/xcursor: Support a "blank" cursor typeFlorian Müllner2020-05-222-0/+51
| | | | | | | | | | | | We don't have enough Xlib code in mutter ... Joking aside, it can be useful to make the cursor invisible without hiding it, for example for replacing the actual cursor with an actor in gnome-shell; the real cursor should still update the focus surface in that case, and not sneak into screenshots or -casts. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1244
* clutter: Use G_DECLARE_DERIVABLE_TYPE for ClutterAction and subclassesJonas Dreßler2020-05-226-160/+197
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/788
* clutter/actor-meta: Use G_DECLARE_DERIVABLE_TYPEJonas Dreßler2020-05-223-71/+100
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/788
* screen-cast-src: Notify about the stream being closed after dispatchJonas Ådahl2020-05-221-10/+21
| | | | | | | | | | | | | | We're iterating inside the PipeWire loop when detecting PipeWire errors, and shouldn't destroy the PipeWire objects mid-iteration. Avoid this by first disabling the stream src (effectively stopping the recording), then notifying about it being closed in an idle callback. The notification eventually makes the rest of the screen cast code clean up the objects, including the src and the associated PipeWire objects, but will do so outside the PipeWire loop iteration. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1251 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
* stage-x11: Move view management to rendererJonas Ådahl2020-05-224-41/+114
| | | | | | | | | | | | | | | | In the native backend, the MetaRenderer manages the view by creating one per CRTC, but until now the MetaStageX11 managed the view for the X11 backend. This caused some issues as it meant meta_renderer_get_views() not returning anything, and that the view of the X11 screen not being a MetaRendererView, while in the other backends, all views are. Fix this by moving the view management responsibility to MetaRendererX11Cm, and have MetaStageX11 only operate on it via meta_renderer_x11_cm_*() API. The MetaRendererX11Cm takes care of making sure the view is always added to the list in the renderer, and turning X11 screen sizes into "layouts" etc. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
* stage-x11: Clean up include macrosJonas Ådahl2020-05-221-3/+3
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
* screen-cast-stream-src: Don't throttle if max framerate is 1/0Jonas Ådahl2020-05-221-1/+2
| | | | | | | | | The max framerate 1/0 means variable without any particular max, so don't throttle if that was set. Not doing this would end up with a floating point exception. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
* renderer: Change 'set_legacy_view()' to 'add_view()'Jonas Ådahl2020-05-223-8/+7
| | | | | | | | "Legacy" is a misleading name, it's just how the native backend and the X11 backend behaves differently. Instead rename it to 'add_view()' and add the sanity check to the caller. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
* wayland/dma-buf: Make gbm_bo import function better namedJonas Ådahl2020-05-211-5/+5
| | | | | | | It imports a DMA buffer as a gbm_bo, but only if it can be used to scan it out, so name it import_scanout_gbm_bo(). https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1261
* wayland/dma-buf: Handle failing to import scanout DMA bufferJonas Ådahl2020-05-211-0/+5
| | | | | | | | A DMA buffer might not be able to scanout, and in that case the import with GBM_BO_USE_SCANOUT will fail. Handle that by failing to scanout, effectively falling back to compositing. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1261
* window: Add a note about the trustworthiness of the client PIDJonas Dreßler2020-05-211-0/+3
| | | | | | | | | | | | Since PIDs are inherently insecure because they are reused after a certain amount of processes was started, it's possible the client PID was spoofed by the client. So make sure users of the meta_window_get_pid() API are aware of those issues and add a note to the documentation that the PID can not be totally trusted. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1180
* window: Cache the client PIDJonas Dreßler2020-05-212-1/+8
| | | | | | | | Since the PID of a window can't change as long as the window exists, we can safely cache it after we got a valid PID once, so do that by adding a new `window->client_pid` private property. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1180
* window: Return pid_t in meta_window_get_pid()Jonas Dreßler2020-05-212-5/+5
| | | | | | | | Just as with the last commit, pid_t is compatible with all platforms and we should use that everywhere, so also make meta_window_get_pid() return a pid_t. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1180
* window: Use pid_t for get_client_pid() vfuncJonas Dreßler2020-05-214-7/+7
| | | | | | | It makes sense to use pid_t when getting the PID since that will work on all platforms and architectures. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1180