aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/SkMatrix44.cpp
Commit message (Collapse)AuthorAge
* 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
* 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
* 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
* Revert of Use SkMScalar as intermediates in SkMatrix44::setConcat. ↵Gravatar commit-bot@chromium.org2014-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/146823002/) Reason for revert: This will break many Chromium tests when we roll. Original issue's description: > Use SkMScalar as intermediates in SkMatrix44::setConcat. > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=13167 R=reed@google.com TBR=reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: mtklein@google.com Review URL: https://codereview.chromium.org/147033002 git-svn-id: http://skia.googlecode.com/svn/trunk@13173 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use SkMScalar as intermediates in SkMatrix44::setConcat.Gravatar commit-bot@chromium.org2014-01-24
| | | | | | | | | | | BUG=skia: R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/146823002 git-svn-id: http://skia.googlecode.com/svn/trunk@13167 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix SkMatrix44::invert(...) for identity matrices and a NULL parameterGravatar commit-bot@chromium.org2013-11-20
| | | | | | | | | | | | | | | | | Currently, to check if an SkMatrix44 is singular, we call ::invert(NULL) and check the result. Usually this does no more work than is necessary. One case where we do far too much work is if |this| is an identity matrix. In this case, we do not early out and compute a (partial) determinant (we don't do the full shebang because there are no perspective components). BUG=None R=ajuma@chromium.org, reed@google.com Author: vollick@chromium.org Review URL: https://codereview.chromium.org/79333002 git-svn-id: http://skia.googlecode.com/svn/trunk@12327 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SkMatrix44 float conversions without precision lossGravatar commit-bot@chromium.org2013-10-29
| | | | | | | | | | | BUG=none R=reed@google.com Author: enne@chromium.org Review URL: https://codereview.chromium.org/50423004 git-svn-id: http://skia.googlecode.com/svn/trunk@12009 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix narrowing conversion errors from r11986Gravatar commit-bot@chromium.org2013-10-28
| | | | | | | | | | | | | | Although this function only gets used for SkMScalar=float, it gets compiled in when SkMScalar=double. R=epoger@google.com BUG=1764 Author: enne@chromium.org Review URL: https://codereview.chromium.org/49463005 git-svn-id: http://skia.googlecode.com/svn/trunk@11991 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove float/double conversions from SkMatrix44's map2_pfGravatar commit-bot@chromium.org2013-10-28
| | | | | | | | | | | BUG=chromium:303811 R=reed@google.com Author: enne@chromium.org Review URL: https://codereview.chromium.org/37693004 git-svn-id: http://skia.googlecode.com/svn/trunk@11986 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make skia almost compile again with clang.Gravatar commit-bot@chromium.org2013-10-07
| | | | | | | | | | | | clang is reporting many unused functions and variables. R=bsalomon@google.com, robertphillips@google.com, reed@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/26167002 git-svn-id: http://skia.googlecode.com/svn/trunk@11630 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
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-08-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@11017 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert determinant-based ScaleTranslate inverse. Gravatar commit-bot@chromium.org2013-08-29
| | | | | | | | | | | | | The current code fails the unit tests on Ubuntu32 Release. This will pass the tests, and also removes sk_bzero(). R=reed@google.com, robertphillips@google.com, shawnsingh@chromium.org Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/23477020 git-svn-id: http://skia.googlecode.com/svn/trunk@11006 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove sk_bzero usage from SkMatrix44 for improved performance.Gravatar shawnsingh@chromium.org2013-08-28
| | | | | | | | | | | | | sk_bzero is not efficient for initializing small chunks of memory. Instead, directly initializing matrix values when needed results in substantial performance improvements. BUG=skia:1558 R=reed@google.com Review URL: https://codereview.chromium.org/23090008 git-svn-id: http://skia.googlecode.com/svn/trunk@10988 2bbb7eff-a529-9590-31e7-b0007b416f81
* Improve performance of matrix inversion.Gravatar shawnsingh@chromium.org2013-08-22
| | | | | | | | | | | | | | | The inversion of scale+translate matrices was using 6 division operations when it could be using 3. Also, general affine matrices do not need to compute perspective components of the matrix. This patch updates the matrix inversion with those optimizations, and includes benchmark code to exercise those paths. R=jvanverth@google.com Review URL: https://codereview.chromium.org/23296006 git-svn-id: http://skia.googlecode.com/svn/trunk@10883 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
* cherry-pick from 7241: speed-up matrix44::setconcat when both inputs areGravatar reed@google.com2013-01-17
| | | | | | | | | | scale+translate by inlining the zero-assignments, rather than calling sk_bzero. bench: matrix44_setconcat 2x faster git-svn-id: http://skia.googlecode.com/svn/trunk@7251 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r7241, which broke tests on most platforms.Gravatar tomhudson@google.com2013-01-17
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7245 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SSE2 multiplication for SkMatrix44 on some platforms.Gravatar tomhudson@google.com2013-01-17
| | | | | | | | | Original author whunt@chromium.org. https://codereview.appspot.com/7058077/ git-svn-id: http://skia.googlecode.com/svn/trunk@7241 2bbb7eff-a529-9590-31e7-b0007b416f81
* To support alignment pragmas (for speed), we need to relax assumptions aboutGravatar reed@google.com2013-01-15
| | | | | | | | our sizeof. So rewrite operator= and copy-constructor to just copy individual fields. Review URL: https://codereview.appspot.com/7098063 git-svn-id: http://skia.googlecode.com/svn/trunk@7181 2bbb7eff-a529-9590-31e7-b0007b416f81
* Optimized implementation of SkMatrix44::preScaleGravatar shawnsingh@chromium.org2012-12-13
| | | | | | | | preScale() does not need to do a general matrix multiply. It can do 4x less arithmetic by directly scaling the columns of the input matrix. Review URL: https://codereview.appspot.com/6923048 git-svn-id: http://skia.googlecode.com/svn/trunk@6807 2bbb7eff-a529-9590-31e7-b0007b416f81
* Matrix inversion optimizations and benchmark; originally by whunt@google.com.Gravatar tomhudson@google.com2012-12-13
| | | | | | | | https://codereview.appspot.com/6901046/ git-svn-id: http://skia.googlecode.com/svn/trunk@6775 2bbb7eff-a529-9590-31e7-b0007b416f81
* use new enum-constructorsGravatar reed@google.com2012-12-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6744 2bbb7eff-a529-9590-31e7-b0007b416f81
* add helpers for isTranslate and isScaleTranslateGravatar mike@reedtribe.org2012-12-10
| | | | | | | | special-case determinant for isScaleTranslate git-svn-id: http://skia.googlecode.com/svn/trunk@6725 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
* Fixed remaining clang compiler warningsGravatar robertphillips@google.com2012-12-03
| | | | | | | | https://codereview.appspot.com/6865053/ git-svn-id: http://skia.googlecode.com/svn/trunk@6646 2bbb7eff-a529-9590-31e7-b0007b416f81
* Keep track of identity SkMatrix44sGravatar jamesr@chromium.org2012-11-29
| | | | | | | | | This keeps a bool on SkMatrix44 indicating if we know for sure that the matrix is identity, similar to the TypeMask on SkMatrix. This is useful to early-out of potentially expensive matrix math at the cost of some memory. Review URL: https://codereview.appspot.com/6854113 git-svn-id: http://skia.googlecode.com/svn/trunk@6620 2bbb7eff-a529-9590-31e7-b0007b416f81
* don't use bit-wise test for equality when using floats.Gravatar reed@google.com2012-11-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6557 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
* Add support for SK_MSCALAR_IS_FLOATGravatar vollick@chromium.org2012-11-13
| | | | | | | | | | The default is SK_MSCALAR_IS_FLOAT. You'll have to explicitly define SK_MSCALAR_IS_DOUBLE if that's what you want. BUG=None Review URL: https://codereview.appspot.com/6843049 git-svn-id: http://skia.googlecode.com/svn/trunk@6403 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
* remove one un-needed static initializerGravatar digit@google.com2012-01-10
| | | | | | | | | | This patch removes the use of a static C++ object in the implementation of SkMatrix44::isIdentity(). Instead, we rely on direct comparison with a statically allocated array of SkMScalar values, which is completely equivalent. Review URL: http://codereview.appspot.com/5502067 git-svn-id: http://skia.googlecode.com/svn/trunk@2991 2bbb7eff-a529-9590-31e7-b0007b416f81
* warning fixesGravatar bsalomon@google.com2011-10-27
| | | | | | | | | Review URL http://codereview.appspot.com/5328050/ git-svn-id: http://skia.googlecode.com/svn/trunk@2548 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix some VS2010 warningsGravatar bsalomon@google.com2011-09-29
| | | | | | | | | Review URL: http://codereview.appspot.com/5155043 git-svn-id: http://skia.googlecode.com/svn/trunk@2380 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
* Change output format of dump() to make VS2008 happy.Gravatar tomhudson@google.com2011-06-28
| | | | | | | | codereview.appspot.com/4629071/ git-svn-id: http://skia.googlecode.com/svn/trunk@1734 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
* move into utilsGravatar reed@google.com2011-06-13
git-svn-id: http://skia.googlecode.com/svn/trunk@1563 2bbb7eff-a529-9590-31e7-b0007b416f81