Open Bug 1586096 Opened 6 years ago Updated 3 years ago

No need to compose transform animation on the compositor thread if we have animations on transform-origin

Categories

(Core :: CSS Transitions and Animations, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: boris, Unassigned)

References

Details

Not sure if this is expected behavior. For example:

@keyframes anim {
  to {
    transform: rotate(45deg);
    transform-origin: 10% 90%;
  }
}
#target {
  animation: anim 5s;
}
<div id="target"></div>

In this case, we have an animation on transform and transform-origin properties. Basically, we run the transform animation on the compositor with a fixed transform-origin value by setting it into AnimationData. So if we have an animation on transform-origin, we should fall-back to the main thread, I think. However, I tried to dump the log to make sure this, and I notice that we run this animation on the main thread indeed, but we still pass transform animation to the compositor thread, so we still compose transform animation on the compositor thread. This means we compose transform animation on both the compositor thread and the main thread, but transform-origin only runs on the main thread. Although the rendering result is correct, it seems we don't need to pass transform animation to the compositor?
Or is this expected?

Flags: needinfo?(hikezoe.birchill)

I will close this if this is expected.

Status: NEW → UNCONFIRMED
Ever confirmed: false

It seems we add the animation into the compositor for each tick (because we reconstruct nsDisplayTransform), so we get the up-to-date transform-origin on the compositor, so does the rendering result.

I am pretty sure this is a bug.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(hikezoe.birchill)

What I suppose we should do is make transform-origin run on the compositor.

See Also: → 1429305

(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)

What I suppose we should do is make transform-origin run on the compositor.

Agree.

Type: defect → enhancement
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.