aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Matrix44Test.cpp
Commit message (Collapse)AuthorAge
* Remove SkAutoTDelete.Gravatar Ben Wagner2016-11-03
| | | | | | | | | Replace with std::unique_ptr. Change-Id: I5806cfbb30515fcb20e5e66ce13fb5f3b8728176 Reviewed-on: https://skia-review.googlesource.com/4381 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* SkMatrix44 clarifications and clean-upsGravatar msarett2016-06-23
| | | | | | | | | | | | | | Fixed row/col major bug and added comments to the header. Made SkMatrix::I() thread safe using constexpr. Added a test set3x3RowMajorf(). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2098583002 Review-Url: https://codereview.chromium.org/2098583002
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Fix infinite matrix during an invert.Gravatar vmpstr2015-06-30
| | | | | | | | | | This patch ensures that when inverting a SkMatrix44, we handle small floats properly. When inverted these can cause infinite values, but still evaluate to true in an if condition. BUG=chromium:498516 Review URL: https://codereview.chromium.org/1209763002
* Use SkMScalar as float by default to match Chromium.Gravatar mtklein2015-06-09
| | | | | | | | | | Tweak some test values to pass with floats. As expected, this regresses matrix44_setconcat_general by about 2x. BUG=skia: Review URL: https://codereview.chromium.org/1169813006
* A bunch of little SkMScalar-as-float build fixes.Gravatar mtklein2015-06-09
| | | | | | | | | | | | | Landing this before http://crrev.com/1169813006 so the test changes needed there are clearer. This just lets things build with floats, and is a no-op for doubles. No public API changes we didn't intend to already have... TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1173673003
* SkMatrix44(const SkMatrix&) needs to initialize the type maskGravatar fs2014-12-16
| | | | Review URL: https://codereview.chromium.org/791723006
* add round/ceil/etc. for SkMScalarGravatar reed2014-10-21
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/645793006
* SkMatrix44::preserves2dAxisAlignment()Gravatar tomhudson2014-09-26
| | | | | | | | | | | | Convenience function requested for Chrome compositor that may have a performance advantage. BUG=skia:1017 R=reed@google.com, danakj@chromium.org, vollick@chromium.org Author: tomhudson@google.com Review URL: https://codereview.chromium.org/508303005
* Add helper SkMatrix44::hasPerspective()Gravatar tomhudson2014-09-16
| | | | | | | | | BUG=skia:1017 R=danakj@chromium.org, reed@google.com Author: tomhudson@google.com Review URL: https://codereview.chromium.org/513343002
* Cleanup: Sanitize the order of includes under tests/Gravatar tfarina@chromium.org2014-01-24
| | | | | | | | | | | | | | | | Initially this was to make sure Test.h appeared after the Sk*.h includes. Patch generated by the following command line: $ ~/chromium/src/tools/sort-headers.py tests/*.cpp BUG=None TEST=tests R=robertphillips@google.com Review URL: https://codereview.chromium.org/145313004 git-svn-id: http://skia.googlecode.com/svn/trunk@13177 2bbb7eff-a529-9590-31e7-b0007b416f81
* 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 SK_SCALAR_IS_[FLOAT,FIXED] and assume floatsGravatar reed@google.com2013-12-17
| | | | | | | | | | | | | To keep the CL (slightly) managable, this does not make any changes to existing macros (e.g. SkScalarMul). Just tackling #ifdef constructs this time around. BUG= R=bsalomon@google.com, caryclark@google.com Review URL: https://codereview.chromium.org/117053002 git-svn-id: http://skia.googlecode.com/svn/trunk@12712 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use DEFINE_TESTCLASS_SHORT macro in tests.Gravatar tfarina@chromium.org2013-12-12
| | | | | | | | | | | | | The three version of DEFINE_TESTCLASS macro is deprecated and thus just use the simple, short one. BUG=None TEST=out/Debug/tests R=mtklein@google.com, bsalomon@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/100113004 git-svn-id: http://skia.googlecode.com/svn/trunk@12653 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | | since it triggers a warning"" This reverts commit 1e787c38fa71f2a21fd728f1b1d620b9b09b0d3d. BUG= Review URL: https://codereview.chromium.org/54603004 git-svn-id: http://skia.googlecode.com/svn/trunk@12057 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it ↵Gravatar reed@google.com2013-10-31
| | | | | | | | triggers a warning" This reverts commit 1d22c4aaf9d8f053f25194a1ed74b137bfb19497. git-svn-id: http://skia.googlecode.com/svn/trunk@12056 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | a warning BUG= R=robertphillips@google.com, senorblanco@chromium.org, vandebo@chromium.org Review URL: https://codereview.chromium.org/51033004 git-svn-id: http://skia.googlecode.com/svn/trunk@12055 2bbb7eff-a529-9590-31e7-b0007b416f81
* Clean up SkTypes.h.Gravatar bungeman@google.com2013-10-11
| | | | | | | | | | | | | | | | | | | This change removes sk_stdint.h since it is only needed for vs2008 and earlier. This change removes SK_MMAP_SUPPORT define since it is no longer used. This change removes the stdio.h include from SkTypes.h since on many systems this is a very large header, few Skia files actually use it, it is available everywhere standard, and SkDebugf should be used instead. After this change there is no need for external users to put Skia's include/config into their own list of includes, saving the headache of having two header files of the same name and sometimes getting the wrong one depending on include order. R=bsalomon@google.com, djsollen@google.com Review URL: https://codereview.chromium.org/27044002 git-svn-id: http://skia.googlecode.com/svn/trunk@11738 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add perspective support to SkMatrix44 initializers.Gravatar commit-bot@chromium.org2013-10-05
| | | | | | | | | | | | | | | | | | | | I noticed SkMatrix <-> SkMatrix44 conversions were dropping the perspective values on the floor. As we use SkMatrix44 heavily in Chromium, I'm concerned this missing code will cause a bug eventually. It should be correct to simply use the bottom row of the 4x4 matrix excluding the third column. Previously committed and reverted, second attempt with fix for incorrect use of SkMScalar/SkScalar. BUG= R=reed@google.com, caryclark@google.com Author: aelias@chromium.org Review URL: https://codereview.chromium.org/25484006 git-svn-id: http://skia.googlecode.com/svn/trunk@11624 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Add perspective support to SkMatrix44 initializers."Gravatar aelias@chromium.org2013-10-04
| | | | | | This reverts commit 93db1bcae0863feed8d00a61ae2cf72a90a0083c. git-svn-id: http://skia.googlecode.com/svn/trunk@11623 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add perspective support to SkMatrix44 initializers.Gravatar commit-bot@chromium.org2013-10-04
| | | | | | | | | | | | | | | | | I noticed SkMatrix <-> SkMatrix44 conversions were dropping the perspective values on the floor. As we use SkMatrix44 heavily in Chromium, I'm concerned this missing code will cause a bug eventually. It should be correct to simply use the bottom row of the 4x4 matrix excluding the third column. BUG= R=reed@google.com Author: aelias@chromium.org Review URL: https://codereview.chromium.org/25484006 git-svn-id: http://skia.googlecode.com/svn/trunk@11622 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix Matrix44Test and double-to-float conversion in SVD codeGravatar jvanverth@google.com2013-09-03
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11067 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revise SVD code to remove arctangents. Gravatar commit-bot@chromium.org2013-09-03
| | | | | | | | | | | | Also added bench for timing matrix decomposition. R=reed@google.com Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/23596006 git-svn-id: http://skia.googlecode.com/svn/trunk@11066 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-08-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10842 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add perf benchmarks and more unit tests for matrix inversionGravatar commit-bot@chromium.org2013-08-20
| | | | | | | | | | R=jvanverth@google.com, reed@google.com Author: shawnsingh@chromium.org Review URL: https://chromiumcodereview.appspot.com/22886010 git-svn-id: http://skia.googlecode.com/svn/trunk@10836 2bbb7eff-a529-9590-31e7-b0007b416f81
* Tweak Matrix44 test so it'll pass on ChromeOSGravatar commit-bot@chromium.org2013-08-20
| | | | | | | | | | | BUG= R=robertphillips@google.com Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/23093008 git-svn-id: http://skia.googlecode.com/svn/trunk@10822 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkMatrix44::invert() check for finite 1/det instead of magic valueGravatar commit-bot@chromium.org2013-08-20
| | | | | | | | | | | | | | | | | | | | | Previously we were checking to see if the magnitude of determinant of the matrix to be inverted was less than 1.0e-8, which is a magic number possibly plucked from Graphics Gems. After some discussion, it's been determined (ha) that we can simply check to see if 1/det is finite and if so proceed. BUG=222926 Committed: http://code.google.com/p/skia/source/detail?r=10758 R=reed@google.com, shawnsingh@chromium.org Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/22904003 git-svn-id: http://skia.googlecode.com/svn/trunk@10818 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Make SkMatrix44::invert() check for finite 1/det instead of magic value"Gravatar scroggo@google.com2013-08-15
| | | | | | This reverts commit f109b4ac6ef21ccb8b76891e50e63dae820af116. git-svn-id: http://skia.googlecode.com/svn/trunk@10760 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkMatrix44::invert() check for finite 1/det instead of magic valueGravatar commit-bot@chromium.org2013-08-15
| | | | | | | | | | | | | | | | Previously we were checking to see if the magnitude of determinant of the matrix to be inverted was less than 1.0e-8, which is a magic number possibly plucked from Graphics Gems. After some discussion, it's been determined (ha) that we can simply check to see if 1/det is finite and if so proceed. BUG=222926 R=reed@google.com, shawnsingh@chromium.org Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/22904003 git-svn-id: http://skia.googlecode.com/svn/trunk@10758 2bbb7eff-a529-9590-31e7-b0007b416f81
* ensure that negative zeros are still ignored when computing isIdentity()Gravatar reed@google.com2013-04-19
| | | | | | | | crbug.com/162747 git-svn-id: http://skia.googlecode.com/svn/trunk@8761 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix minor valgrind-found memory leaksGravatar robertphillips@google.com2013-03-21
| | | | | | | | https://codereview.chromium.org/12440066/ git-svn-id: http://skia.googlecode.com/svn/trunk@8297 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warings. add SkTAbs()Gravatar reed@google.com2013-01-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7075 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-12-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6746 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkMatrix44 constructor that allows user to control the initializationGravatar vollick@chromium.org2012-12-10
| | | | | | | | | | method. Preliminary results using Chromium's cc_perftests show that we can avoid almost half of the default constructors from redundantly/unnecessarily initializing the matrix to identity. Review URL: https://codereview.appspot.com/6872056 git-svn-id: http://skia.googlecode.com/svn/trunk@6742 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-12-06
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6687 2bbb7eff-a529-9590-31e7-b0007b416f81
* optimize translate and scaleGravatar reed@google.com2012-12-05
| | | | | | | add map2() to optimize for mapping an array of 2D points into homogeneous 4-vector Review URL: https://codereview.appspot.com/6874064 git-svn-id: http://skia.googlecode.com/svn/trunk@6685 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-12-04
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6660 2bbb7eff-a529-9590-31e7-b0007b416f81
* add getTypes() to SkMatrix44, to cache how complex the matrix is.Gravatar reed@google.com2012-12-03
| | | | | | | | | | | | add bench optimize operator== by performing 4 compares in a row before checking optimize setconcat by noting when we can write the answer directly into this At least on this macbook, I had to mark helpers like isIdentity() as inline to get them inlined. Review URL: https://codereview.appspot.com/6863053 git-svn-id: http://skia.googlecode.com/svn/trunk@6655 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkMatrix44::setColMajord, etc.Gravatar vollick@chromium.org2012-11-19
| | | | | | | | | We have accessors for efficiently getting the matirx data, and it would be nice if we had similar methods for setting the matrix entries. Review URL: https://codereview.appspot.com/6851063 git-svn-id: http://skia.googlecode.com/svn/trunk@6494 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkMatrix44::setTransposeGravatar vollick@chromium.org2012-11-14
| | | | | | | | | It turned out that adding getDouble(...) and setDouble(...) made this change easier, so I've included that in this cl as well. Review URL: https://codereview.appspot.com/6845048 git-svn-id: http://skia.googlecode.com/svn/trunk@6424 2bbb7eff-a529-9590-31e7-b0007b416f81
* Changing the visibility of SkMatrix44::determinant().Gravatar vollick@chromium.org2012-11-13
| | | | | | Review URL: https://codereview.appspot.com/6819080 git-svn-id: http://skia.googlecode.com/svn/trunk@6395 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-11-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6376 2bbb7eff-a529-9590-31e7-b0007b416f81
* add explicit mapScalars and mapMScalars entry-points, instead of just map()Gravatar reed@google.com2012-11-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6373 2bbb7eff-a529-9590-31e7-b0007b416f81
* add quick-n-dirty test for concat on matrix44Gravatar reed@google.com2012-11-09
| | | | | | Review URL: https://codereview.appspot.com/6827069 git-svn-id: http://skia.googlecode.com/svn/trunk@6371 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part II of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6474054 git-svn-id: http://skia.googlecode.com/svn/trunk@5263 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
* Fixing Windows compiler complaintsGravatar robertphillips@google.com2012-04-06
| | | | | | | | http://codereview.appspot.com/5991056/ git-svn-id: http://skia.googlecode.com/svn/trunk@3626 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
* add (disabled) tests for common anglesGravatar reed@google.com2011-06-24
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1708 2bbb7eff-a529-9590-31e7-b0007b416f81
* add row/col major getters, plus unit-testsGravatar reed@google.com2011-06-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1564 2bbb7eff-a529-9590-31e7-b0007b416f81