Add Transform and Grid based animations#10
Open
smspillaz wants to merge 60 commits intoendlessm:masterfrom
Open
Add Transform and Grid based animations#10smspillaz wants to merge 60 commits intoendlessm:masterfrom
smspillaz wants to merge 60 commits intoendlessm:masterfrom
Conversation
If we know that two points are going to be of the same type, it is convenient to be able to compare them with the == operator as opposed to having to use agd::equals
The "box" type represents a simple perpendicular quadrilateral in 2D space given by its top left and bottom right co-ordinates (eg, x1, y1, x2, y2).
|
I don't recognize the submitter as a member of @endlessm. Can somebody in @endlessm verify the patch? See https://phabricator.endlessm.com/w/software/build/ci-integration/#pull-requests for more details. |
When animating from one position to another, it is possible that some things could change underneath us. For instance, the target position of the surface may be changed by the user while the animation is in progress. In this case, the animation needs to adapt to this change by allowing the caller some mechanism to transparently change the target box tha the surface is animating to. This can be done by overriding the animation::BoxQuery class and calling the Update() method as appropriate, which will update the saved geometry of the target position. For example, in a windowing system, one might set up a listener for surface geometry events in their animation::BoxQuery subclass, which then calls Update() when the geometry has been changed. This obviates the need for the caller to explicitly update all animations.
This is necessary in order to use it with some of the testing operators (like agd::Equals or agd::AlmostEq), since those testing operators use operator<< in order to print out the contents of the type in the event of a matching failure.
We're going to do affine transformations and glm is a particularly well respected library for things like that. Note that the dependency is a submodule, so you'll need to fetch and pull submodules before building.
ba877b6 to
513233d
Compare
Contributor
Author
|
Note: Travis is failing. I had a look into it, its some complications that come with trying to get the build dependencies in the docker container. I'm sure its fixable, may just time some more iterations... |
29a9520 to
3e4b200
Compare
b346964 to
5359d28
Compare
These include matrixMultiplyVector (multiplying a 4D matrix with a 4D vector), BoxWrapper (wraps a Animation.Box in an Animation.BoxQuery), and applyCallerTranslation
Steppers encapsulate some progress change within the animation. The typical case is linear stepping, which just interpolates from 0 to 1. However, another case is reverse stepping which is composed by 1.0f - linear (ms). Future steppers can be added to add all sorts of easing parameters. https://phabricator.endlessm.com/T23543
This uses AnimationClutter to provide animations for GNOME-Shell. It listens for certain windows events, then runs animations according to the settings in the org.gnome.shell.extensions.animation schema.
We need this for libmutter-4-dev
Seems like newer ubuntu images complain about the way that meson sets these up and linking with asan seems to hang, so we need to disable it for now.
We now have additional JS tests that we would like to run
315c848 to
f7f9353
Compare
The built package on OBS is out of date and not compatible with mozjs60
f7f9353 to
aeac19c
Compare
Contributor
Author
|
Okay, travis is passing now. |
It isn't used in newer shell versions. Hurrah!
We can just query the extremes and use those
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This branch adds some affine transformation animations, grid transformation animations and associated helpers. (Note: This work was started about a year ago while I was still at Endless, but was never actually finished and I didn't get much of a chance to work on it due to my study commitments, but I've finally had the time to refactor things into what is a hopefully better state now. I said I would eventually get around to this, so here it is :-)).
Stepping the animations is done using Stepper implementations (just a function object at the moment, an interface in the GObject interface). They can be composed as functions of each other, for instance the Reverse stepper is a composition of 1.0f - baseStepper(ms).
All the transform animations themselves are implementations of the TransformAnimation interface - the TransformAnimation class does not have any concrete implementation details. The animations themselves share code through the added header files with utility methods.
The actual matrix math is implemented using glm, a popular C++ header only library used for doing matrix transformations.
The GridAnimation template and helper functions, can be used to animate surfaces by deforming equally spaced vertices on a texture.
Changed from #4 and #8 is that the C++ animations now no longer require all properties to be specified in order to be constructed. Instead, they each have a default constructor, which sets sane defaults for the parameters of the animation. I also added a "property" system which allows callers to get/set properties on the animation in an ABI-safe way without too much boilerplate. This change (combined with a few other things), allows us to then drop a bunch of constructor abuse from the GObject wrappers - we now just construct the animation using the default constructor and let the property system handle the rest (though there are a few exceptions for object-valued properties, which comes from the fact that it doesn't make sense to allow those properties to be
NULLand the defaults set on the C++ side are not bindings-friendly implementations).Also changed from #4 and #8:
ReverseSteppertakes aSteppersubclass as its argument, where we can pass aglib::StepperWrapperin order to wrap the GObject stepper implementation directly, as opposed to having to create all these intermediary GObjects every time a property is accessed.animation::BoxQuery- which is explained a little more in the relevant commit, but it is essentially a mechanism to keep track of changes to surface geometry during the animation.https://phabricator.endlessm.com/T23543
https://phabricator.endlessm.com/T23697