1
0
Fork 0
Commit graph

100 commits

Author SHA1 Message Date
Jonas Ådahl
f9be670522 tests/frame-clock: Check that destroy signal is emitted
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
d29c8e290c clutter/frame-clock: Add explicit destroy function
The frame clock owner should be able to explicitly destroy (i.e. make
defunct) a frame clock, e.g. when a stage view is destructed. This is so
that other objects can keep reference to its without it being left
around even after stopped being usable.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
a9a9a0d1c5 clutter: Paint views with individual frame clocks
Replace the default master clock with multiple frame clocks, each
driving its own stage view. As each stage view represents one CRTC, this
means we draw each CRTC with its own designated frame clock,
disconnected from all the others.

For example this means we when using the native backend will never need
to wait for one monitor to vsync before painting another, so e.g. having
a 144 Hz monitor next to a 60 Hz monitor, things including both Wayland
and X11 applications and shell UI will be able to render at the
corresponding monitor refresh rate.

This also changes a warning about missed frames when sending
_NETWM_FRAME_TIMINGS messages to a debug log entry, as it's expected
that we'll start missing frames e.g. when a X11 window (via Xwayland) is
exclusively within a stage view that was not painted, while another one
was, still increasing the global frame clock.

Addititonally, this also requires the X11 window actor to schedule
timeouts for _NET_WM_FRAME_DRAWN/_NET_WM_FRAME_TIMINGS event emitting,
if the actor wasn't on any stage views, as now we'll only get the frame
callbacks on actors when they actually were painted, while in the past,
we'd invoke that vfunc when anything was painted.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/903
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
5f729ea437 clutter/stage: Only emit "presented" on completion event
We'd emit multiple "presented" signals per frame, one for "sync" and one
for "completion". Only the latter were ever used, and removing the
differentiation eases the avoidance of cogl onscreen framebuffer frame
callback details leaking into clutter.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
1de436684c clutter: Include clutter-frame-clock.h from clutter.h
So that it can be used by libmutter and gnome-shell.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
847e89d31f clutter/frame-clock: Handle reschedule then dispatch results in idle
A frame clock dispatch doesn't necessarily result in a frame drawn,
meaning we'll end up in the idle state. However, it may be the case that
something still requires another frame, and will in that case have
requested one to be scheduled. In order to not dead lock, try to
reschedule directly if requested after dispatching, if we ended up in
the idle state.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:51 +02:00
Jonas Ådahl
ff65c95aee frame-clock: Pass frame info when notifying presented
Instead of just the timestamp, pass the frame info struct we already,
that also include refresh rate.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
2b95ec40c6 clutter/timeline: Deprecate timelines without an actor or frame clock
Without an associated actor, or explicit frame clock set, in the future
a timeline will not know how to progress, as there will be no singe
frame clock to assume is the main one. Thus, deprecate the construction
of timelines without either an actor or frame clock set.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
ca82cde6dd tests/frame-clock: Add test that switches frame clock mid timeline
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
a0d87662f7 tests/clutter: Add frame clock timeline test case
Tests basic functionality such as that timelines are advanced after
having added themself to frame clock.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
3c4efd13c1 frame-clock: Pass timestamp to frame callback
The timestamp comes from the GSource, meaning it's a more accurate
representation of when the frame started to be dispatched compared to
getting the current time in any callback.

Currently unused.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
a132c8dc8e frame-clock: Add API to inhibit/uninhibit updates
Equivalent to pause/resume, but ref counted.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
cae5b99537 frame-clock: Add callback before the actual frame callback
Aimed to have the frame listener do things like processing events before
the actual frame. In between the before-frame and actual frame,
timelines will be advanced.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
b18d4fc346 tests/frame-clock: Add schedule-update-now test
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
8f96885af8 tests/frame-clock: Check that no damage doesn't ever dispatch
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
51ee41ee43 tests/frame-clock: Test delayed schedule update
Check that the frame clock doesn't dispatch any updates early until
there is any scheduling.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
e743b36cfc clutter/frame-clock: Handle immediate present feedback
In certain scenarios, the frame clock needs to handle present feedback
long before the assumed presentation time happens. To avoid scheduling
the next frame to soon, avoid scheduling one if we were presented half a
frame interval within the last expected presentation time.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Ådahl
96a108ed4e clutter: Add a simple frame clock base
This adds a current unused, apart from tests, frame clock. It just
reschedules given a refresh rate, based on presentation time feedback.

The aiming for it is to be used with a single frame listener (stage
views) that will notify when a frame is presented. It does not aim to
handle multiple frame listeners, instead, it's assumed that different
frame listeners will use their own frame clocks.

Also add a test that verifies that the basic functionality works.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
2020-07-02 19:36:50 +02:00
Jonas Dreßler
98df2dbd05 clutter/actor: Always return a resource scale in get_resource_scale()
Since we now always return a resource scale, we can remove the boolean
return value from clutter_actor_get_resource_scale() and
_clutter_actor_get_real_resource_scale(), and instead simply return the
scale.

