derM
derM

Reputation: 13691

Use of QML Animations vs. Animation Files

I wonder, if it is more beneficial to use the abilities of QML for animations, or prefer to use animation files (such as GIF oder MNG) for simple, small-scale animations.

Examples for what I call "simple, small-scale animations" are:

I don't know much about the internals of Qt, so I am unsure, whether I benefit from hardware acceleration, when programming the animations (e.g. image rotation) or not. And if so, whether this hardware acceleration outperforms the display of pre-calculated animations from GIF and MNG.

Greetings and thanks,
-m-

Upvotes: 2

Views: 805

Answers (1)

Mitch
Mitch

Reputation: 24396

I wouldn't worry about things like this unless they visibly slow the performance of your application. Some points to consider:

  • The use cases you mentioned almost always involve only one "busy indicator" being visible at a time.
  • Both Image and AnimatedImage have the high DPI @*x file look-up.
  • Both Image and AnimatedImage support caching.
  • Both Image and AnimatedImage will use the Qt Quick scene graph to display the images (OpenGL textures, which should result in hardware acceleration).
  • AnimatedImage has to read several images, but won't require rotation.
  • Rotation of images is pretty cheap, as far as I know.
  • It's trivial to swap out one with the other, or with something else.

If you're looking for good general performance advice, read the Performance Considerations And Suggestions documentation.

Upvotes: 2

Related Questions