Changeset 88378 in webkit


Ignore:
Timestamp:
Jun 8, 2011 1:07:10 PM (13 years ago)
Author:
noam.rosenthal@nokia.com
Message:

2011-06-08 No'am Rosenthal <noam.rosenthal@nokia.com>

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 <noam.rosenthal@nokia.com>

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:
Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r88377 r88378  
     12011-06-08  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
     6        https://bugs.webkit.org/show_bug.cgi?id=61694
     7
     8        No new tests, code path is not activated yet.
     9
     10        * WebCore.xcodeproj/project.pbxproj: Changed the TransformOperation subclassed from "project" to "private"
     11
    1122011-06-08  Tom Sepez  <tsepez@chromium.org>
    213
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r88343 r88378  
    11301130                49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */; };
    11311131                49D5DC2B0F423A73008F20FD /* Matrix3DTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D5DC270F423A73008F20FD /* Matrix3DTransformOperation.cpp */; };
    1132                 49D5DC2C0F423A73008F20FD /* Matrix3DTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49D5DC280F423A73008F20FD /* Matrix3DTransformOperation.h */; };
     1132                49D5DC2C0F423A73008F20FD /* Matrix3DTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49D5DC280F423A73008F20FD /* Matrix3DTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11331133                49D5DC2D0F423A73008F20FD /* PerspectiveTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D5DC290F423A73008F20FD /* PerspectiveTransformOperation.cpp */; };
    1134                 49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49D5DC2A0F423A73008F20FD /* PerspectiveTransformOperation.h */; };
     1134                49D5DC2E0F423A73008F20FD /* PerspectiveTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49D5DC2A0F423A73008F20FD /* PerspectiveTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11351135                49E911C30EF86D47009D0CAF /* TransformationMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B30EF86D47009D0CAF /* TransformationMatrix.cpp */; };
    11361136                49E911C40EF86D47009D0CAF /* TransformationMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B40EF86D47009D0CAF /* TransformationMatrix.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1137                 49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */; };
     1137                49E911C50EF86D47009D0CAF /* IdentityTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B50EF86D47009D0CAF /* IdentityTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11381138                49E911C60EF86D47009D0CAF /* MatrixTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B60EF86D47009D0CAF /* MatrixTransformOperation.cpp */; };
    1139                 49E911C70EF86D47009D0CAF /* MatrixTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B70EF86D47009D0CAF /* MatrixTransformOperation.h */; };
     1139                49E911C70EF86D47009D0CAF /* MatrixTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B70EF86D47009D0CAF /* MatrixTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11401140                49E911C80EF86D47009D0CAF /* RotateTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911B80EF86D47009D0CAF /* RotateTransformOperation.cpp */; };
    1141                 49E911C90EF86D47009D0CAF /* RotateTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B90EF86D47009D0CAF /* RotateTransformOperation.h */; };
     1141                49E911C90EF86D47009D0CAF /* RotateTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911B90EF86D47009D0CAF /* RotateTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11421142                49E911CA0EF86D47009D0CAF /* ScaleTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911BA0EF86D47009D0CAF /* ScaleTransformOperation.cpp */; };
    1143                 49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BB0EF86D47009D0CAF /* ScaleTransformOperation.h */; };
     1143                49E911CB0EF86D47009D0CAF /* ScaleTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BB0EF86D47009D0CAF /* ScaleTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11441144                49E911CC0EF86D47009D0CAF /* SkewTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911BC0EF86D47009D0CAF /* SkewTransformOperation.cpp */; };
    1145                 49E911CD0EF86D47009D0CAF /* SkewTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BD0EF86D47009D0CAF /* SkewTransformOperation.h */; };
     1145                49E911CD0EF86D47009D0CAF /* SkewTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BD0EF86D47009D0CAF /* SkewTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11461146                49E911CE0EF86D47009D0CAF /* TransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911BE0EF86D47009D0CAF /* TransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11471147                49E911CF0EF86D47009D0CAF /* TransformOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911BF0EF86D47009D0CAF /* TransformOperations.cpp */; };
    11481148                49E911D00EF86D47009D0CAF /* TransformOperations.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911C00EF86D47009D0CAF /* TransformOperations.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11491149                49E911D10EF86D47009D0CAF /* TranslateTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E911C10EF86D47009D0CAF /* TranslateTransformOperation.cpp */; };
    1150                 49E911D20EF86D47009D0CAF /* TranslateTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911C20EF86D47009D0CAF /* TranslateTransformOperation.h */; };
     1150                49E911D20EF86D47009D0CAF /* TranslateTransformOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E911C20EF86D47009D0CAF /* TranslateTransformOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
    11511151                49E912AA0EFAC906009D0CAF /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E912A50EFAC906009D0CAF /* Animation.cpp */; };
    11521152                49E912AB0EFAC906009D0CAF /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E912A60EFAC906009D0CAF /* Animation.h */; settings = {ATTRIBUTES = (Private, ); }; };
  • trunk/Source/WebKit2/ChangeLog

    r88350 r88378  
     12011-06-08  No'am Rosenthal  <noam.rosenthal@nokia.com>
     2
     3         Reviewed by Kenneth Rohde Christiansen.
     4
     5         WebKit2: Enable serializing of data types needed for cross-process accelerated compositing
     6         https://bugs.webkit.org/show_bug.cgi?id=61694
     7
     8         Add ArgumentCoders for TransformOperation, including all the subclasses,
     9         and TransformOperations.
     10
     11         * Scripts/webkit2/messages.py:
     12         * Shared/WebCoreArgumentCoders.h:
     13
    1142011-06-08  Yael Aharon  <yael.aharon@nokia.com>
    215
  • trunk/Source/WebKit2/Scripts/webkit2/messages.py

    r88223 r88378  
    256256        'WebCore::CompositionUnderline',
    257257        'WebCore::GrammarDetail',
     258        'WebCore::IdentityTransformOperation',
    258259        'WebCore::KeypressCommand',
    259260        'WebCore::Length',
     261        'WebCore::MatrixTransformOperation',
     262        'WebCore::Matrix3DTransformOperation',
     263        'WebCore::PerspectiveTransformOperation',
    260264        'WebCore::PluginInfo',
    261265        'WebCore::PrintInfo',
     266        'WebCore::RotateTransformOperation',
     267        'WebCore::ScaleTransformOperation',
     268        'WebCore::SkewTransformOperation',
    262269        'WebCore::TimingFunction',
    263270        'WebCore::TransformationMatrix',
     271        'WebCore::TransformOperation',
     272        'WebCore::TransformOperations',
     273        'WebCore::TranslateTransformOperation',
    264274        'WebCore::ViewportArguments',
    265275        'WebCore::WindowFeatures',
  • trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h

    r88223 r88378  
    4242#include <WebCore/FloatRect.h>
    4343#include <WebCore/GraphicsContext.h>
     44#include <WebCore/IdentityTransformOperation.h>
    4445#include <WebCore/IntRect.h>
    4546#include <WebCore/KeyboardEvent.h>
    4647#include <WebCore/Length.h>
     48#include <WebCore/Matrix3DTransformOperation.h>
     49#include <WebCore/MatrixTransformOperation.h>
     50#include <WebCore/PerspectiveTransformOperation.h>
    4751#include <WebCore/PluginData.h>
    4852#include <WebCore/ProtectionSpace.h>
    4953#include <WebCore/ResourceError.h>
    5054#include <WebCore/ResourceRequest.h>
     55#include <WebCore/RotateTransformOperation.h>
     56#include <WebCore/ScaleTransformOperation.h>
     57#include <WebCore/SkewTransformOperation.h>
    5158#include <WebCore/TextCheckerClient.h>
    5259#include <WebCore/TimingFunction.h>
     60#include <WebCore/TransformOperation.h>
     61#include <WebCore/TransformOperations.h>
    5362#include <WebCore/TransformationMatrix.h>
     63#include <WebCore/TranslateTransformOperation.h>
    5464#include <WebCore/ViewportArguments.h>
    5565#include <WebCore/WindowFeatures.h>
     
    6979template<> struct ArgumentCoder<WebCore::Length> : SimpleArgumentCoder<WebCore::Length> { };
    7080template<> struct ArgumentCoder<WebCore::TransformationMatrix> : SimpleArgumentCoder<WebCore::TransformationMatrix> { };
     81
     82template<> struct ArgumentCoder<WebCore::MatrixTransformOperation> : SimpleArgumentCoder<WebCore::MatrixTransformOperation> { };
     83template<> struct ArgumentCoder<WebCore::Matrix3DTransformOperation> : SimpleArgumentCoder<WebCore::Matrix3DTransformOperation> { };
     84template<> struct ArgumentCoder<WebCore::PerspectiveTransformOperation> : SimpleArgumentCoder<WebCore::PerspectiveTransformOperation> { };
     85template<> struct ArgumentCoder<WebCore::RotateTransformOperation> : SimpleArgumentCoder<WebCore::RotateTransformOperation> { };
     86template<> struct ArgumentCoder<WebCore::ScaleTransformOperation> : SimpleArgumentCoder<WebCore::ScaleTransformOperation> { };
     87template<> struct ArgumentCoder<WebCore::SkewTransformOperation> : SimpleArgumentCoder<WebCore::SkewTransformOperation> { };
     88template<> struct ArgumentCoder<WebCore::TranslateTransformOperation> : SimpleArgumentCoder<WebCore::TranslateTransformOperation> { };
    7189
    7290template<> struct ArgumentCoder<WebCore::MimeClassInfo> {
     
    560578    }
    561579};
     580
     581template<> struct ArgumentCoder<RefPtr<WebCore::TransformOperation> > {
     582    template<class T>
     583    static bool decodeOperation(ArgumentDecoder* decoder, RefPtr<WebCore::TransformOperation>& operation, PassRefPtr<T> newOperation)
     584    {
     585        if (!ArgumentCoder<T>::decode(decoder, *newOperation.get()))
     586            return false;
     587        operation = newOperation.get();
     588        return true;
     589    }
     590
     591    template<class T>
     592    static void encodeOperation(ArgumentEncoder* encoder, const WebCore::TransformOperation* operation)
     593    {
     594        ArgumentCoder<T>::encode(encoder, *static_cast<const T*>(operation));
     595    }
     596
     597    static void encode(ArgumentEncoder* encoder, const RefPtr<WebCore::TransformOperation>& operation)
     598    {
     599        // We don't want to encode null-references.
     600        ASSERT(operation);
     601
     602        WebCore::TransformOperation::OperationType type = operation->getOperationType();
     603        encoder->encodeInt32(type);
     604        switch (type) {
     605        case WebCore::TransformOperation::SCALE:
     606        case WebCore::TransformOperation::SCALE_X:
     607        case WebCore::TransformOperation::SCALE_Y:
     608        case WebCore::TransformOperation::SCALE_Z:
     609        case WebCore::TransformOperation::SCALE_3D:
     610            encodeOperation<WebCore::ScaleTransformOperation>(encoder, operation.get());
     611            return;
     612
     613        case WebCore::TransformOperation::TRANSLATE:
     614        case WebCore::TransformOperation::TRANSLATE_X:
     615        case WebCore::TransformOperation::TRANSLATE_Y:
     616        case WebCore::TransformOperation::TRANSLATE_Z:
     617        case WebCore::TransformOperation::TRANSLATE_3D:
     618            encodeOperation<WebCore::TranslateTransformOperation>(encoder, operation.get());
     619            return;
     620
     621        case WebCore::TransformOperation::ROTATE:
     622        case WebCore::TransformOperation::ROTATE_X:
     623        case WebCore::TransformOperation::ROTATE_Y:
     624        case WebCore::TransformOperation::ROTATE_3D:
     625            encodeOperation<WebCore::RotateTransformOperation>(encoder, operation.get());
     626            return;
     627
     628        case WebCore::TransformOperation::SKEW:
     629        case WebCore::TransformOperation::SKEW_X:
     630        case WebCore::TransformOperation::SKEW_Y:
     631            encodeOperation<WebCore::SkewTransformOperation>(encoder, operation.get());
     632            return;
     633
     634        case WebCore::TransformOperation::MATRIX:
     635            encodeOperation<WebCore::MatrixTransformOperation>(encoder, operation.get());
     636            return;
     637
     638        case WebCore::TransformOperation::MATRIX_3D:
     639            encodeOperation<WebCore::Matrix3DTransformOperation>(encoder, operation.get());
     640            return;
     641
     642        case WebCore::TransformOperation::PERSPECTIVE:
     643            encodeOperation<WebCore::PerspectiveTransformOperation>(encoder, operation.get());
     644            return;
     645
     646        case WebCore::TransformOperation::IDENTITY:
     647        case WebCore::TransformOperation::NONE:
     648            return;
     649        }
     650    }
     651
     652    static bool decode(ArgumentDecoder* decoder, RefPtr<WebCore::TransformOperation>& operation)
     653    {
     654        WebCore::TransformOperation::OperationType type;
     655        int typeInt;
     656        if (!decoder->decodeInt32(typeInt))
     657            return false;
     658        type = static_cast<WebCore::TransformOperation::OperationType>(typeInt);
     659        switch (type) {
     660        case WebCore::TransformOperation::SCALE:
     661        case WebCore::TransformOperation::SCALE_X:
     662        case WebCore::TransformOperation::SCALE_Y:
     663        case WebCore::TransformOperation::SCALE_Z:
     664        case WebCore::TransformOperation::SCALE_3D:
     665            return decodeOperation<WebCore::ScaleTransformOperation>(decoder, operation, WebCore::ScaleTransformOperation::create(1.0, 1.0, type));
     666
     667        case WebCore::TransformOperation::TRANSLATE:
     668        case WebCore::TransformOperation::TRANSLATE_X:
     669        case WebCore::TransformOperation::TRANSLATE_Y:
     670        case WebCore::TransformOperation::TRANSLATE_Z:
     671        case WebCore::TransformOperation::TRANSLATE_3D:
     672            return decodeOperation<WebCore::TranslateTransformOperation>(decoder, operation, WebCore::TranslateTransformOperation::create(WebCore::Length(0, WebCore::Fixed), WebCore::Length(0, WebCore::Fixed), type));
     673
     674        case WebCore::TransformOperation::ROTATE:
     675        case WebCore::TransformOperation::ROTATE_X:
     676        case WebCore::TransformOperation::ROTATE_Y:
     677        case WebCore::TransformOperation::ROTATE_3D:
     678            return decodeOperation<WebCore::RotateTransformOperation>(decoder, operation, WebCore::RotateTransformOperation::create(0.0, type));
     679
     680        case WebCore::TransformOperation::SKEW:
     681        case WebCore::TransformOperation::SKEW_X:
     682        case WebCore::TransformOperation::SKEW_Y:
     683            return decodeOperation<WebCore::SkewTransformOperation>(decoder, operation, WebCore::SkewTransformOperation::create(0.0, 0.0, type));
     684
     685        case WebCore::TransformOperation::MATRIX:
     686            return decodeOperation<WebCore::MatrixTransformOperation>(decoder, operation, WebCore::MatrixTransformOperation::create(WebCore::TransformationMatrix()));
     687
     688        case WebCore::TransformOperation::MATRIX_3D:
     689            return decodeOperation<WebCore::Matrix3DTransformOperation>(decoder, operation, WebCore::Matrix3DTransformOperation::create(WebCore::TransformationMatrix()));
     690
     691        case WebCore::TransformOperation::PERSPECTIVE:
     692            return decodeOperation<WebCore::PerspectiveTransformOperation>(decoder, operation, WebCore::PerspectiveTransformOperation::create(WebCore::Length(0, WebCore::Fixed)));
     693
     694        case WebCore::TransformOperation::IDENTITY:
     695        case WebCore::TransformOperation::NONE:
     696            operation = WebCore::IdentityTransformOperation::create();
     697            return true;
     698        }
     699
     700        return false;
     701    }
     702};
     703
     704template<> struct ArgumentCoder<WebCore::TransformOperations> {
     705    static void encode(ArgumentEncoder* encoder, const WebCore::TransformOperations& operations)
     706    {
     707        WTF::Vector<RefPtr<WebCore::TransformOperation> > operationsVector = operations.operations();
     708        int size = operationsVector.size();
     709        encoder->encodeInt32(size);
     710        for (int i = 0; i < size; ++i)
     711            ArgumentCoder<RefPtr<WebCore::TransformOperation> >::encode(encoder, operationsVector[i]);
     712    }
     713
     714    static bool decode(ArgumentDecoder* decoder, WebCore::TransformOperations& operations)
     715    {
     716        int size;
     717        if (!decoder->decodeInt32(size))
     718            return false;
     719
     720        WTF::Vector<RefPtr<WebCore::TransformOperation> >& operationVector = operations.operations();
     721        operationVector.clear();
     722        operationVector.resize(size);
     723        for (int i = 0; i < size; ++i) {
     724            RefPtr<WebCore::TransformOperation> operation;
     725            if (!ArgumentCoder<RefPtr<WebCore::TransformOperation> >::decode(decoder, operation))
     726                return false;
     727            operationVector[i] = operation;
     728        }
     729
     730        return true;
     731    }
     732};
     733
    562734
    563735template<> struct ArgumentCoder<WebCore::Animation> {
Note: See TracChangeset for help on using the changeset viewer.