Title: [88378] trunk/Source
Revision
88378
Author
[email protected]
Date
2011-06-08 13:07:10 -0700 (Wed, 08 Jun 2011)

Log Message

2011-06-08  No'am Rosenthal  <[email protected]>

        Reviewed by Kenneth Rohde Christiansen.

        WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
        https://bugs.webkit.org/show_bug.cgi?id=61694

        No new tests, code path is not activated yet.

        * WebCore.xcodeproj/project.pbxproj: Changed the TransformOperation subclassed from "project" to "private"
2011-06-08  No'am Rosenthal  <[email protected]>

         Reviewed by Kenneth Rohde Christiansen.

         WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
         https://bugs.webkit.org/show_bug.cgi?id=61694

         Add ArgumentCoders for TransformOperation, including all the subclasses,
         and TransformOperations.

         * Scripts/webkit2/messages.py:
         * Shared/WebCoreArgumentCoders.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (88377 => 88378)


--- trunk/Source/WebCore/ChangeLog	2011-06-08 20:05:01 UTC (rev 88377)
+++ trunk/Source/WebCore/ChangeLog	2011-06-08 20:07:10 UTC (rev 88378)
@@ -1,3 +1,14 @@
+2011-06-08  No'am Rosenthal  <[email protected]>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
+        https://bugs.webkit.org/show_bug.cgi?id=61694
+
+        No new tests, code path is not activated yet.
+
+        * WebCore.xcodeproj/project.pbxproj: Changed the TransformOperation subclassed from "project" to "private"
+
 2011-06-08  Tom Sepez  <[email protected]>
 
         Reviewed by Adam Barth.

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (88377 => 88378)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-06-08 20:05:01 UTC (rev 88377)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2011-06-08 20:07:10 UTC (rev 88378)
@@ -1129,25 +1129,25 @@
 		49C7BA791042EFAE0009D447 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49C7BA781042EFAE0009D447 /* OpenGL.framework */; };
 		49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */; };
 		49D5DC2B0F423A73008F20FD /* Matrix3DTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D5DC270F423A73008F20FD /* Matrix3DTransformOperation.cpp */; };
-		49D5DC2C0F423A73008F20FD /* Matrix3DTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49D5DC280F423A73008F20FD /* Matrix3DTransformOperation.h */; };
+		49D5DC2C0F423A73008F20FD /* Matrix3DTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49D5DC280F423A73008F20FD /* Matrix3DTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49D5DC2D0F423A73008F20FD /* PerspectiveTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D5DC290F423A73008F20FD /* PerspectiveTransformOperation.cpp */; };
-		49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49D5DC2A0F423A73008F20FD /* PerspectiveTransformOperation.h */; };
+		49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49D5DC2A0F423A73008F20FD /* PerspectiveTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E911C30EF86D47009D0CAF /* TransformationMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B30EF86D47009D0CAF /* TransformationMatrix.cpp */; };
 		49E911C40EF86D47009D0CAF /* TransformationMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B40EF86D47009D0CAF /* TransformationMatrix.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */; };
+		49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E911C60EF86D47009D0CAF /* MatrixTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B60EF86D47009D0CAF /* MatrixTransformOperation.cpp */; };
-		49E911C70EF86D47009D0CAF /* MatrixTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B70EF86D47009D0CAF /* MatrixTransformOperation.h */; };
+		49E911C70EF86D47009D0CAF /* MatrixTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B70EF86D47009D0CAF /* MatrixTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E911C80EF86D47009D0CAF /* RotateTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B80EF86D47009D0CAF /* RotateTransformOperation.cpp */; };
-		49E911C90EF86D47009D0CAF /* RotateTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B90EF86D47009D0CAF /* RotateTransformOperation.h */; };
+		49E911C90EF86D47009D0CAF /* RotateTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B90EF86D47009D0CAF /* RotateTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E911CA0EF86D47009D0CAF /* ScaleTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911BA0EF86D47009D0CAF /* ScaleTransformOperation.cpp */; };
-		49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BB0EF86D47009D0CAF /* ScaleTransformOperation.h */; };
+		49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BB0EF86D47009D0CAF /* ScaleTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E911CC0EF86D47009D0CAF /* SkewTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911BC0EF86D47009D0CAF /* SkewTransformOperation.cpp */; };
-		49E911CD0EF86D47009D0CAF /* SkewTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BD0EF86D47009D0CAF /* SkewTransformOperation.h */; };
+		49E911CD0EF86D47009D0CAF /* SkewTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BD0EF86D47009D0CAF /* SkewTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E911CE0EF86D47009D0CAF /* TransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BE0EF86D47009D0CAF /* TransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E911CF0EF86D47009D0CAF /* TransformOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911BF0EF86D47009D0CAF /* TransformOperations.cpp */; };
 		49E911D00EF86D47009D0CAF /* TransformOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911C00EF86D47009D0CAF /* TransformOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E911D10EF86D47009D0CAF /* TranslateTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911C10EF86D47009D0CAF /* TranslateTransformOperation.cpp */; };
