• Majid Valipour's avatar
    [cc] Pausing Keyframes now correctly handles delay and multiple pauses · f7bf7332
    Majid Valipour authored
    Existing pause time application in cc::KeyframeModel is incorrect.
    
    To convert the client pause time to monotonic time, we used to add the
    |time_offset_| (1) but not add |total_pause_duration_| (2). The new logic now
    excludes (1) and adds (2). This ensures pause time and monotonic time
    have the same base clock.
    
    The original conversion was incorrect because:
    a. Pause time should have the same base clock as monotonic time since we compute
       total_paused_duration_ as difference between the two.
    b. Blink provides its animation's current time as pause offset which maps to
       the concept of local time in cc. So to convert it to monotonic time we don't
       need to include time_offset_.
    
    
    Without this correction animations with start-delay or multiple pause/unpause
    cycles would lead to incorrect pause time calculation. I suspect these issues
    flew under the radar mainly because pausing is only ever used for simple test
    cases not involving either of these conditions.
    
    Bug: 840364
    TEST: cc/animation/keyframe_model_unittest.cc
    
    Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
    Change-Id: Id52ca7a3f3d63899864b7153470c7ef64c582d29
    Reviewed-on: https://chromium-review.googlesource.com/c/1045126
    Commit-Queue: Majid Valipour <majidvp@chromium.org>
    Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
    Reviewed-by: default avatarYi Gu <yigu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#619437}
    f7bf7332
keyframe_model.cc 12.3 KB