| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
It can happen that also animations with more than 2 registered frames
turn out to have a constant value, and thus can be simplified. Improve
the detection function to cover also such cases.
Pick-to: 6.10
Change-Id: I7f95e0371be6d36bcebff01a99ffa0cd226b54ef
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In animated transforms, it is common that only 1-2 of the properties
(scale/translate/rotate/anchor) are actually animated, while the rest
have constant, and often default, values. To lighten the generated qml
code somewhat, this patch skips generating Animation items for
constant value properties. In particular, it skips animating the
center/origin point of rotations when not needed. And for properties
with constant default values, the entire Transform object is skipped.
Depending on the inpu, this saves 10-50% of the size of the generated
qml, and correspondingly saves loading time and processing load.
Fixes: QTBUG-139076
Pick-to: 6.10
Change-Id: I151164b63356b0fd3b15cfcdc8d163f835d46fde
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Using a zero duration animation is a bit hacky and there's no
need for it. Instead we just set the value direction in a script.
Pick-to: 6.10
Change-Id: Ia23f8aadc73a2aed3e1dd9521d160adb0fa6399e
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
There is now a plugin in the Qt Lottie repository which VectorImage
will use if the assumeTrustedSource property is set to true.
This needs to also be documented in VectorImage.
Pick-to: 6.10
Change-Id: Id5f07842631a0794fef47bb29487cb08f398faa1
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows the parser to provide easing information per frame
in the form of a bezier curve. This should allow specifying any
of the typical bezier curves, although mapping the default ones
to enums at one point in the future may make sense as an
optimization.
Pick-to: 6.10
Task-number: QTBUG-135695
Change-Id: I5bff5ccce33fb3b6300a87f5ea8c52d2cf8ded7e
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
| |
This will be used by the Lottie plugin for accessing the hierarchy
of items after they have been generated.
Pick-to: 6.10
Change-Id: I623fd3d80e42e43f17c28f0e52effae16b8ba633
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow us to load Lottie files by creating a plugin in
the Lottie module. The plugins are currently only queried if
the opt-in "trusted content" flag is set.
Pick-to: 6.10
Fixes: QTBUG-135266
Change-Id: I4901636e41f3bb73a78cbceb312f6cad9e96c5d2
Reviewed-by: Eirik Aavitsland <[email protected]>
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The qml generator would create a child component to group the
animation properties. This now causes qml engine failures if there are
multiple VectorImage items.
Work around by dropping the grouping component and just place the
animation properties in the top level item directly if the QML
generator is going to be used from VectorImage.
Change-Id: I77ac9029093f3259aef9357c056da42f09974763
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Certain checks and restrictions are in effect by default on
the SVG parser. This introduces a way for disabling these
in the VectorImage, when it is used with trusted content.
Change-Id: I7a11c7276a01ae9eb128ed0afb2a04c38fe90c7a
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
| |
In particular, remove the Layer helper item, which will be added to a
qtlottie helpers import instead.
Change-Id: I9df98fc5bd983dd13822b62655e65f7f1093f4ca
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
| |
Change-Id: I702ddfa549a7fadee423628f576dfff4083448a7
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the comparison of different signed
integers on Android x86 architecture. Fix introduces
q20::cmp_greater_equal to be used.
Fixes: QTBUG-136969
Change-Id: I6ec17c3604b82266cfd7a68f7f5505360b6a65c6
Reviewed-by: Ville Voutilainen <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Animation steps that do not actually modify the property value are
replaced with just a PauseAnimation. Significantly reduces the number
of lines in the output.
Change-Id: I281acb123e664ed21e63c5a94ac65dc30e4de1fa
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SVG has a feature where a set of animations on the transform
can be set to either replace or append to previous animations,
but only while the animation set is active.
In order to support this, we introduce a helper class called
TransformGroup which can contain a set of parallel animations
and have them override the others.
Change-Id: I28be7d120527b1f2d1e3dbf5c5de94094c766363
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Lottie file format has a feature where a layer can have
the transform of another layer (including any transform
set on one of its ancestors) as its base. This means that
we need a specialized helper type that collects the transforms
of its ancestors and exposes the combination so that it can
be referenced from a different part of the generated QML.
Change-Id: I20b72cb9b9af2834f40f391ecb8df7bb0c5e1958
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
| |
This is a feature in Lottie, where layers pop into existence and
pop out later on. We do this by animating the visibility of the
item.
Change-Id: Ieebab4e84f9254976b0de9759a1f0f4c8026210e
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A lot of animations will just be a single time line that you
is intended to be controlled from the outside (and formats like Lottie
does not support anything beyond this), so we need some API to
match the general Animation API so that you can restart, pause/resume
and change the number of times an animation loops.
We do this by adding a group of properties called "animations" that
can be used to control all the animations in the document at once.
We generate this both in the QML file from *toqml and also in
VectorImage itself.
[ChangeLog][QtQuickVectorImage] Added some API to the VectorImage
for looping, stopping, pausing and resuming animations.
Fixes: QTBUG-135265
Change-Id: Id372c00110d165d02db357ce77eb1dec504cffb8
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
| |
Change-Id: I8364e33cb2bffd528e73c1fd1e46fa8b3663e951
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The alpha value of the fill and stroke colors can be animated
separately in SVG. In order to support this, we introduce a
specialized ColorOpacityAnimation type in a Helpers library
which only overwrites the alpha channel of the target property.
This requires an extra hook in the animation frame work which
allows us to get the current value of the property. It should
have minimal impact on any existing code, but may have
additional use cases later, when we implement support for
additive color animations for instance. Since the interpolator
API in QVariantAnimation is public API, we add a secondary,
private API for this. If we see use for it in the future,
this could mature to a public API as well.
Fixes: QTBUG-135322
Change-Id: I803f4e64c41e9d6dc355f2468233661885aa7f15
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
| |
In order to correctly support transformation order, we needed
a refactor in Qt Svg. We need to adapt to this and apply the
animations in the correct order in Qt Quick.
Change-Id: I38e323f95b7edc26fd8d78ebd98778c3da1adbea
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
| |
Change-Id: I957b800ce4fca00f846ae5c567e84b72b6fc0401
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
| |
These headers don't use std::pair at all.
Change-Id: I1c5c5974949ada2e05151e238884ce4f12156b5f
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
| |
QPair is just an alias of std::pair anyway.
Task-number: QTBUG-115841
Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We were spending time doing the same implementation twice,
since the item generator and QML generator were two separate
code paths. We also risked having bugs which only occurred in
one of the code paths.
This may at some point be a valid optimization, but during
development it is premature. The parsing of the QML is a
one-time cost when loading the SVG and this is an acceptable
cost for now. Optimizations can come later when we have
a more stable state.
Fixes: QTBUG-135269
Change-Id: I649a89d7a2e18ef1c0213658dc106f2cc1194841
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
| |
Change-Id: I35a01ad834ad701be8c99334dc4ee5063eac0ce8
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move away from the complex attempt at creating a single animation
out of the key frames and instead pass each animation into Qt Quick.
While this will fix some things, it may also regress for some cases
of overlapping conflicting animations since we now just depend on
the Qt Quick behavior there. If we see the need to support these
cases, then we probably need a special ParallelAnimation type
that allows modifying how the changes are applied based on which
animations are active.
Change-Id: I0c0ff867cd5917b19318ebe241a1ab8a9c1c8156
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
| |
Use the new generalized animations to implement support for
opacity animations.
Change-Id: Id758942d383f71b08ffc514fa5341e13194deaca
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need a generalized way of doing animations to simplify
adding animations for other properties. In order to be
as expressive as possible we need to just pass the
animation info on to the generator and let it handle it.
If there are multiple animations affecting the same property
at the same time, we just instantiate them in Qt Quick
and let its engine handle the conflict.
This means that the only way to implement special SMIL
conflict behavior such as add/replace is to create specialized
animation classes in Qt Quick. We can do this at a later
stage if it becomes a priority.
The main use case of having multiple animations affecting
a property at different times should be covered by this
implementation, it should be easy to expand to new types,
and it should be easy to add stuff like easing curves to
it.
Change-Id: I927ea2cef214a300ae8fae3f76ee87fb5d505b3d
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The miterLimit in Qt Quick Shapes is an int, so if we generate
fractional numbers in the QML file, that will lead to a parser
error.
This was reproducible by running svgtoqml on
paint-stroke-07-t.svg.
Pick-to: 6.8 6.9
Change-Id: Ia03cbba7f70f687dc93ac20b86314dae1fbc30d3
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In SVG, two subsequent identical gradient stops means a hard
transition to the color of the second at that position. However,
this is not the case in Qt and because of the way we sort the
gradient stops, the order of the two identical stops will be
wrong.
This is addressed by adding an epsilon to identical stops in
Qt Svg, but the epsilon is FLT_EPSILON, which is around 1e-7.
The default output precision for doubles in Qt is 6, so when
storing the numbers to file, the epsilon would be lost, the
two positions would be considered identical and the reordering
would happen.
This caused a visual error when running svgtoqml on the
paint-grad-16-t.svg test.
Pick-to: 6.8 6.9
Change-Id: I857958512c3de7dc843a705893b4c2d7d2a36fd4
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
| |
The QML module does nothing fancy in its plugin, so there's no reason to
claim that the plugin is mandatory.
Pick-to: 6.9
Change-Id: I850c6d74c2c5254df748897cb2987df8a5fccfce
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The whole idea of VectorImage is scalable graphics, and a hinted font
layout is inherently unscalable, as the glyph positions will be rounded
to integers. Therefore, we need to disable hinting on the QFont before
creating the layout.
This also updates the svg manual test to compile and run again, as it
seems to have been broken at some point.
Pick-to: 6.8 6.9
Fixes: QTBUG-133852
Change-Id: Idd63a9fcab51c1f077427ea06ad891975ee73386
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a transform animation ends while others are still running,
we need to record the state directly after the shorter animation
ends, so that we get a key frame for only the animations that
are still active as a starting point.
Note: This also adds some extra debug output which was helpful
when debugging it.
Pick-to: 6.9
Fixes: QTBUG-132408
Change-Id: Ied1f4e7431d201f7bcef27eb4be271eb0afbd8f2
Reviewed-by: Hatem ElKharashy <[email protected]>
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This works by first creating a transform object per animated
property we have in SVG. Then it creates a set of key frames
based on these. All key frames will touch all animations, so
that they can also control activating and deactivating an
animation, freezing the end result of one, etc. The frames
we generate are based on the end points of animations as well
as right after (and sometimes right before) the animation to
record the state when it is inactive.
If any of the animations have infinite repeats, we create a
set of key frames for the finite part first and then the
infinite loop, so that these are separated into two different
animations in QML.
At each key frame we check all animations to see if they
affect their corresponding transform at this time. If they
are inactive, the transform will be set to a default value.
But if they are active (either running or frozen), we
query the interpolated value from the animator to get the
value at the specific time.
Pick-to: 6.9
Fixes: QTBUG-127590
Change-Id: I0102cefb3713a0c36661fb3da008b25b19a80427
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
| |
Needed for handling hierarchical group structures.
Change-Id: I38475f71f4864c79c3b94622362f45ac65e33e86
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
To allow other usages of QQuickGenerator and related classes, remove
(most of) the hardcoding against qtsvg and restructure the api a bit.
As a driveby, also ensure that all members in the generator's NodeInfo
structs are initialized by default.
Change-Id: I731a99422ff03ec7bd0301b124e3b3264c6cc0b7
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
|
| |
MSVC was warning about the concatenation as QTextStream does not have
anything against const char[] in QT_NO_CAST_FROM_ASCII mode.
Change-Id: Icbdde0c847354729558a263c793f4b28450d84d4
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
| |
This adds support for the color animations currently supported in
Qt Svg, for parity.
Task-number: QTBUG-127590
Change-Id: I8d996b2842911e03b2c92783114a688754e9b93c
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
|
| |
Some enums have been replaced.
Change-Id: I75f4830a847f1838adba4669751e15ff238094cf
Reviewed-by: Hatem ElKharashy <[email protected]>
Reviewed-by: Juha Vuolle <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
...in preparation of trimming down includes in QQuickItem.
As a drive-by, remove the superfluous qqml.h include from
quick/items/qquicktextutil_p.h.
Change-Id: I7ee0f459bcbfdfe07314d1f63433aaa8639870ac
Reviewed-by: Richard Moe Gustavsen <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
The lout pointer was dereferenced right before it was tested for being
null.
This modifies c25bfd53425894ff12f3f883f3d6c211e9840973
Coverity-Id: 467163
Pick-to: 6.8
Change-Id: I2ebbc2c321971997f8553c8dfcb3f235ffff044c
Reviewed-by: Robert Löhning <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The handling of images in the VectorImage generator would apply
the node info before setting the new node as current, thus setting
transforms on the parent instead.
Note: This patch also removes a couple of outdated comments and
fixes indent on the QML generator for images.
Pick-to: 6.8
Task-number: QTBUG-128476
Change-Id: I1fbcfbac5a97f66ecbff0e74b27c0e2c88cc08f6
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
| |
Pick-to: 6.8
Change-Id: I1d920751dbb48944678898245a059360efcaca55
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Reviewed-by: Topi Reiniö <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the generators were refactored to add special-handling of the
root node, the path container logic from the structure node handling
was not included there, causing some SVGs to get a lot of Shape items
instead of combining them. This re-introduces the logic by adding
a Shape item inside the root item if we see that we can make a root
path container. (This is slightly different from structure nodes,
where the structure node itself can be the Shape item. Since the
root node has special requirements, we keep it and just add a
new Shape level inside.)
Pick-to: 6.8
Fixes: QTBUG-126716
Change-Id: If05fd38bad08749cf5c4b338ead104aa01672e49
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
There is some support for SVG's switch in Qt Svg, so we support
the same in VectorImage and svgtoqml.
Pick-to: 6.8
Fixes: QTBUG-121645
Change-Id: Ifb90fad3f16337b2a71b48d796dfb0fad82b39b4
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the gradient is in object mode, it will be adapted to the
bounding rect of the path it draws. However, since we are creating
paths for each letter individually when doing this for text, we
ended up applying the gradient to each letter's bounding box.
This patch allows the caller to override the path's bounding rect
with a different one, which in the case of text will be the
QTextBlock's bounding rect instead.
Pick-to: 6.8
Fixes: QTBUG-126235
Change-Id: I65fa994c98d1e13154c2f5aa218ddf0353388a79
Reviewed-by: Hatem ElKharashy <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We allowed certain node types to be allowed as children underneath
a Shape item. There is no clear reasoning for why these nodes were
selected.
An issue with making items children of what is actually a sibling
is that the z order will no longer be automatically handled, as
the shape will be drawn underneath its children. There is no way
to merge two shapes into one and ensure that an item wedged
between them is placed at the correct z level relative to both.
One case which would work is for text when it is drawn using
paths, so this is a potential optimization. However, it would
require factoring out the logic which detects whether this is
needed. Text may not be a common enough use case for this to
be worth it.
Pick-to: 6.8
Fixes: QTBUG-127656
Change-Id: I7c73535f9298897e1f9e2e4a80814df966f5a501
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a gradient is using "objectBoundingBox" units, fillTransform in
QQuickShapePath is used to apply the correct transformation to user
space. This was handled manually in linear gradient and never in radial
gradient.
Fixes: QTBUG-126232
Pick-to: 6.8
Change-Id: I801eac6d9fbfa9985ff2a04e7c72502edb4fb744
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This have been regenerated with an updated svgtoqml. One
change was needed in the example: The generator would
previously added a subitem inside the main item which was
transformed to fit the item to the requested size:
Item {
implicitWidth: foo; implicitHeight: bar
Item {
transform: ...
Shape { ... }
}
}
This was since removed, likely because it's dead weight
(and removes the possibility of overriding it), so now
the transform is set directly on the generated root
object.
But the weather forecast example had made the map labels
children of the generated item, which means the scale was
now also applied to them. This was easy to fix in the
example, by creating the extra item ourselves in the
case where it's needed.
This patch also takes the liberty of fixing some minor
whitespace issues etc.
Pick-to: 6.8
Change-Id: Ic324815c71f990bb7e8e7caed659c14267b1777a
Reviewed-by: Eirik Aavitsland <[email protected]>
|
|
|
|
|
|
|
|
| |
VectorImage QML doc was not showing that it inherits from Item
Pick-to: 6.8
Change-Id: Ifa4b57fa567683342fc8e7e1221b55cec4b84cf7
Reviewed-by: Eirik Aavitsland <[email protected]>
|