-		49E911D20EF86D47009D0CAF /* TranslateTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911C20EF86D47009D0CAF /* TranslateTransformOperation.h */; };
+		49E911D20EF86D47009D0CAF /* TranslateTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911C20EF86D47009D0CAF /* TranslateTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E912A50EFAC906009D0CAF /* Animation.cpp */; };
 		49E912AB0EFAC906009D0CAF /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E912A60EFAC906009D0CAF /* Animation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		49E912AC0EFAC906009D0CAF /* AnimationList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E912A70EFAC906009D0CAF /* AnimationList.cpp */; };

Modified: trunk/Source/WebKit2/ChangeLog (88377 => 88378)


--- trunk/Source/WebKit2/ChangeLog	2011-06-08 20:05:01 UTC (rev 88377)
+++ trunk/Source/WebKit2/ChangeLog	2011-06-08 20:07:10 UTC (rev 88378)
@@ -1,3 +1,16 @@
+2011-06-08  No'am Rosenthal  <[email protected]>
+
+         Reviewed by Kenneth Rohde Christiansen.
+
+         WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
+         https://bugs.webkit.org/show_bug.cgi?id=61694
+
+         Add ArgumentCoders for TransformOperation, including all the subclasses,
+         and TransformOperations.
+
+         * Scripts/webkit2/messages.py:
+         * Shared/WebCoreArgumentCoders.h:
+
 2011-06-08  Yael Aharon  <[email protected]>
 
         Reviewed by Andreas Kling.

Modified: trunk/Source/WebKit2/Scripts/webkit2/messages.py (88377 => 88378)


--- trunk/Source/WebKit2/Scripts/webkit2/messages.py	2011-06-08 20:05:01 UTC (rev 88377)
+++ trunk/Source/WebKit2/Scripts/webkit2/messages.py	2011-06-08 20:07:10 UTC (rev 88378)
@@ -255,12 +255,22 @@
         'WebCore::EditorCommandsForKeyEvent',
         'WebCore::CompositionUnderline',
         'WebCore::GrammarDetail',
+        'WebCore::IdentityTransformOperation',
         'WebCore::KeypressCommand',
         'WebCore::Length',
+        'WebCore::MatrixTransformOperation',
+        'WebCore::Matrix3DTransformOperation',
+        'WebCore::PerspectiveTransformOperation',
         'WebCore::PluginInfo',
         'WebCore::PrintInfo',
+        'WebCore::RotateTransformOperation',
+        'WebCore::ScaleTransformOperation',
+        'WebCore::SkewTransformOperation',
         'WebCore::TimingFunction',
         'WebCore::TransformationMatrix',
+        'WebCore::TransformOperation',
+        'WebCore::TransformOperations',
+        'WebCore::TranslateTransformOperation',
         'WebCore::ViewportArguments',
         'WebCore::WindowFeatures',
         'WebKit::AttributedString',

Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (88377 => 88378)


--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h	2011-06-08 20:05:01 UTC (rev 88377)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h	2011-06-08 20:07:10 UTC (rev 88378)
@@ -41,16 +41,26 @@
 #include <WebCore/EditorClient.h>
 #include <WebCore/FloatRect.h>
 #include <WebCore/GraphicsContext.h>
+#include <WebCore/IdentityTransformOperation.h>
 #include <WebCore/IntRect.h>
 #include <WebCore/KeyboardEvent.h>
 #include <WebCore/Length.h>
+#include <WebCore/Matrix3DTransformOperation.h>
+#include <WebCore/MatrixTransformOperation.h>
+#include <WebCore/PerspectiveTransformOperation.h>
 #include <WebCore/PluginData.h>
 #include <WebCore/ProtectionSpace.h>
 #include <WebCore/ResourceError.h>
 #include <WebCore/ResourceRequest.h>
+#include <WebCore/RotateTransformOperation.h>
+#include <WebCore/ScaleTransformOperation.h>
+#include <WebCore/SkewTransformOperation.h>
 #include <WebCore/TextCheckerClient.h>
 #include <WebCore/TimingFunction.h>
+#include <WebCore/TransformOperation.h>
+#include <WebCore/TransformOperations.h>
 #include <WebCore/TransformationMatrix.h>
+#include <WebCore/TranslateTransformOperation.h>
 #include <WebCore/ViewportArguments.h>
 #include <WebCore/WindowFeatures.h>
 #include <limits>
