Title: [88215] trunk/Source/WebCore
- Revision
- 88215
- Author
- noam.rosent...@nokia.com
- Date
- 2011-06-06 21:42:45 -0700 (Mon, 06 Jun 2011)
Log Message
2011-06-06 No'am Rosenthal <noam.rosent...@nokia.com>
Reviewed by Simon Fraser.
Allow copying of KeyframeValueList.
https://bugs.webkit.org/show_bug.cgi?id=62171
Make a deep copy of KeyframeValueList, copying each of the keyframes with a virtual clone() function.
No new functionality so no new tests.
* platform/graphics/GraphicsLayer.h:
(WebCore::FloatAnimationValue::clone):
(WebCore::TransformAnimationValue::TransformAnimationValue):
(WebCore::TransformAnimationValue::clone):
(WebCore::TransformAnimationValue::value):
(WebCore::KeyframeValueList::KeyframeValueList):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (88214 => 88215)
--- trunk/Source/WebCore/ChangeLog 2011-06-07 04:12:32 UTC (rev 88214)
+++ trunk/Source/WebCore/ChangeLog 2011-06-07 04:42:45 UTC (rev 88215)
@@ -1,3 +1,21 @@
+2011-06-06 No'am Rosenthal <noam.rosent...@nokia.com>
+
+ Reviewed by Simon Fraser.
+
+ Allow copying of KeyframeValueList.
+ https://bugs.webkit.org/show_bug.cgi?id=62171
+
+ Make a deep copy of KeyframeValueList, copying each of the keyframes with a virtual clone() function.
+
+ No new functionality so no new tests.
+
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::FloatAnimationValue::clone):
+ (WebCore::TransformAnimationValue::TransformAnimationValue):
+ (WebCore::TransformAnimationValue::clone):
+ (WebCore::TransformAnimationValue::value):
+ (WebCore::KeyframeValueList::KeyframeValueList):
+
2011-06-06 Simon Fraser <simon.fra...@apple.com>
Reviewed by Dan Bernstein.
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (88214 => 88215)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2011-06-07 04:12:32 UTC (rev 88214)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2011-06-07 04:42:45 UTC (rev 88215)
@@ -90,7 +90,6 @@
// represent values for properties being animated via the GraphicsLayer,
// without pulling in style-related data from outside of the platform directory.
class AnimationValue {
- WTF_MAKE_NONCOPYABLE(AnimationValue); WTF_MAKE_FAST_ALLOCATED;
public:
AnimationValue(float keyTime, PassRefPtr<TimingFunction> timingFunction = 0)
: m_keyTime(keyTime)
@@ -103,6 +102,7 @@
float keyTime() const { return m_keyTime; }
const TimingFunction* timingFunction() const { return m_timingFunction.get(); }
+ virtual AnimationValue* clone() const = 0;
private:
float m_keyTime;
@@ -117,6 +117,7 @@
, m_value(value)
{
}
+ virtual AnimationValue* clone() const { return new FloatAnimationValue(*this); }
float value() const { return m_value; }
@@ -131,26 +132,33 @@
: AnimationValue(keyTime, timingFunction)
{
if (value)
- m_value = adoptPtr(new TransformOperations(*value));
+ m_value = *value;
}
+ virtual AnimationValue* clone() const { return new TransformAnimationValue(*this); }
- const TransformOperations* value() const { return m_value.get(); }
+ const TransformOperations* value() const { return &m_value; }
private:
- OwnPtr<TransformOperations> m_value;
+ TransformOperations m_value;
};
// Used to store a series of values in a keyframe list. Values will all be of the same type,
// which can be inferred from the property.
class KeyframeValueList {
- WTF_MAKE_NONCOPYABLE(KeyframeValueList); WTF_MAKE_FAST_ALLOCATED;
public:
KeyframeValueList(AnimatedPropertyID property)
: m_property(property)
{
}
-
+
+ KeyframeValueList(const KeyframeValueList& other)
+ : m_property(other.property())
+ {
+ for (size_t i = 0; i < other.m_values.size(); ++i)
+ m_values.append(other.m_values[i]->clone());
+ }
+
~KeyframeValueList()
{
deleteAllValues(m_values);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes