Changeset 127001 in webkit
- Timestamp:
- Aug 29, 2012 8:33:07 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r126926 r127001 1 2012-08-29 Dominik Röttsches <dominik.rottsches@intel.com> 2 3 The 2d.imageData.object.round canvas test is failing 4 https://bugs.webkit.org/show_bug.cgi?id=40272 5 6 Reviewed by Benjamin Poulain. 7 8 Updating previous patch to address Benjamin's comments. 9 #ifdef in Uint8ClampedArray removed, fallback implementation for MSVC on non-X86 added. 10 11 * wtf/MathExtras.h: 12 (lrint): Fallback implementation for non-X86 & MSVC case. 13 * wtf/Uint8ClampedArray.h: Removed #ifdef. 14 1 15 2012-08-28 Sheriff Bot <webkit.review.bot@gmail.com> 2 16 -
trunk/Source/WTF/wtf/MathExtras.h
r126153 r127001 206 206 inline long int lrint(double flt) 207 207 { 208 int intgr;208 int64_t intgr; 209 209 #if CPU(X86) 210 210 __asm { … … 213 213 }; 214 214 #else 215 #pragma message("Falling back to casting for lrint(), causes rounding inaccuracy in halfway case.") 216 intgr = static_cast<int>(flt); 217 #endif 218 return intgr; 215 ASSERT(isfinite(flt)); 216 double rounded = round(flt); 217 intgr = static_cast<int64_t>(rounded); 218 // If the fractional part is exactly 0.5, we need to check whether 219 // the rounded result is even. If it is not we need to add 1 to 220 // negative values and subtract one from positive values. 221 if (fabs(intgr - flt) == 0.5 & intgr) 222 intgr -= ((intgr >> 62) | 1); // 1 with the sign of result, i.e. -1 or 1. 223 #endif 224 return static_cast<long int>(intgr); 219 225 } 220 226 -
trunk/Source/WTF/wtf/Uint8ClampedArray.h
r126023 r127001 32 32 33 33 #include <wtf/Uint8Array.h> 34 #if COMPILER(MSVC)35 34 #include <wtf/MathExtras.h> 36 #endif37 35 38 36 namespace WTF { -
trunk/Tools/ChangeLog
r126997 r127001 1 2012-08-29 Dominik Röttsches <dominik.rottsches@intel.com> 2 3 The 2d.imageData.object.round canvas test is failing 4 https://bugs.webkit.org/show_bug.cgi?id=40272 5 6 Reviewed by Benjamin Poulain. 7 8 Updating patch to address Benjamin's review comments. 9 Adding a WTF test to test lrint implementation. 10 11 * TestWebKitAPI/CMakeLists.txt: Added MathExtras.cpp test file. 12 * TestWebKitAPI/GNUmakefile.am: Added MathExtras.cpp test file. 13 * TestWebKitAPI/TestWebKitAPI.gypi: Added MathExtras.cpp test file. 14 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added MathExtras.cpp test file. 15 * TestWebKitAPI/Tests/WTF/MathExtras.cpp: Added this test file containing a test for lrint(). 16 (TestWebKitAPI): 17 (TestWebKitAPI::TEST): 18 * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added MathExtras.cpp test file. 19 1 20 2012-08-29 Florin Malita <fmalita@chromium.org> 2 21 -
trunk/Tools/TestWebKitAPI/CMakeLists.txt
r126658 r127001 73 73 ${TESTWEBKITAPI_DIR}/Tests/WTF/HashMap.cpp 74 74 ${TESTWEBKITAPI_DIR}/Tests/WTF/IntegerToStringConversion.cpp 75 ${TESTWEBKITAPI_DIR}/Tests/WTF/MathExtras.cpp 75 76 ${TESTWEBKITAPI_DIR}/Tests/WTF/MetaAllocator.cpp 76 77 ${TESTWEBKITAPI_DIR}/Tests/WTF/RedBlackTree.cpp -
trunk/Tools/TestWebKitAPI/GNUmakefile.am
r126658 r127001 57 57 Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp \ 58 58 Tools/TestWebKitAPI/Tests/WTF/IntegerToStringConversion.cpp \ 59 Tools/TestWebKitAPI/Tests/WTF/MathExtras.cpp \ 59 60 Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp \ 60 61 Tools/TestWebKitAPI/Tests/WTF/RedBlackTree.cpp \ -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.gypi
r126530 r127001 37 37 'Tests/WTF/Functional.cpp', 38 38 'Tests/WTF/HashMap.cpp', 39 'Tests/WTF/MathExtras.cpp', 39 40 'Tests/WTF/MediaTime.cpp', 40 41 'Tests/WTF/RedBlackTree.cpp', -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r126658 r127001 91 91 A5E2027515B21F6E00C13E14 /* WindowlessWebViewWithMedia.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = A5E2027015B2180600C13E14 /* WindowlessWebViewWithMedia.html */; }; 92 92 A7A966DB140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */; }; 93 B4039F9D15E6D8B3007255D6 /* MathExtras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B4039F9C15E6D8B3007255D6 /* MathExtras.cpp */; }; 93 94 B55F11A01516834F00915916 /* AttributedString.mm in Sources */ = {isa = PBXBuildFile; fileRef = B55F119F1516834F00915916 /* AttributedString.mm */; }; 94 95 B55F11B71517D03300915916 /* attributedStringCustomFont.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = B55F11B01517A2C400915916 /* attributedStringCustomFont.html */; }; … … 326 327 A5E2027215B2181900C13E14 /* WindowlessWebViewWithMedia.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowlessWebViewWithMedia.mm; sourceTree = "<group>"; }; 327 328 A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckedArithmeticOperations.cpp; path = WTF/CheckedArithmeticOperations.cpp; sourceTree = "<group>"; }; 329 B4039F9C15E6D8B3007255D6 /* MathExtras.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MathExtras.cpp; path = WTF/MathExtras.cpp; sourceTree = "<group>"; }; 328 330 B55F119F1516834F00915916 /* AttributedString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AttributedString.mm; sourceTree = "<group>"; }; 329 331 B55F11B01517A2C400915916 /* attributedStringCustomFont.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = attributedStringCustomFont.html; sourceTree = "<group>"; }; … … 643 645 0BCD833414857CE400EA2003 /* HashMap.cpp */, 644 646 26B2DFF815BDE599004F691D /* HashSet.cpp */, 647 B4039F9C15E6D8B3007255D6 /* MathExtras.cpp */, 645 648 14F3B11215E45EAB00210069 /* SaturatedArithmeticOperations.cpp */, 646 649 266FAFD215E5775200F61D5B /* IntegerToStringConversion.cpp */, … … 926 929 33DC8911141953A300747EF7 /* LoadCanceledNoServerRedirectCallback.cpp in Sources */, 927 930 BC131A9B1171316900B69727 /* main.mm in Sources */, 931 B4039F9D15E6D8B3007255D6 /* MathExtras.cpp in Sources */, 928 932 CD5497B415857F0C00B5BC30 /* MediaTime.cpp in Sources */, 929 933 E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */, -
trunk/Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj
r126509 r127001 653 653 </File> 654 654 <File 655 RelativePath="..\Tests\WTF\MathExtras.cpp" 656 > 657 </File> 658 <File 655 659 RelativePath="..\Tests\WTF\MediaTime.cpp" 656 660 >
Note: See TracChangeset
for help on using the changeset viewer.