Changeset 88222 in webkit
- Timestamp:
- Jun 6, 2011 11:20:15 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r88204 r88222 1 2011-06-06 Noam 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 1 14 2011-06-06 John Sullivan <sullivan@apple.com> 2 15 -
trunk/Source/WebKit2/Scripts/webkit2/messages.py
r87707 r88222 256 256 'WebCore::CompositionUnderline', 257 257 'WebCore::GrammarDetail', 258 'WebCore::IdentityTransformOperation', 258 259 'WebCore::KeypressCommand', 259 260 'WebCore::Length', 261 'WebCore::MatrixTransformOperation', 262 'WebCore::Matrix3DTransformOperation', 263 'WebCore::PerspectiveTransformOperation', 260 264 'WebCore::PluginInfo', 261 265 'WebCore::PrintInfo', 266 'WebCore::RotateTransformOperation', 267 'WebCore::ScaleTransformOperation', 268 'WebCore::SkewTransformOperation', 262 269 'WebCore::TimingFunction', 263 270 'WebCore::TransformationMatrix', 271 'WebCore::TransformOperation', 272 'WebCore::TransformOperations', 273 'WebCore::TranslateTransformOperation', 264 274 'WebCore::ViewportArguments', 265 275 'WebCore::WindowFeatures', -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
r87707 r88222 42 42 #include <WebCore/FloatRect.h> 43 43 #include <WebCore/GraphicsContext.h> 44 #include <WebCore/IdentityTransformOperation.h> 44 45 #include <WebCore/IntRect.h> 45 46 #include <WebCore/KeyboardEvent.h> 46 47 #include <WebCore/Length.h> 48 #include <WebCore/Matrix3DTransformOperation.h> 49 #include <WebCore/MatrixTransformOperation.h> 50 #include <WebCore/PerspectiveTransformOperation.h> 47 51 #include <WebCore/PluginData.h> 48 52 #include <WebCore/ProtectionSpace.h> 49 53 #include <WebCore/ResourceError.h> 50 54 #include <WebCore/ResourceRequest.h> 55 #include <WebCore/RotateTransformOperation.h> 56 #include <WebCore/ScaleTransformOperation.h> 57 #include <WebCore/SkewTransformOperation.h> 51 58 #include <WebCore/TextCheckerClient.h> 52 59 #include <WebCore/TimingFunction.h> 60 #include <WebCore/TransformOperation.h> 61 #include <WebCore/TransformOperations.h> 53 62 #include <WebCore/TransformationMatrix.h> 63 #include <WebCore/TranslateTransformOperation.h> 54 64 #include <WebCore/ViewportArguments.h> 55 65 #include <WebCore/WindowFeatures.h> 56 66 #include <limits> 67 68 57 69 58 70 … … 69 81 template<> struct ArgumentCoder<WebCore::Length> : SimpleArgumentCoder<WebCore::Length> { }; 70 82 template<> struct ArgumentCoder<WebCore::TransformationMatrix> : SimpleArgumentCoder<WebCore::TransformationMatrix> { }; 83 84 template<> struct ArgumentCoder<WebCore::MatrixTransformOperation> : SimpleArgumentCoder<WebCore::MatrixTransformOperation> { }; 85 template<> struct ArgumentCoder<WebCore::Matrix3DTransformOperation> : SimpleArgumentCoder<WebCore::Matrix3DTransformOperation> { }; 86 template<> struct ArgumentCoder<WebCore::PerspectiveTransformOperation> : SimpleArgumentCoder<WebCore::PerspectiveTransformOperation> { }; 87 template<> struct ArgumentCoder<WebCore::RotateTransformOperation> : SimpleArgumentCoder<WebCore::RotateTransformOperation> { }; 88 template<> struct ArgumentCoder<WebCore::ScaleTransformOperation> : SimpleArgumentCoder<WebCore::ScaleTransformOperation> { }; 89 template<> struct ArgumentCoder<WebCore::SkewTransformOperation> : SimpleArgumentCoder<WebCore::SkewTransformOperation> { }; 90 template<> struct ArgumentCoder<WebCore::TranslateTransformOperation> : SimpleArgumentCoder<WebCore::TranslateTransformOperation> { }; 71 91 72 92 template<> struct ArgumentCoder<WebCore::MimeClassInfo> { … … 560 580 } 561 581 }; 582 583 template<> struct ArgumentCoder<RefPtr<WebCore::TransformOperation> > { 584 template<class T> 585 static bool decodeOperation(ArgumentDecoder* decoder, RefPtr<WebCore::TransformOperation>& operation, PassRefPtr<T> newOperation) 586 { 587 if (!ArgumentCoder<T>::decode(decoder, *newOperation.get())) 588 return false; 589 operation = newOperation.get(); 590 return true; 591 } 592 593 template<class T> 594 static void encodeOperation(ArgumentEncoder* encoder, const WebCore::TransformOperation* operation) 595 { 596 ArgumentCoder<T>::encode(encoder, *static_cast<const T*>(operation)); 597 } 598 599 static void encode(ArgumentEncoder* encoder, const RefPtr<WebCore::TransformOperation>& operation) 600 { 601 // We don't want to encode null-references. 602 ASSERT(operation); 603 604 WebCore::TransformOperation::OperationType type = operation->getOperationType(); 605 encoder->encodeInt32(type); 606 switch (type) { 607 case WebCore::TransformOperation::SCALE: 608 case WebCore::TransformOperation::SCALE_X: 609 case WebCore::TransformOperation::SCALE_Y: 610 case WebCore::TransformOperation::SCALE_Z: 611 case WebCore::TransformOperation::SCALE_3D: 612 encodeOperation<WebCore::ScaleTransformOperation>(encoder, operation.get()); 613 return; 614 615 case WebCore::TransformOperation::TRANSLATE: 616 case WebCore::TransformOperation::TRANSLATE_X: 617 case WebCore::TransformOperation::TRANSLATE_Y: 618 case WebCore::TransformOperation::TRANSLATE_Z: 619 case WebCore::TransformOperation::TRANSLATE_3D: 620 encodeOperation<WebCore::TranslateTransformOperation>(encoder, operation.get()); 621 return; 622 623 case WebCore::TransformOperation::ROTATE: 624 case WebCore::TransformOperation::ROTATE_X: 625 case WebCore::TransformOperation::ROTATE_Y: 626 case WebCore::TransformOperation::ROTATE_3D: 627 encodeOperation<WebCore::RotateTransformOperation>(encoder, operation.get()); 628 return; 629 630 case WebCore::TransformOperation::SKEW: 631 case WebCore::TransformOperation::SKEW_X: 632 case WebCore::TransformOperation::SKEW_Y: 633 encodeOperation<WebCore::SkewTransformOperation>(encoder, operation.get()); 634 return; 635 636 case WebCore::TransformOperation::MATRIX: 637 encodeOperation<WebCore::MatrixTransformOperation>(encoder, operation.get()); 638 return; 639 640 case WebCore::TransformOperation::MATRIX_3D: 641 encodeOperation<WebCore::Matrix3DTransformOperation>(encoder, operation.get()); 642 return; 643 644 case WebCore::TransformOperation::PERSPECTIVE: 645 encodeOperation<WebCore::PerspectiveTransformOperation>(encoder, operation.get()); 646 return; 647 648 case WebCore::TransformOperation::IDENTITY: 649 case WebCore::TransformOperation::NONE: 650 return; 651 } 652 } 653 654 static bool decode(ArgumentDecoder* decoder, RefPtr<WebCore::TransformOperation>& operation) 655 { 656 WebCore::TransformOperation::OperationType type; 657 int typeInt; 658 if (!decoder->decodeInt32(typeInt)) 659 return false; 660 type = static_cast<WebCore::TransformOperation::OperationType>(typeInt); 661 switch (type) { 662 case WebCore::TransformOperation::SCALE: 663 case WebCore::TransformOperation::SCALE_X: 664 case WebCore::TransformOperation::SCALE_Y: 665 case WebCore::TransformOperation::SCALE_Z: 666 case WebCore::TransformOperation::SCALE_3D: 667 return decodeOperation<WebCore::ScaleTransformOperation>(decoder, operation, WebCore::ScaleTransformOperation::create(1.0, 1.0, type)); 668 669 case WebCore::TransformOperation::TRANSLATE: 670 case WebCore::TransformOperation::TRANSLATE_X: 671 case WebCore::TransformOperation::TRANSLATE_Y: 672 case WebCore::TransformOperation::TRANSLATE_Z: 673 case WebCore::TransformOperation::TRANSLATE_3D: 674 return decodeOperation<WebCore::TranslateTransformOperation>(decoder, operation, WebCore::TranslateTransformOperation::create(WebCore::Length(0, WebCore::Fixed), WebCore::Length(0, WebCore::Fixed), type)); 675 676 case WebCore::TransformOperation::ROTATE: 677 case WebCore::TransformOperation::ROTATE_X: 678 case WebCore::TransformOperation::ROTATE_Y: 679 case WebCore::TransformOperation::ROTATE_3D: 680 return decodeOperation<WebCore::RotateTransformOperation>(decoder, operation, WebCore::RotateTransformOperation::create(0.0, type)); 681 682 case WebCore::TransformOperation::SKEW: 683 case WebCore::TransformOperation::SKEW_X: 684 case WebCore::TransformOperation::SKEW_Y: 685 return decodeOperation<WebCore::SkewTransformOperation>(decoder, operation, WebCore::SkewTransformOperation::create(0.0, 0.0, type)); 686 687 case WebCore::TransformOperation::MATRIX: 688 return decodeOperation<WebCore::MatrixTransformOperation>(decoder, operation, WebCore::MatrixTransformOperation::create(WebCore::TransformationMatrix())); 689 690 case WebCore::TransformOperation::MATRIX_3D: 691 return decodeOperation<WebCore::Matrix3DTransformOperation>(decoder, operation, WebCore::Matrix3DTransformOperation::create(WebCore::TransformationMatrix())); 692 693 case WebCore::TransformOperation::PERSPECTIVE: 694 return decodeOperation<WebCore::PerspectiveTransformOperation>(decoder, operation, WebCore::PerspectiveTransformOperation::create(WebCore::Length(0, WebCore::Fixed))); 695 696 case WebCore::TransformOperation::IDENTITY: 697 case WebCore::TransformOperation::NONE: 698 operation = WebCore::IdentityTransformOperation::create(); 699 return true; 700 } 701 702 return false; 703 } 704 }; 705 706 template<> struct ArgumentCoder<WebCore::TransformOperations> { 707 static void encode(ArgumentEncoder* encoder, const WebCore::TransformOperations& operations) 708 { 709 WTF::Vector<RefPtr<WebCore::TransformOperation> > operationsVector = operations.operations(); 710 int size = operationsVector.size(); 711 encoder->encodeInt32(size); 712 for (int i = 0; i < size; ++i) 713 ArgumentCoder<RefPtr<WebCore::TransformOperation> >::encode(encoder, operationsVector[i]); 714 } 715 716 static bool decode(ArgumentDecoder* decoder, WebCore::TransformOperations& operations) 717 { 718 int size; 719 if (!decoder->decodeInt32(size)) 720 return false; 721 722 WTF::Vector<RefPtr<WebCore::TransformOperation> >& operationVector = operations.operations(); 723 operationVector.clear(); 724 operationVector.resize(size); 725 for (int i = 0; i < size; ++i) { 726 RefPtr<WebCore::TransformOperation> operation; 727 if (!ArgumentCoder<RefPtr<WebCore::TransformOperation> >::decode(decoder, operation)) 728 return false; 729 operationVector[i] = operation; 730 } 731 732 return true; 733 } 734 }; 735 562 736 563 737 template<> struct ArgumentCoder<WebCore::Animation> {
Note: See TracChangeset
for help on using the changeset viewer.