Changeset 100789 in webkit
- Timestamp:
- Nov 18, 2011 10:36:17 AM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r100779 r100789 1 2011-11-18 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 WebKit2: Enable serializing of data types needed for cross-process accelerated compositing 4 https://bugs.webkit.org/show_bug.cgi?id=61694 5 6 Add an ArgumentCoder for KeyframeValueList, and modify the TimingFunction ArgumentCoder to 7 allow encoding const TimingFunctions and not just RefPtr<TimingFunction>. 8 9 Reviewed by Simon Hausmann. 10 11 * Scripts/webkit2/messages.py: 12 * Shared/WebCoreArgumentCoders.cpp: 13 (CoreIPC::::encode): 14 (CoreIPC::::decode): 15 * Shared/WebCoreArgumentCoders.h: 16 1 17 2011-11-18 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 18 -
trunk/Source/WebKit2/Scripts/webkit2/messages.py
r99108 r100789 377 377 'WebCore::CompositionUnderline': ['<WebCore/Editor.h>'], 378 378 'WebCore::GrammarDetail': ['<WebCore/TextCheckerClient.h>'], 379 'WebCore::KeyframeValueList': ['<WebCore/GraphicsLayer.h>'], 379 380 'WebCore::KeypressCommand': ['<WebCore/KeyboardEvent.h>'], 380 381 'WebCore::FileChooserSettings': ['<WebCore/FileChooser.h>'], -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
r100680 r100789 36 36 #include <WebCore/FileChooser.h> 37 37 #include <WebCore/GraphicsContext.h> 38 #include <WebCore/GraphicsLayer.h> 38 39 #include <WebCore/Image.h> 39 40 #include <WebCore/PluginData.h> … … 824 825 void ArgumentCoder<RefPtr<TimingFunction> >::encode(ArgumentEncoder* encoder, const RefPtr<TimingFunction>& function) 825 826 { 826 // We don't want to encode null-references. 827 ASSERT(function); 827 encode(encoder, function.get()); 828 } 829 830 void ArgumentCoder<RefPtr<TimingFunction> >::encode(ArgumentEncoder* encoder, const WebCore::TimingFunction* function) 831 { 832 if (!function) { 833 encoder->encodeInt32(WebCore::TimingFunction::LinearFunction); 834 return; 835 } 828 836 829 837 encoder->encodeEnum(function->type()); … … 832 840 break; 833 841 case TimingFunction::CubicBezierFunction: { 834 CubicBezierTimingFunction* cubicFunction = static_cast<CubicBezierTimingFunction*>(function.get());842 const WebCore::CubicBezierTimingFunction* cubicFunction = static_cast<const WebCore::CubicBezierTimingFunction*>(function); 835 843 encoder->encodeDouble(cubicFunction->x1()); 836 844 encoder->encodeDouble(cubicFunction->y1()); … … 840 848 } 841 849 case TimingFunction::StepsFunction: { 842 StepsTimingFunction* stepsFunction = static_cast<StepsTimingFunction*>(function.get());850 const WebCore::StepsTimingFunction* stepsFunction = static_cast<const WebCore::StepsTimingFunction*>(function); 843 851 encoder->encodeInt32(stepsFunction->numberOfSteps()); 844 852 encoder->encodeBool(stepsFunction->stepAtStart()); … … 1147 1155 return true; 1148 1156 } 1157 1158 #if USE(ACCELERATED_COMPOSITING) 1159 1160 void ArgumentCoder<KeyframeValueList>::encode(ArgumentEncoder* encoder, const WebCore::KeyframeValueList& keyframes) 1161 { 1162 encoder->encodeUInt32(keyframes.size()); 1163 encoder->encodeInt32(keyframes.property()); 1164 for (size_t i = 0; i < keyframes.size(); ++i) { 1165 const WebCore::AnimationValue* value = keyframes.at(i); 1166 encoder->encodeFloat(value->keyTime()); 1167 ArgumentCoder<RefPtr<WebCore::TimingFunction> >::encode(encoder, value->timingFunction()); 1168 switch (keyframes.property()) { 1169 case WebCore::AnimatedPropertyOpacity: { 1170 const WebCore::FloatAnimationValue* floatValue = static_cast<const WebCore::FloatAnimationValue*>(value); 1171 encoder->encodeFloat(floatValue->value()); 1172 break; 1173 } 1174 case WebCore::AnimatedPropertyWebkitTransform: { 1175 const WebCore::TransformAnimationValue* transformValue = static_cast<const WebCore::TransformAnimationValue*>(value); 1176 ArgumentCoder<WebCore::TransformOperations>::encode(encoder, *transformValue->value()); 1177 break; 1178 } 1179 default: 1180 break; 1181 } 1182 } 1183 } 1184 1185 bool ArgumentCoder<KeyframeValueList>::decode(ArgumentDecoder* decoder, WebCore::KeyframeValueList& keyframes) 1186 { 1187 uint32_t size; 1188 int32_t property; 1189 if (!decoder->decodeUInt32(size)) 1190 return false; 1191 if (!decoder->decodeInt32(property)) 1192 return false; 1193 1194 keyframes = WebCore::KeyframeValueList(WebCore::AnimatedPropertyID(property)); 1195 1196 for (size_t i = 0; i < size; ++i) { 1197 float keyTime; 1198 RefPtr<WebCore::TimingFunction> timingFunction; 1199 if (!decoder->decodeFloat(keyTime)) 1200 return false; 1201 if (!ArgumentCoder<RefPtr<WebCore::TimingFunction> >::decode(decoder, timingFunction)) 1202 return false; 1203 1204 switch (property) { 1205 case WebCore::AnimatedPropertyOpacity: { 1206 float value; 1207 if (!decoder->decodeFloat(value)) 1208 return false; 1209 keyframes.insert(new WebCore::FloatAnimationValue(keyTime, value, timingFunction)); 1210 break; 1211 } 1212 case WebCore::AnimatedPropertyWebkitTransform: { 1213 WebCore::TransformOperations value; 1214 if (!ArgumentCoder<WebCore::TransformOperations>::decode(decoder, value)) 1215 return false; 1216 keyframes.insert(new WebCore::TransformAnimationValue(keyTime, &value, timingFunction)); 1217 break; 1218 } 1219 default: 1220 break; 1221 } 1222 } 1223 1224 return true; 1225 } 1226 1149 1227 #endif 1150 1228 1229 #endif 1230 1151 1231 } // namespace CoreIPC -
trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h
r100680 r100789 43 43 class IntRect; 44 44 class IntSize; 45 class KeyframeValueList; 45 46 class ProtectionSpace; 46 47 class ResourceError; … … 274 275 template<> struct ArgumentCoder<RefPtr<WebCore::TimingFunction> > { 275 276 static void encode(ArgumentEncoder*, const RefPtr<WebCore::TimingFunction>&); 277 static void encode(ArgumentEncoder*, const WebCore::TimingFunction*); 276 278 static bool decode(ArgumentDecoder*, RefPtr<WebCore::TimingFunction>&); 277 279 }; … … 293 295 #endif 294 296 297 #if USE(ACCELERATED_COMPOSITING) 298 template<> struct ArgumentCoder<WebCore::KeyframeValueList> { 299 static void encode(ArgumentEncoder*, const WebCore::KeyframeValueList& keyframes); 300 static bool decode(ArgumentDecoder*, WebCore::KeyframeValueList& keyframes); 301 }; 302 #endif 303 295 304 } // namespace CoreIPC 296 305
Note: See TracChangeset
for help on using the changeset viewer.