OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/svg/animation/SMILTimeContainer.h" | 27 #include "core/svg/animation/SMILTimeContainer.h" |
28 | 28 |
29 #include "core/animation/AnimationClock.h" | 29 #include "core/animation/AnimationClock.h" |
30 #include "core/animation/AnimationTimeline.h" | 30 #include "core/animation/AnimationTimeline.h" |
31 #include "core/dom/ElementTraversal.h" | 31 #include "core/dom/ElementTraversal.h" |
32 #include "core/frame/FrameView.h" | 32 #include "core/frame/FrameView.h" |
33 #include "core/svg/SVGSVGElement.h" | 33 #include "core/svg/SVGSVGElement.h" |
34 #include "core/svg/animation/SVGSMILElement.h" | 34 #include "core/svg/animation/SVGSMILElement.h" |
35 | 35 |
| 36 using namespace std; |
| 37 |
36 namespace WebCore { | 38 namespace WebCore { |
37 | 39 |
38 static const double initialFrameDelay = 0.025; | 40 static const double initialFrameDelay = 0.025; |
39 | 41 |
40 #if !ENABLE(OILPAN) | 42 #if !ENABLE(OILPAN) |
41 // Every entry-point that calls updateAnimations() should instantiate a | 43 // Every entry-point that calls updateAnimations() should instantiate a |
42 // DiscardScope to prevent deletion of the ownerElement (and hence itself.) | 44 // DiscardScope to prevent deletion of the ownerElement (and hence itself.) |
43 class DiscardScope { | 45 class DiscardScope { |
44 public: | 46 public: |
45 explicit DiscardScope(SVGSVGElement& timeContainerOwner) : m_discardScopeEle
ment(&timeContainerOwner) { } | 47 explicit DiscardScope(SVGSVGElement& timeContainerOwner) : m_discardScopeEle
ment(&timeContainerOwner) { } |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 continue; | 416 continue; |
415 resultElement = animation; | 417 resultElement = animation; |
416 } | 418 } |
417 | 419 |
418 // This will calculate the contribution from the animation and add i
t to the resultsElement. | 420 // This will calculate the contribution from the animation and add i
t to the resultsElement. |
419 if (!animation->progress(elapsed, resultElement, seekToTime) && resu
ltElement == animation) | 421 if (!animation->progress(elapsed, resultElement, seekToTime) && resu
ltElement == animation) |
420 resultElement = 0; | 422 resultElement = 0; |
421 | 423 |
422 SMILTime nextFireTime = animation->nextProgressTime(); | 424 SMILTime nextFireTime = animation->nextProgressTime(); |
423 if (nextFireTime.isFinite()) | 425 if (nextFireTime.isFinite()) |
424 earliestFireTime = std::min(nextFireTime, earliestFireTime); | 426 earliestFireTime = min(nextFireTime, earliestFireTime); |
425 } | 427 } |
426 | 428 |
427 if (resultElement) | 429 if (resultElement) |
428 animationsToApply.append(resultElement); | 430 animationsToApply.append(resultElement); |
429 } | 431 } |
430 m_scheduledAnimations.removeAll(invalidKeys); | 432 m_scheduledAnimations.removeAll(invalidKeys); |
431 | 433 |
432 std::sort(animationsToApply.begin(), animationsToApply.end(), PriorityCompar
e(elapsed)); | 434 std::sort(animationsToApply.begin(), animationsToApply.end(), PriorityCompar
e(elapsed)); |
433 | 435 |
434 unsigned animationsToApplySize = animationsToApply.size(); | 436 unsigned animationsToApplySize = animationsToApply.size(); |
(...skipping 29 matching lines...) Expand all Loading... |
464 } | 466 } |
465 return earliestFireTime; | 467 return earliestFireTime; |
466 } | 468 } |
467 | 469 |
468 void SMILTimeContainer::trace(Visitor* visitor) | 470 void SMILTimeContainer::trace(Visitor* visitor) |
469 { | 471 { |
470 visitor->trace(m_scheduledAnimations); | 472 visitor->trace(m_scheduledAnimations); |
471 } | 473 } |
472 | 474 |
473 } | 475 } |
OLD | NEW |