Title: [87701] trunk/Source
- Revision
- 87701
- Author
- noam.rosent...@nokia.com
- Date
- 2011-05-30 16:43:58 -0700 (Mon, 30 May 2011)
Log Message
2011-05-30 No'am Rosenthal <noam.rosent...@nokia.com>
Reviewed by Simon Hausmann.
WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
https://bugs.webkit.org/show_bug.cgi?id=61694
Added a public TimingFunction::type() method.
No new functionality, so no new tests.
* platform/animation/TimingFunction.h:
(WebCore::TimingFunction::type):
2011-05-30 No'am Rosenthal <noam.rosent...@nokia.com>
Reviewed by Simon Hausmann.
WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
https://bugs.webkit.org/show_bug.cgi?id=61694
Add an ArgumentCoder for WebCore::TimingFunction. This serializer can create the appropriate
TimingFunction subclass based on the type of timing function.
* Scripts/webkit2/messages.py:
* Shared/WebCoreArgumentCoders.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (87700 => 87701)
--- trunk/Source/WebCore/ChangeLog 2011-05-30 22:29:50 UTC (rev 87700)
+++ trunk/Source/WebCore/ChangeLog 2011-05-30 23:43:58 UTC (rev 87701)
@@ -1,3 +1,17 @@
+2011-05-30 No'am Rosenthal <noam.rosent...@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
+ https://bugs.webkit.org/show_bug.cgi?id=61694
+
+ Added a public TimingFunction::type() method.
+
+ No new functionality, so no new tests.
+
+ * platform/animation/TimingFunction.h:
+ (WebCore::TimingFunction::type):
+
2011-05-30 Noam Rosenthal <noam.rosent...@nokia.com>
BUILD FIX for r87697 on Windows/Symbian
Modified: trunk/Source/WebCore/platform/animation/TimingFunction.h (87700 => 87701)
--- trunk/Source/WebCore/platform/animation/TimingFunction.h 2011-05-30 22:29:50 UTC (rev 87700)
+++ trunk/Source/WebCore/platform/animation/TimingFunction.h 2011-05-30 23:43:58 UTC (rev 87701)
@@ -37,6 +37,8 @@
};
virtual ~TimingFunction() { }
+
+ TimingFunctionType type() const { return m_type; }
bool isLinearTimingFunction() const { return m_type == LinearFunction; }
bool isCubicBezierTimingFunction() const { return m_type == CubicBezierFunction; }
Modified: trunk/Source/WebKit2/ChangeLog (87700 => 87701)
--- trunk/Source/WebKit2/ChangeLog 2011-05-30 22:29:50 UTC (rev 87700)
+++ trunk/Source/WebKit2/ChangeLog 2011-05-30 23:43:58 UTC (rev 87701)
@@ -5,6 +5,19 @@
WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
https://bugs.webkit.org/show_bug.cgi?id=61694
+ Add an ArgumentCoder for WebCore::TimingFunction. This serializer can create the appropriate
+ TimingFunction subclass based on the type of timing function.
+
+ * Scripts/webkit2/messages.py:
+ * Shared/WebCoreArgumentCoders.h:
+
+2011-05-30 No'am Rosenthal <noam.rosent...@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
+ https://bugs.webkit.org/show_bug.cgi?id=61694
+
Add WebCore::Length and WebCore::TransformationMatrix to the types that use SimpleArgumentCoder.
* Scripts/webkit2/messages.py:
Modified: trunk/Source/WebKit2/Scripts/webkit2/messages.py (87700 => 87701)
--- trunk/Source/WebKit2/Scripts/webkit2/messages.py 2011-05-30 22:29:50 UTC (rev 87700)
+++ trunk/Source/WebKit2/Scripts/webkit2/messages.py 2011-05-30 23:43:58 UTC (rev 87701)
@@ -258,6 +258,7 @@
'WebCore::Length',
'WebCore::PluginInfo',
'WebCore::PrintInfo',
+ 'WebCore::TimingFunction',
'WebCore::TransformationMatrix',
'WebCore::ViewportArguments',
'WebCore::WindowFeatures',
Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (87700 => 87701)
--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h 2011-05-30 22:29:50 UTC (rev 87700)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h 2011-05-30 23:43:58 UTC (rev 87701)
@@ -48,6 +48,7 @@
#include <WebCore/ResourceError.h>
#include <WebCore/ResourceRequest.h>
#include <WebCore/TextCheckerClient.h>
+#include <WebCore/TimingFunction.h>
#include <WebCore/TransformationMatrix.h>
#include <WebCore/ViewportArguments.h>
#include <WebCore/WindowFeatures.h>
@@ -485,6 +486,79 @@
}
};
+template<> struct ArgumentCoder<RefPtr<WebCore::TimingFunction> > {
+ static void encode(ArgumentEncoder* encoder, const RefPtr<WebCore::TimingFunction>& function)
+ {
+ // We don't want to encode null-references.
+ ASSERT(function);
+
+ WebCore::TimingFunction::TimingFunctionType type = function->type();
+ encoder->encodeInt32(type);
+ switch (type) {
+ case WebCore::TimingFunction::LinearFunction:
+ break;
+ case WebCore::TimingFunction::CubicBezierFunction: {
+ WebCore::CubicBezierTimingFunction* cubicFunction = static_cast<WebCore::CubicBezierTimingFunction*>(function.get());
+ encoder->encodeDouble(cubicFunction->x1());
+ encoder->encodeDouble(cubicFunction->y1());
+ encoder->encodeDouble(cubicFunction->x2());
+ encoder->encodeDouble(cubicFunction->y2());
+ break;
+ }
+ case WebCore::TimingFunction::StepsFunction: {
+ WebCore::StepsTimingFunction* stepsFunction = static_cast<WebCore::StepsTimingFunction*>(function.get());
+ encoder->encodeInt32(stepsFunction->numberOfSteps());
+ encoder->encodeBool(stepsFunction->stepAtStart());
+ break;
+ }
+ }
+ }
+
+ static bool decode(ArgumentDecoder* decoder, RefPtr<WebCore::TimingFunction>& function)
+ {
+ WebCore::TimingFunction::TimingFunctionType type;
+ int typeInt;
+ if (!decoder->decodeInt32(typeInt))
+ return false;
+
+ type = static_cast<WebCore::TimingFunction::TimingFunctionType>(typeInt);
+ switch (type) {
+ case WebCore::TimingFunction::LinearFunction:
+ function = WebCore::LinearTimingFunction::create();
+ return true;
+
+ case WebCore::TimingFunction::CubicBezierFunction: {
+ double x1, y1, x2, y2;
+ if (!decoder->decodeDouble(x1))
+ return false;
+ if (!decoder->decodeDouble(y1))
+ return false;
+ if (!decoder->decodeDouble(x2))
+ return false;
+ if (!decoder->decodeDouble(y2))
+ return false;
+ function = WebCore::CubicBezierTimingFunction::create(x1, y1, x2, y2);
+ return true;
+ }
+
+ case WebCore::TimingFunction::StepsFunction: {
+ int numSteps;
+ bool stepAtStart;
+ if (!decoder->decodeInt32(numSteps))
+ return false;
+ if (!decoder->decodeBool(stepAtStart))
+ return false;
+
+ function = WebCore::StepsTimingFunction::create(numSteps, stepAtStart);
+ return true;
+ }
+
+ }
+
+ return false;
+ }
+};
+
} // namespace CoreIPC
#endif // WebCoreArgumentCoders_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes