Closed Bug 1384000 Opened 7 years ago Closed 7 years ago

CSS Animation won't start in layers free mode

Categories

(Core :: Graphics: WebRender, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: mtseng, Assigned: mtseng)

References

Details

Attachments

(2 files)

Attached file anim.html (deleted) —
STR:

1. Turn on gfx.webrender.layers-free
2. Open attachment

Expected result:
CSS animation should start when page loaded.

Actual result:
CSS animation didn't start.
Something didn't trigger in layers free mode because in layers free mode we early return in [1]. Therefore, we didn't trigger pending animation in [2]. I think we should run through to the end of function instead of early return. I'll write a patch for this.

[1]: https://dxr.mozilla.org/mozilla-central/source/layout/painting/nsDisplayList.cpp#2115
[2]: https://dxr.mozilla.org/mozilla-central/source/layout/painting/nsDisplayList.cpp#2317
Comment on attachment 8889763 [details]
Bug 1384000 - Call TriggerPendingAnimations in layers-free mode.

https://reviewboard.mozilla.org/r/160844/#review166136

Currently I know for layers-free, we should add ClearInvalidationStateBits back to make invalidation correct and add TriggerPendingAnimations back to make css animation work. Removing the early return seems to make the code more complicated but this way could reduce some duplicate code. I'm fine with both ways.

::: layout/painting/nsDisplayList.cpp:2313
(Diff revision 1)
>    if (document && widgetTransaction) {
>      TriggerPendingAnimations(document, layerManager->GetAnimationReadyTime());
>    }
>  
>    nsIntRegion invalid;
>    if (props) {

I suppose layers-free mode doesn't need these computation. Could we move these invalidation funciton calls to the line after 'layerBuilder->DidEndTransaction()'? And then we don't need to check if the root is valid.
Attachment #8889763 - Flags: review?(ethlin) → review+
Comment on attachment 8889763 [details]
Bug 1384000 - Call TriggerPendingAnimations in layers-free mode.

https://reviewboard.mozilla.org/r/160844/#review166240

I'm not comfortable with this change because it looks like it reorders things in the non-WR codepath and I don't know what effects that will have. Your patch pulls the BeginTransaction calls earlier compared to when it was happening previously - now it happens before the FrameLayerBuilder is created and is outside of the AutoProfilerTracing tracing(...) RAII block. I don't know if that's acceptable so to be conservative I'm giving this a r-. I think for now it's safer to use the old code pattern and just add the necessary call to TriggerPendingAnimations in the right spot. If it turns out we are duplicating a lot of stuff to make things work we can revisit this. If there is a lot of duplication then doing it this way should be simpler than it is now, because fewer things will be conditioned on |isLayersFree|.
Attachment #8889763 - Flags: review?(bugmail) → review-
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #4)
> Comment on attachment 8889763 [details]
> Bug 1384000 - Don't early return in layers free mode.
> 
> https://reviewboard.mozilla.org/r/160844/#review166240
> 
> I'm not comfortable with this change because it looks like it reorders
> things in the non-WR codepath and I don't know what effects that will have.
> Your patch pulls the BeginTransaction calls earlier compared to when it was
> happening previously - now it happens before the FrameLayerBuilder is
> created and is outside of the AutoProfilerTracing tracing(...) RAII block. I
> don't know if that's acceptable so to be conservative I'm giving this a r-.
> I think for now it's safer to use the old code pattern and just add the
> necessary call to TriggerPendingAnimations in the right spot. If it turns
> out we are duplicating a lot of stuff to make things work we can revisit
> this. If there is a lot of duplication then doing it this way should be
> simpler than it is now, because fewer things will be conditioned on
> |isLayersFree|.

Okay, so we just add what we really need for layers-free mode. I will create another bug for adding ClearInvalidationStateBits to fix invalidation problem.
Sure, I'll attach another patch.
Comment on attachment 8889763 [details]
Bug 1384000 - Call TriggerPendingAnimations in layers-free mode.

https://reviewboard.mozilla.org/r/160844/#review166734

Thanks!
Attachment #8889763 - Flags: review?(bugmail) → review+
Pushed by mtseng@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d4d95cd1fdff
Call TriggerPendingAnimations in layers-free mode. r=ethlin,kats
https://hg.mozilla.org/mozilla-central/rev/d4d95cd1fdff
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: