Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve decisions in compositor over when to draw a frame. #17398

Merged
merged 3 commits into from Jun 21, 2017

Commits on Jun 19, 2017

  1. Improve decisions in compositor over when to draw a frame.

    This patch fixes a couple of issues in the compositor:
    
    1) Remove the delayed composition code. Previously, this would schedule
       a composite for 12ms in the future. This doesn't really make any sense
       with WR. There's no point in doing a composite unless WR has provided
       a new frame to be drawn. This fixes issues in several benchmarks where
       we were doing multiple composite / renders per rAF, which is a waste
       of CPU time. This *does* make the framerate slower in some cases (such
       as a slow rAF callback) but it's more correct - otherwise we were just
       compositing the same frame multiple times for no real benefit.
    
    2) Inform the window of the current animation state of the compositor.
       Specifically, if an animation (or rAF) is currently active, the
       window system switches to use event polling, and does not block on
       the OS-level event loop. In the case of active animation, we just
       assume that we want to be running as the vsync interval and not
       blocking. This means the compositor thread only sleeps on vsync
       during animation, which reduces OS scheduling and results in much
       smoother animation.
    gw3583 committed Jun 19, 2017

Commits on Jun 20, 2017

  1. Ensure that rAF callbacks which don't mutate the DOM, but aren't

    yet considered spurious force a reflow / composite / animation tick cycle.
    gw3583 committed Jun 20, 2017

Commits on Jun 21, 2017

  1. Fix rAF callbacks when in spurious mode.

    This fixes another rAF bug, that is being exposed by the previous
    two commits. Previously, the fake timer callback would only be
    set if we were being called from a non-rAF event handler.
    
    Now, if we're in fake / spurious mode, unconditionally set the one
    shot timer.
    
    Otherwise, notify the compositor that animations are present if
    we're not currently in a rAF callback.
    gw3583 committed Jun 21, 2017
You can’t perform that action at this time.