| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 3 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 | 577 |
| 578 if (fromLength == toLength || (fromLength <= 1 && toLength <= 1)) { | 578 if (fromLength == toLength || (fromLength <= 1 && toLength <= 1)) { |
| 579 (dst->*m_setter)(blendSimpleOrMatchedShadowLists(anim, progress, sha
dowA, shadowB), false); | 579 (dst->*m_setter)(blendSimpleOrMatchedShadowLists(anim, progress, sha
dowA, shadowB), false); |
| 580 return; | 580 return; |
| 581 } | 581 } |
| 582 | 582 |
| 583 (dst->*m_setter)(blendMismatchedShadowLists(anim, progress, shadowA, sha
dowB, fromLength, toLength), false); | 583 (dst->*m_setter)(blendMismatchedShadowLists(anim, progress, shadowA, sha
dowB, fromLength, toLength), false); |
| 584 } | 584 } |
| 585 | 585 |
| 586 private: | 586 private: |
| 587 PassOwnPtr<ShadowData*> blendSimpleOrMatchedShadowLists(const AnimationBase*
anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB) co
nst | 587 PassOwnPtr<ShadowData> blendSimpleOrMatchedShadowLists(const AnimationBase*
anim, double progress, const ShadowData* shadowA, const ShadowData* shadowB) con
st |
| 588 { | 588 { |
| 589 OwnPtr<ShadowData> newShadowData; | 589 OwnPtr<ShadowData> newShadowData; |
| 590 ShadowData* lastShadow = 0; | 590 ShadowData* lastShadow = 0; |
| 591 | 591 |
| 592 while (shadowA || shadowB) { | 592 while (shadowA || shadowB) { |
| 593 const ShadowData* srcShadow = shadowForBlending(shadowA, shadowB); | 593 const ShadowData* srcShadow = shadowForBlending(shadowA, shadowB); |
| 594 const ShadowData* dstShadow = shadowForBlending(shadowB, shadowA); | 594 const ShadowData* dstShadow = shadowForBlending(shadowB, shadowA); |
| 595 | 595 |
| 596 OwnPtr<ShadowData> blendedShadow = blendFunc(anim, srcShadow, dstSha
dow, progress); | 596 OwnPtr<ShadowData> blendedShadow = blendFunc(anim, srcShadow, dstSha
dow, progress); |
| 597 ShadowData* blendedShadowPtr = blendedShadow.get(); | 597 ShadowData* blendedShadowPtr = blendedShadow.get(); |
| 598 | 598 |
| 599 if (!lastShadow) | 599 if (!lastShadow) |
| 600 newShadowData = blendedShadow.release(); | 600 newShadowData = blendedShadow.release(); |
| 601 else | 601 else |
| 602 lastShadow->setNext(blendedShadow.release()); | 602 lastShadow->setNext(blendedShadow.release()); |
| 603 | 603 |
| 604 lastShadow = blendedShadowPtr; | 604 lastShadow = blendedShadowPtr; |
| 605 | 605 |
| 606 shadowA = shadowA ? shadowA->next() : 0; | 606 shadowA = shadowA ? shadowA->next() : 0; |
| 607 shadowB = shadowB ? shadowB->next() : 0; | 607 shadowB = shadowB ? shadowB->next() : 0; |
| 608 } | 608 } |
| 609 | 609 |
| 610 return newShadowData.release(); | 610 return newShadowData.release(); |
| 611 } | 611 } |
| 612 | 612 |
| 613 PassOwnPtr<ShadowData*> blendMismatchedShadowLists(const AnimationBase* anim
, double progress, const ShadowData* shadowA, const ShadowData* shadowB, int fro
mLength, int toLength) const | 613 PassOwnPtr<ShadowData> blendMismatchedShadowLists(const AnimationBase* anim,
double progress, const ShadowData* shadowA, const ShadowData* shadowB, int from
Length, int toLength) const |
| 614 { | 614 { |
| 615 // The shadows in ShadowData are stored in reverse order, so when animat
ing mismatched lists, | 615 // The shadows in ShadowData are stored in reverse order, so when animat
ing mismatched lists, |
| 616 // reverse them and match from the end. | 616 // reverse them and match from the end. |
| 617 Vector<const ShadowData*, 4> fromShadows(fromLength); | 617 Vector<const ShadowData*, 4> fromShadows(fromLength); |
| 618 for (int i = fromLength - 1; i >= 0; --i) { | 618 for (int i = fromLength - 1; i >= 0; --i) { |
| 619 fromShadows[i] = shadowA; | 619 fromShadows[i] = shadowA; |
| 620 shadowA = shadowA->next(); | 620 shadowA = shadowA->next(); |
| 621 } | 621 } |
| 622 | 622 |
| 623 Vector<const ShadowData*, 4> toShadows(toLength); | 623 Vector<const ShadowData*, 4> toShadows(toLength); |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 } | 1263 } |
| 1264 | 1264 |
| 1265 int CSSPropertyAnimation::getNumProperties() | 1265 int CSSPropertyAnimation::getNumProperties() |
| 1266 { | 1266 { |
| 1267 ensurePropertyMap(); | 1267 ensurePropertyMap(); |
| 1268 | 1268 |
| 1269 return gPropertyWrappers->size(); | 1269 return gPropertyWrappers->size(); |
| 1270 } | 1270 } |
| 1271 | 1271 |
| 1272 } | 1272 } |
| OLD | NEW |