| 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 | |
| 38 namespace WebCore { | 36 namespace WebCore { |
| 39 | 37 |
| 40 static const double initialFrameDelay = 0.025; | 38 static const double initialFrameDelay = 0.025; |
| 41 | 39 |
| 42 #if !ENABLE(OILPAN) | 40 #if !ENABLE(OILPAN) |
| 43 // Every entry-point that calls updateAnimations() should instantiate a | 41 // Every entry-point that calls updateAnimations() should instantiate a |
| 44 // DiscardScope to prevent deletion of the ownerElement (and hence itself.) | 42 // DiscardScope to prevent deletion of the ownerElement (and hence itself.) |
| 45 class DiscardScope { | 43 class DiscardScope { |
| 46 public: | 44 public: |
| 47 explicit DiscardScope(SVGSVGElement& timeContainerOwner) : m_discardScopeEle
ment(&timeContainerOwner) { } | 45 explicit DiscardScope(SVGSVGElement& timeContainerOwner) : m_discardScopeEle
ment(&timeContainerOwner) { } |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 continue; | 414 continue; |
| 417 resultElement = animation; | 415 resultElement = animation; |
| 418 } | 416 } |
| 419 | 417 |
| 420 // This will calculate the contribution from the animation and add i
t to the resultsElement. | 418 // This will calculate the contribution from the animation and add i
t to the resultsElement. |
| 421 if (!animation->progress(elapsed, resultElement, seekToTime) && resu
ltElement == animation) | 419 if (!animation->progress(elapsed, resultElement, seekToTime) && resu
ltElement == animation) |
| 422 resultElement = 0; | 420 resultElement = 0; |
| 423 | 421 |
| 424 SMILTime nextFireTime = animation->nextProgressTime(); | 422 SMILTime nextFireTime = animation->nextProgressTime(); |
| 425 if (nextFireTime.isFinite()) | 423 if (nextFireTime.isFinite()) |
| 426 earliestFireTime = min(nextFireTime, earliestFireTime); | 424 earliestFireTime = std::min(nextFireTime, earliestFireTime); |
| 427 } | 425 } |
| 428 | 426 |
| 429 if (resultElement) | 427 if (resultElement) |
| 430 animationsToApply.append(resultElement); | 428 animationsToApply.append(resultElement); |
| 431 } | 429 } |
| 432 m_scheduledAnimations.removeAll(invalidKeys); | 430 m_scheduledAnimations.removeAll(invalidKeys); |
| 433 | 431 |
| 434 std::sort(animationsToApply.begin(), animationsToApply.end(), PriorityCompar
e(elapsed)); | 432 std::sort(animationsToApply.begin(), animationsToApply.end(), PriorityCompar
e(elapsed)); |
| 435 | 433 |
| 436 unsigned animationsToApplySize = animationsToApply.size(); | 434 unsigned animationsToApplySize = animationsToApply.size(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 466 } | 464 } |
| 467 return earliestFireTime; | 465 return earliestFireTime; |
| 468 } | 466 } |
| 469 | 467 |
| 470 void SMILTimeContainer::trace(Visitor* visitor) | 468 void SMILTimeContainer::trace(Visitor* visitor) |
| 471 { | 469 { |
| 472 visitor->trace(m_scheduledAnimations); | 470 visitor->trace(m_scheduledAnimations); |
| 473 } | 471 } |
| 474 | 472 |
| 475 } | 473 } |
| OLD | NEW |