OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 Color fromColor = m_animationElement->animationMode() == ToAnimation ? anima
ted->color() : from->color(); | 76 Color fromColor = m_animationElement->animationMode() == ToAnimation ? anima
ted->color() : from->color(); |
77 Color toColor = to->color(); | 77 Color toColor = to->color(); |
78 Color toAtEndOfDurationColor = toAtEndOfDuration->color(); | 78 Color toAtEndOfDurationColor = toAtEndOfDuration->color(); |
79 Color& animatedColor = animated->color(); | 79 Color& animatedColor = animated->color(); |
80 | 80 |
81 // Apply CSS inheritance rules. | 81 // Apply CSS inheritance rules. |
82 m_animationElement->adjustForInheritance<Color>(parseColorFromString, m_anim
ationElement->fromPropertyValueType(), fromColor, m_contextElement); | 82 m_animationElement->adjustForInheritance<Color>(parseColorFromString, m_anim
ationElement->fromPropertyValueType(), fromColor, m_contextElement); |
83 m_animationElement->adjustForInheritance<Color>(parseColorFromString, m_anim
ationElement->toPropertyValueType(), toColor, m_contextElement); | 83 m_animationElement->adjustForInheritance<Color>(parseColorFromString, m_anim
ationElement->toPropertyValueType(), toColor, m_contextElement); |
84 | 84 |
85 // Apply <animateColor> rules. | 85 // Apply currentColor rules. |
86 adjustForCurrentColor(m_contextElement, fromColor); | 86 adjustForCurrentColor(m_contextElement, fromColor); |
87 adjustForCurrentColor(m_contextElement, toColor); | 87 adjustForCurrentColor(m_contextElement, toColor); |
88 adjustForCurrentColor(m_contextElement, toAtEndOfDurationColor); | 88 adjustForCurrentColor(m_contextElement, toAtEndOfDurationColor); |
89 | 89 |
90 float animatedRed = animatedColor.red(); | 90 float animatedRed = animatedColor.red(); |
91 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor
.red(), toColor.red(), toAtEndOfDurationColor.red(), animatedRed); | 91 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor
.red(), toColor.red(), toAtEndOfDurationColor.red(), animatedRed); |
92 | 92 |
93 float animatedGreen = animatedColor.green(); | 93 float animatedGreen = animatedColor.green(); |
94 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor
.green(), toColor.green(), toAtEndOfDurationColor.green(), animatedGreen); | 94 m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor
.green(), toColor.green(), toAtEndOfDurationColor.green(), animatedGreen); |
95 | 95 |
(...skipping 12 matching lines...) Expand all Loading... |
108 Color from = SVGColor::colorFromRGBColorString(fromString); | 108 Color from = SVGColor::colorFromRGBColorString(fromString); |
109 if (!from.isValid()) | 109 if (!from.isValid()) |
110 return -1; | 110 return -1; |
111 Color to = SVGColor::colorFromRGBColorString(toString); | 111 Color to = SVGColor::colorFromRGBColorString(toString); |
112 if (!to.isValid()) | 112 if (!to.isValid()) |
113 return -1; | 113 return -1; |
114 return ColorDistance::distance(from, to); | 114 return ColorDistance::distance(from, to); |
115 } | 115 } |
116 | 116 |
117 } | 117 } |
OLD | NEW |