[libkwineffects] Port AnimationEffect to TimeLine
ClosedPublic

Authored by zzag on Oct 27 2018, 9:14 AM.

Details

Summary

TimeLine has nice API for controlling its direction that can be re-used
later by AnimationEffect.

Test Plan

The existing tests for scripting effects still pass.

Diff Detail

Repository
R108 KWin
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 4315
Build 4333: arc lint + arc unit
zzag created this revision.Oct 27 2018, 9:14 AM
Restricted Application added a project: KWin. · View Herald TranscriptOct 27 2018, 9:14 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Oct 27 2018, 9:14 AM
zzag added a comment.Oct 27 2018, 9:31 AM

There's only one small difference w.r.t. retarget:

zzag updated this revision to Diff 44427.Oct 29 2018, 11:07 AM

Rebase.

Generally +1

libkwineffects/kwinanimationeffect.cpp
308

This is different. Though IMHO arguably more correct - please can you check.

Lets say I'm animating opacity 0 to 1 for 10 seconds.

After 5 seconds through I decide I want to make it 15 seconds, so I call retarget(id, 1, 10)

With the old code I'm 1/3 of the way through a 15s animation that goes from 0.5 -> 1 which means my current value is 0.666

With the new code I'm at the start of a 10s animation from 0.5 to 1. Which means my current value is 0.5

zzag added inline comments.Oct 31 2018, 2:34 PM
libkwineffects/kwinanimationeffect.cpp
308

That's why I posted video of the Morphing Popups. :-)

IMHO, the behavior of the old code is incorrect. If I retarget animation from the current position to a new position, then there should not be any jumps. Animation should go from the current position to the new target position.

With the new code I'm at the start of a 10s animation from 0.5 to 1. Which means my current value is 0.5

This is the correct behavior, imho. The opacity should go from 0.5 to 1.0, otherwise animation won't be smooth.

zzag added inline comments.Oct 31 2018, 2:35 PM
libkwineffects/kwinanimationeffect.cpp
308

... also please notice that the current value of the timeline will go from 0.0 to 1.0.

davidedmundson accepted this revision.Oct 31 2018, 2:39 PM

Oh, sorry I hadn't seen that you'd noticed it in a comment.

This revision is now accepted and ready to land.Oct 31 2018, 2:39 PM
zzag updated this revision to Diff 44841.Nov 4 2018, 1:27 PM

Rebase.

zzag updated this revision to Diff 45646.Nov 17 2018, 11:39 AM

Rebase.

graesslin accepted this revision.Nov 17 2018, 11:41 AM
This revision was automatically updated to reflect the committed changes.