While at it, also remove the underscore from the
_clutter_actor_get_real_resource_scale() private API.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1276
2020-06-30 13:15:53 +00:00
Georges Basile Stavracas Neto
88141f1483 tests: Rename actor-anchors to actor-pivot-point
The test only covers the pivot point now, rename to reflect this.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
7146a6dddb clutter/actor: Remove anchor points and gravity
Drop the bomb.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
031098a43d tests: Drop anchor-related parts of the actor-anchors test
The pivot-point parts of the test are still useful, so don't completely
remove the test, only the deprecated parts of it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
dc4cb562b7 clutter/actor: Remove rotation center
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
2e086c74e7 Drop ClutterRectangle
And the correcponding CallyRectangle class.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
e884ba7f39 tests: Replace ClutterRectangle with ClutterActor
These tests were written (and copy-pasted) before ClutterActor
had an actual background-color property. As a preparation to
the removal of ClutterRectangle, replace all these rectangles
with plain actors and background colors.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
2802d359e5 Drop ClutterBox
Nobody was subclassing or using it, except for the tests. Replace
it by ClutterActor in the tests.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
d4993c4b22 clutter/stage: Remove all deprecated functions
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
ae49f89cf3 clutter/stage: Remove color property
The property is deprecated and the current implementation simply
redirects it to ClutterActor::background-color, so remove it.

Also update the tests to set the background color directly.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
ce3e293a18 clutter: Drop ClutterGroup
It is now unused.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:46 +00:00
Georges Basile Stavracas Neto
d4953c77c3 clutter/actor: Remove clutter_actor_show_all
Actors are visible by default these days, and this function
is deprecated for a long time.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:45 +00:00
Georges Basile Stavracas Neto
237f277641 clutter/actor: Remove clutter_actor_unparent
Pretty much the same set of changes of the previous commit, but
for clutter_actor_unparent().

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:45 +00:00
Georges Basile Stavracas Neto
59e454f01e clutter/actor: Remove clutter_actor_set_parent
Replace it by clutter_actor_add_child(), and update ClutterGroup
to not emit the 'actor-added' anymore.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:45 +00:00
Georges Basile Stavracas Neto
387a13f0ab clutter/actor: Drop depth property and functions
It is deprecated in favor of the 'z-position' property, and
the implementation itself redirects to the z-position, so
just drop it and replace all get|set_depth calls to their
z-position counterparts.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
2020-06-27 13:35:45 +00:00
Jonas Ådahl
1eaf9e5f63 tests/clutter/timeline-interpolate: Maximize error tolerance
Simply to make it less flaky.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1291
2020-06-06 00:27:40 +02:00
Jonas Ådahl
7222bdde57 tests/clutter/timeline: Lower FPS even further
It's still flaky running in CI, lets run it even slower.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1291
2020-06-06 00:27:40 +02:00
Jonas Ådahl
007d27fa40 tests/conform: Use the clutter stage from mutter
The tests created their own stage, which caused various issues. Lets use
the one from mutter instead.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:27 +00:00
Jonas Ådahl
a05dd813da clutter/timeline: Remove clutter_timeline_clone()
It was deprecated long ago, and users should switch to using te regular
constructors.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:26 +00:00
Jonas Ådahl
08b30d6fe2 clutter/timeline: Remove deprecated 'loop' property
It was since long ago replaced by a 'repeat-count' property.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:26 +00:00
Jonas Ådahl
d742f9331c tests/clutter: Port timeline-rewind to current test suite
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:26 +00:00
Jonas Ådahl
420ca31f0b tests/clutter: Port timeline-progress to current test suite
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:26 +00:00
Jonas Ådahl
73da901cd3 tests/clutter: Port timeline-interpolate to current test suite
The error tolerance is increased dramatically to make the test less
flaky when running in CI.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:26 +00:00
Jonas Ådahl
dd16fac0c7 tests/clutter: Port timeline tests to current test suite
Also fix a test that dependends on a specific element order in a list
that wasn't defined to have any particular order.

The frames per second is decreased from 30 to 10, to make the test less
flaky when running in CI.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:26 +00:00
Jonas Ådahl
1b2af2891f tests/clutter/conform: Default to print test logs
To change to the old behavior, pass --quiet. The aim is to be make it
easier to debug issues only reproducing in the CI.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:26 +00:00
Jonas Ådahl
050c21c24f tests/clutter/conform: Don't run tests in parallel
Might end up failing to acquire D-Bus names, resulting in warnings.
Avoid that by not running the tests in parallel.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
2020-06-05 21:39:26 +00:00
Florian Müllner
a1be7cdbd7 tests/clutter: Don't test BoxLayout's child properties
They are about to become ex-properties.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1265
2020-05-21 15:49:31 +02:00
Florian Müllner
c14ba5937f clutter/tests: Stop using deprecated BoxLayout API
... so that we can remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1265
2020-05-21 15:49:31 +02:00
Jonas Dreßler
3c29bf7491 clutter: Remove allocation flags
Since there are now no more allocation flags, we can remove
ClutterAllocationFlags from Clutter.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1245
2020-05-20 12:50:31 +00:00
Jonas Dreßler
0a986fc885 clutter/tests: Remove usage of ABSOLUTE_ORIGIN_CHANGED flag
We're going to remove this allocation flag, so stop using in the
interactive test-layout test.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1245
2020-05-20 12:50:31 +00:00
Jonas Ådahl
322b51cded clutter: Remove ClutterAnimation
This removes ClutterAnimation and related tests. ClutterAnimation has
been deprecated for a long time, and replacements exist and are used by
e.g. GNOME Shell since a while back.

This also disables a few relatively unrelated interactive tests, as they
rely on ClutterAnimation to implement some animations they use to
illustrate what they actually test.

As interactive tests currently are more or less untestable due to any
interaction with them crashing, as well as they in practice means
rewriting the tests using non-deprecated animation APIs, they are not
ported right now. To actually port the interactive tests, it needs to be
possible to fist interact with them.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1192
2020-05-07 20:04:07 +00:00
Jonas Ådahl
b46bc98d44 tests/clutter/conform: Remove left-over ClutterAnimator scripts
ClutterAnimator is long gone; remove some leftover test scripts.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1192
2020-05-07 20:04:07 +00:00