| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 void updateAnimationTiming(Document& document, TimingUpdateReason reason) | 48 void updateAnimationTiming(Document& document, TimingUpdateReason reason) |
| 49 { | 49 { |
| 50 document.timeline().serviceAnimations(reason); | 50 document.timeline().serviceAnimations(reason); |
| 51 } | 51 } |
| 52 | 52 |
| 53 } // namespace | 53 } // namespace |
| 54 | 54 |
| 55 void DocumentAnimations::updateAnimationTimingForAnimationFrame(Document& docume
nt) | 55 void DocumentAnimations::updateAnimationTimingForAnimationFrame(Document& docume
nt, double monotonicAnimationStartTime) |
| 56 { | 56 { |
| 57 document.animationClock().updateTime(monotonicAnimationStartTime); |
| 57 updateAnimationTiming(document, TimingUpdateForAnimationFrame); | 58 updateAnimationTiming(document, TimingUpdateForAnimationFrame); |
| 58 } | 59 } |
| 59 | 60 |
| 60 bool DocumentAnimations::needsAnimationTimingUpdate(const Document& document) | 61 bool DocumentAnimations::needsAnimationTimingUpdate(const Document& document) |
| 61 { | 62 { |
| 62 return document.timeline().hasOutdatedAnimation() || document.timeline().nee
dsAnimationTimingUpdate(); | 63 return document.timeline().hasOutdatedAnimation() || document.timeline().nee
dsAnimationTimingUpdate(); |
| 63 } | 64 } |
| 64 | 65 |
| 65 void DocumentAnimations::updateAnimationTimingIfNeeded(Document& document) | 66 void DocumentAnimations::updateAnimationTimingIfNeeded(Document& document) |
| 66 { | 67 { |
| 67 if (needsAnimationTimingUpdate(document)) | 68 if (needsAnimationTimingUpdate(document)) |
| 68 updateAnimationTiming(document, TimingUpdateOnDemand); | 69 updateAnimationTiming(document, TimingUpdateOnDemand); |
| 69 } | 70 } |
| 70 | 71 |
| 71 void DocumentAnimations::updateCompositorAnimations(Document& document) | 72 void DocumentAnimations::updateCompositorAnimations(Document& document) |
| 72 { | 73 { |
| 73 ASSERT(document.lifecycle().state() == DocumentLifecycle::CompositingClean); | 74 ASSERT(document.lifecycle().state() == DocumentLifecycle::CompositingClean); |
| 74 if (document.compositorPendingAnimations().update()) { | 75 if (document.compositorPendingAnimations().update()) { |
| 75 ASSERT(document.view()); | 76 ASSERT(document.view()); |
| 76 document.view()->scheduleAnimation(); | 77 document.view()->scheduleAnimation(); |
| 77 } | 78 } |
| 78 | 79 |
| 79 document.timeline().scheduleNextService(); | 80 document.timeline().scheduleNextService(); |
| 80 } | 81 } |
| 81 | 82 |
| 82 } // namespace blink | 83 } // namespace blink |
| OLD | NEW |