@@ -69,6 +79,14 @@
 template<> struct ArgumentCoder<WebCore::Length> : SimpleArgumentCoder<WebCore::Length> { };
 template<> struct ArgumentCoder<WebCore::TransformationMatrix> : SimpleArgumentCoder<WebCore::TransformationMatrix> { };
 
+template<> struct ArgumentCoder<WebCore::MatrixTransformOperation> : SimpleArgumentCoder<WebCore::MatrixTransformOperation> { };
+template<> struct ArgumentCoder<WebCore::Matrix3DTransformOperation> : SimpleArgumentCoder<WebCore::Matrix3DTransformOperation> { };
+template<> struct ArgumentCoder<WebCore::PerspectiveTransformOperation> : SimpleArgumentCoder<WebCore::PerspectiveTransformOperation> { };
+template<> struct ArgumentCoder<WebCore::RotateTransformOperation> : SimpleArgumentCoder<WebCore::RotateTransformOperation> { };
+template<> struct ArgumentCoder<WebCore::ScaleTransformOperation> : SimpleArgumentCoder<WebCore::ScaleTransformOperation> { };
+template<> struct ArgumentCoder<WebCore::SkewTransformOperation> : SimpleArgumentCoder<WebCore::SkewTransformOperation> { };
+template<> struct ArgumentCoder<WebCore::TranslateTransformOperation> : SimpleArgumentCoder<WebCore::TranslateTransformOperation> { };
+
 template<> struct ArgumentCoder<WebCore::MimeClassInfo> {
     static void encode(ArgumentEncoder* encoder, const WebCore::MimeClassInfo& mimeClassInfo)
     {
@@ -560,6 +578,160 @@
     }
 };
 
