aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PointTest.cpp
Commit message (Collapse)AuthorAge
* remove SkTCastGravatar Mike Klein2018-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SkTCast is functionally equivalent to reinterpret_cast. The comment about SkTCast helping to avoid strict alising issues is not true. Dereferencing a pointer cast to a pointer of an unrelated type is always undefined, even if smuggled through a union like in SkTCast. To really avoid aliasing issues, you need to make a union[1] of the two value types, or better, memcpy between values. I've had to fix MatrixText.cpp where switching to reinterpret_cast actually let Clang notice and warn that we're exploiting undefined behavior, and GrSwizzle.h and SkCamera.cpp caught by GCC. I've switched SkTLList over to use SkAlignedSTStorage, which seems to help convince some GCC versions that fObj is used in a sound way. [1] The union punning trick is non-standard in C++, but GCC and MSVC both explicitly support it. I believe Clang does not officially explicitly support it, but probably does quietly for GCC compatibility. Change-Id: I71822e82c962f9aaac8be24d3c0f39f4f8b05026 Reviewed-on: https://skia-review.googlesource.com/134947 Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
* move parts of SkPoint to SkPointPrivGravatar Cary Clark2017-11-08
| | | | | | | | | | | | Move specialized SkPoint methods to SkPointPriv. Use constexpr and inline initialization where possible. R=reed@google.com,bsalomon@google.com Bug: skia: 6898 Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338 Reviewed-on: https://skia-review.googlesource.com/68700 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* change SkPoint::setLength to set itself to (0,0) if it starting length is ↵Gravatar reed2014-12-09
| | | | | | | | | degenerate. BUG=skia:3203 TBR=caryclark Review URL: https://codereview.chromium.org/785933003
* Move macros from TestClassDef.h to Test.hGravatar commit-bot@chromium.org2014-01-14
| | | | | | | | | | | | | | Motivation: those macros don't make any sense without the definitions in Test.h. BUG= R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/138563004 git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFloatToScalar macroGravatar commit-bot@chromium.org2013-11-25
| | | | | | | | | | | BUG= R=reed@google.com, djsollen@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/85463005 git-svn-id: http://skia.googlecode.com/svn/trunk@12385 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add sk_float_rsqrt with SSE + NEON fast paths.Gravatar commit-bot@chromium.org2013-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | Current numbers: N4: running bench [640 480] math_fastIsqrt NONRENDERING: cmsecs = 3.12 running bench [640 480] math_slowIsqrt NONRENDERING: cmsecs = 4.82 running bench [640 480] math_sk_float_rsqrt NONRENDERING: cmsecs = 1.99 Desktop: running bench [640 480] math_fastIsqrt NONRENDERING: cmsecs = 0.89 running bench [640 480] math_slowIsqrt NONRENDERING: cmsecs = 0.94 running bench [640 480] math_sk_float_rsqrt NONRENDERING: cmsecs = 0.09 Haven't found any other benches where this is a significant effect yet. BUG= R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/60083014 git-svn-id: http://skia.googlecode.com/svn/trunk@12203 2bbb7eff-a529-9590-31e7-b0007b416f81
* by hook or by crook, force gcc to return the value of SkPoint::length() to ↵Gravatar reed@google.com2013-05-06
| | | | | | | | | | | | actually be a float instead of a double. Otherwise we can't properly test for overflow with large values. R=robertphillips@google.com Review URL: https://codereview.chromium.org/14884011 git-svn-id: http://skia.googlecode.com/svn/trunk@9015 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-05-04
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@9002 2bbb7eff-a529-9590-31e7-b0007b416f81
* add (temporary) diagnostic code for normalize testGravatar reed@google.com2013-05-03
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8994 2bbb7eff-a529-9590-31e7-b0007b416f81
* trick the compiler into not knowning that I will generate an overflowGravatar reed@google.com2013-05-03
| | | | | | | | | (which is the point of the test). This avoids a warning, which breaks our bots. git-svn-id: http://skia.googlecode.com/svn/trunk@8991 2bbb7eff-a529-9590-31e7-b0007b416f81
* change setLength and Normalize to handle when mag2 overflows a float, but theGravatar reed@google.com2013-05-03
| | | | | | | | | | actual lenght does not. R=caryclark@google.com Review URL: https://codereview.chromium.org/14838006 git-svn-id: http://skia.googlecode.com/svn/trunk@8988 2bbb7eff-a529-9590-31e7-b0007b416f81
* add asScalars() to document when we want to treat SkPoint or SkRect as an arrayGravatar reed@google.com2013-03-08
| | | | | | | of SkScalars. Review URL: https://codereview.chromium.org/12530010 git-svn-id: http://skia.googlecode.com/svn/trunk@8041 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change comment in PointTest to refer to GCC bugGravatar borenet@google.com2012-08-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5285 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix PointTest.Gravatar bungeman@google.com2012-08-24
| | | | | | | https://codereview.appspot.com/6486062/ git-svn-id: http://skia.googlecode.com/svn/trunk@5283 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warnings on Mac in testsGravatar caryclark@google.com2012-06-06
| | | | | | | | | | | | | | | | | | Fix these class of warnings: - unused functions - unused locals - sign mismatch - missing function prototypes - missing newline at end of file - 64 to 32 bit truncation The changes prefer to link in dead code in the debug build with 'if (false)' than to comment it out, but trivial cases are commented out or sometimes deleted if it appears to be a copy/paste error. Review URL: https://codereview.appspot.com/6301045 git-svn-id: http://skia.googlecode.com/svn/trunk@4175 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix miscellaneous compiler warnings from Visual Studio 2010.Gravatar tomhudson@google.com2012-04-10
| | | | | | | | | Changes serialization path for MorphologyImageFilter, handling of Windows HRESULTS; otherwise just tweaks tests. git-svn-id: http://skia.googlecode.com/svn/trunk@3642 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move PointTest.cpp out of tests/core into tests/ ; the other arrangement wasGravatar epoger@google.com2011-06-15
"clever" but was causing build problems. git-svn-id: http://skia.googlecode.com/svn/trunk@1604 2bbb7eff-a529-9590-31e7-b0007b416f81