+template<> struct ArgumentCoder<RefPtr<WebCore::TransformOperation> > {
+    template<class T>
+    static bool decodeOperation(ArgumentDecoder* decoder, RefPtr<WebCore::TransformOperation>& operation, PassRefPtr<T> newOperation)
+    {
+        if (!ArgumentCoder<T>::decode(decoder, *newOperation.get()))
+            return false;
+        operation = newOperation.get();
+        return true;
+    }
+
+    template<class T>
+    static void encodeOperation(ArgumentEncoder* encoder, const WebCore::TransformOperation* operation)
+    {
+        ArgumentCoder<T>::encode(encoder, *static_cast<const T*>(operation));
+    }
+
+    static void encode(ArgumentEncoder* encoder, const RefPtr<WebCore::TransformOperation>& operation)
+    {
+        // We don't want to encode null-references.
+        ASSERT(operation);
+
+        WebCore::TransformOperation::OperationType type = operation->getOperationType();
+        encoder->encodeInt32(type);
+        switch (type) {
+        case WebCore::TransformOperation::SCALE:
+        case WebCore::TransformOperation::SCALE_X:
+        case WebCore::TransformOperation::SCALE_Y:
+        case WebCore::TransformOperation::SCALE_Z:
+        case WebCore::TransformOperation::SCALE_3D:
+            encodeOperation<WebCore::ScaleTransformOperation>(encoder, operation.get());
+            return;
+
+        case WebCore::TransformOperation::TRANSLATE:
+        case WebCore::TransformOperation::TRANSLATE_X:
+        case WebCore::TransformOperation::TRANSLATE_Y:
+        case WebCore::TransformOperation::TRANSLATE_Z:
+        case WebCore::TransformOperation::TRANSLATE_3D:
+            encodeOperation<WebCore::TranslateTransformOperation>(encoder, operation.get());
+            return;
+
+        case WebCore::TransformOperation::ROTATE:
+        case WebCore::TransformOperation::ROTATE_X:
+        case WebCore::TransformOperation::ROTATE_Y:
+        case WebCore::TransformOperation::ROTATE_3D:
+            encodeOperation<WebCore::RotateTransformOperation>(encoder, operation.get());
+            return;
+
+        case WebCore::TransformOperation::SKEW:
+        case WebCore::TransformOperation::SKEW_X:
+        case WebCore::TransformOperation::SKEW_Y:
+            encodeOperation<WebCore::SkewTransformOperation>(encoder, operation.get());
+            return;
+
+        case WebCore::TransformOperation::MATRIX:
+            encodeOperation<WebCore::MatrixTransformOperation>(encoder, operation.get());
+            return;
+
+        case WebCore::TransformOperation::MATRIX_3D:
+            encodeOperation<WebCore::Matrix3DTransformOperation>(encoder, operation.get());
+            return;
+
+        case WebCore::TransformOperation::PERSPECTIVE:
+            encodeOperation<WebCore::PerspectiveTransformOperation>(encoder, operation.get());
+            return;
+
+        case WebCore::TransformOperation::IDENTITY:
+        case WebCore::TransformOperation::NONE:
+            return;
+        }
+    }
+
+    static bool decode(ArgumentDecoder* decoder, RefPtr<WebCore::TransformOperation>& operation)
+    {
+        WebCore::TransformOperation::OperationType type;
+        int typeInt;
+        if (!decoder->decodeInt32(typeInt))
+            return false;
+        type = static_cast<WebCore::TransformOperation::OperationType>(typeInt);
+        switch (type) {
+        case WebCore::TransformOperation::SCALE:
+        case WebCore::TransformOperation::SCALE_X:
+        case WebCore::TransformOperation::SCALE_Y:
+        case WebCore::TransformOperation::SCALE_Z:
+        case WebCore::TransformOperation::SCALE_3D:
+            return decodeOperation<WebCore::ScaleTransformOperation>(decoder, operation, WebCore::ScaleTransformOperation::create(1.0, 1.0, type));
+
+        case WebCore::TransformOperation::TRANSLATE:
+        case WebCore::TransformOperation::TRANSLATE_X:
+        case WebCore::TransformOperation::TRANSLATE_Y:
+        case WebCore::TransformOperation::TRANSLATE_Z:
+        case WebCore::TransformOperation::TRANSLATE_3D:
+            return decodeOperation<WebCore::TranslateTransformOperation>(decoder, operation, WebCore::TranslateTransformOperation::create(WebCore::Length(0, WebCore::Fixed), WebCore::Length(0, WebCore::Fixed), type));
+
+        case WebCore::TransformOperation::ROTATE:
+        case WebCore::TransformOperation::ROTATE_X:
+        case WebCore::TransformOperation::ROTATE_Y:
+        case WebCore::TransformOperation::ROTATE_3D:
+            return decodeOperation<WebCore::RotateTransformOperation>(decoder, operation, WebCore::RotateTransformOperation::create(0.0, type));
+
+        case WebCore::TransformOperation::SKEW:
+        case WebCore::TransformOperation::SKEW_X:
+        case WebCore::TransformOperation::SKEW_Y:
+            return decodeOperation<WebCore::SkewTransformOperation>(decoder, operation, WebCore::SkewTransformOperation::create(0.0, 0.0, type));
+
+        case WebCore::TransformOperation::MATRIX:
+            return decodeOperation<WebCore::MatrixTransformOperation>(decoder, operation, WebCore::MatrixTransformOperation::create(WebCore::TransformationMatrix()));
+
+        case WebCore::TransformOperation::MATRIX_3D:
+            return decodeOperation<WebCore::Matrix3DTransformOperation>(decoder, operation, WebCore::Matrix3DTransformOperation::create(WebCore::TransformationMatrix()));
+
+        case WebCore::TransformOperation::PERSPECTIVE:
+            return decodeOperation<WebCore::PerspectiveTransformOperation>(decoder, operation, WebCore::PerspectiveTransformOperation::create(WebCore::Length(0, WebCore::Fixed)));
+
+        case WebCore::TransformOperation::IDENTITY:
+        case WebCore::TransformOperation::NONE:
+            operation = WebCore::IdentityTransformOperation::create();
+            return true;
+        }
+
+        return false;
+    }
+};
+
+template<> struct ArgumentCoder<WebCore::TransformOperations> {
+    static void encode(ArgumentEncoder* encoder, const WebCore::TransformOperations& operations)
+    {
+        WTF::Vector<RefPtr<WebCore::TransformOperation> > operationsVector = operations.operations();
+        int size = operationsVector.size();
+        encoder->encodeInt32(size);
+        for (int i = 0; i < size; ++i)
+            ArgumentCoder<RefPtr<WebCore::TransformOperation> >::encode(encoder, operationsVector[i]);
+    }
+
+    static bool decode(ArgumentDecoder* decoder, WebCore::TransformOperations& operations)
+    {
+        int size;
+        if (!decoder->decodeInt32(size))
+            return false;
+
+        WTF::Vector<RefPtr<WebCore::TransformOperation> >& operationVector = operations.operations();
+        operationVector.clear();
+        operationVector.resize(size);
+        for (int i = 0; i < size; ++i) {
+            RefPtr<WebCore::TransformOperation> operation;
+            if (!ArgumentCoder<RefPtr<WebCore::TransformOperation> >::decode(decoder, operation))
+                return false;
+            operationVector[i] = operation;
+        }
+
+        return true;
+    }
+};
+
+
 template<> struct ArgumentCoder<WebCore::Animation> {
     static bool encodeBoolAndReturnValue(ArgumentEncoder* encoder, bool value)
     {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to