aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRect.cpp
Commit message (Collapse)AuthorAge
* refactor setBoundsCheck() a bitGravatar Mike Klein2018-05-17
| | | | | | | | | | | | | This doesn't change anything practical, but makes sure setBoundsCheck() and setBoundsNoCheck() run through the same logic. Bug: skia:7967 Change-Id: Ic78e2ebd5ebf46d6251c84ba93dcd397a97816fc Reviewed-on: https://skia-review.googlesource.com/129060 Auto-Submit: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* mapRect should not fiddle with nonfinite values.Gravatar Cary Clark2018-05-17
| | | | | | | | | Docs-Preview: https://skia.org/?cl=128682 Bug: skia:7967 Change-Id: Ic43387b7705ee8385b8df2430886484ff856077c Reviewed-on: https://skia-review.googlesource.com/128682 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Rewrite CHECK_INTERSECT to perform the !(opposite) predicate, so that weGravatar Mike Reed2018-04-23
| | | | | | | | | | return false if either argument is NaN. Bug: oss-fuzz:7914 Change-Id: If4f5eae736bb93451d2ff1c802e7c84a62a38cbc Reviewed-on: https://skia-review.googlesource.com/122957 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Sort all user-supplied rects before computeFastBoundsGravatar Brian Osman2017-05-13
| | | | | | | | | | | | | | | | https://codereview.chromium.org/908353002 fixed drawRect 2+ years ago, but drawOval and drawArc were still susceptible. This version ensures that all rects are sorted before we do the bounds check. Added a new makeSorted helper to simplify the code, and an assert to catch any future oversight. All other drawing functions compute their bounds rect in some way that already ensures it is sorted. Bug: skia: Change-Id: I8926b2dbe9d496d0876f1ac5313bd058ae4568b7 Reviewed-on: https://skia-review.googlesource.com/16702 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Change SkMemory to the more accurately named SkMalloc.Gravatar Herb Derby2017-03-27
| | | | | | | Change-Id: I6b08a74234b99bac866bad71014b94f7ec2d4bc8 Reviewed-on: https://skia-review.googlesource.com/10188 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Make SkMemory.h and adjust all files for usage.Gravatar Herb Derby2017-03-20
| | | | | | | | | | | | This will be rolled out in three stages: 1) make SkMemory.h and have SkTypes.h include it. 2) Adjust chromium and android. 3) no long include SkMemory.h in SkTypes.h Change-Id: If360ef5e1164d88f50b03f279e2e963ca2f57d5d Reviewed-on: https://skia-review.googlesource.com/9874 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Herb Derby <herb@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
* SkNx Load/store: take any pointer.Gravatar mtklein2016-01-31
| | | | | | | | | | This means we can remove a lot of explicit casts in code that uses SkNx. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1650653002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1650653002
* Remove overly-promiscuous SkNx syntax sugar.Gravatar mtklein2015-06-10
| | | | | | | | | | | | I haven't figured out a pithy way to have these apply to only classes originating from SkNx, so let's just remove them. There aren't too many use cases, and it's not really any less readable without them. Semantically, this is a no-op. BUG=skia: Review URL: https://codereview.chromium.org/1167153002
* Rename SkNi to SkNb.Gravatar mtklein2015-04-14
| | | | | | | | | | | | | | | | As used today, SkNi is used in bool-y contexts. This keeps that, but under a new name, SkNb. This makes room for a new SkNi that's focused on integer-y things like loads, stores, arithmetic, etc. The main reason to split these is that we want different specializations for each use case: for bools, it's important for us to specialize 32- and 64-bit to support efficient float- and double- comparisons, but for integer work we're more likely to be looking at 8- and 16- bit lanes. Keeping these use cases siloed helps me manage the compexity of the backend NEON and SSE code. BUG=skia: Review URL: https://codereview.chromium.org/1083123002
* Refactor Sk2x<T> + Sk4x<T> into SkNf<N,T> and SkNi<N,T>Gravatar mtklein2015-03-30
| | | | | | | | | | | | | | | | | | | | | The primary feature this delivers is SkNf and SkNd for arbitrary power-of-two N. Non-specialized types or types larger than 128 bits should now Just Work (and we can drop in a specialization to make them faster). Sk4s is now just a typedef for SkNf<4, SkScalar>; Sk4d is SkNf<4, double>, Sk2f SkNf<2, float>, etc. This also makes implementing new specializations easier and more encapsulated. We're now using template specialization, which means the specialized versions don't have to leak out so much from SkNx_sse.h and SkNx_neon.h. This design leaves us room to grow up, e.g to SkNf<8, SkScalar> == Sk8s, and to grown down too, to things like SkNi<8, uint16_t> == Sk8h. To simplify things, I've stripped away most APIs (swizzles, casts, reinterpret_casts) that no one's using yet. I will happily add them back if they seem useful. You shouldn't feel bad about using any of the typedef Sk4s, Sk4f, Sk4d, Sk2s, Sk2f, Sk2d, Sk4i, etc. Here's how you should feel: - Sk4f, Sk4s, Sk2d: feel awesome - Sk2f, Sk2s, Sk4d: feel pretty good No public API changes. TBR=reed@google.com BUG=skia:3592 Review URL: https://codereview.chromium.org/1048593002
* remove #if 0 codeGravatar reed2015-03-26
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1032273003
* Use Sk4x to speed-up bounds of an array of pointsGravatar reed2015-03-25
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1015633004
* Move clip off of draw targetGravatar joshualitt2015-02-23
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/947443003
* add dumpHex option to rect and rrect, to match pathGravatar reed2014-12-15
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/801383002
* faster SkRect::sortGravatar reed2014-10-10
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/646863002
* cleanup and optimize rect intersect routinesGravatar reed2014-10-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/640723004
* optimize setRectFan and join -- from profiling drawTextGravatar reed2014-10-01
| | | | | | | | BUG=skia: NOTREECHECKS=True NOTRY=True Review URL: https://codereview.chromium.org/615993003
* update to accommodate latest clang in chrome toolchainGravatar caryclark2014-09-18
| | | | | | | | | | | remove asserts for null pointers to references change var args signature to pointer instead of array R=mtklein@google.com, reed@android.com, reed@google.com, mtklein, reed Author: caryclark@google.com Review URL: https://codereview.chromium.org/577243002
* speedup SkRect::intersectGravatar mike@reedtribe.org2014-01-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12851 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
* remove SkFP.h and replace SkFP with SkScalar stop respecting ↵Gravatar reed@google.com2013-12-16
| | | | | | | | | | | SK_SOFTWARE_FLOAT, assume its always false stop respecting SK_SCALAR_SLOW_COMPARES, assume its always false BUG= R=caryclark@google.com Review URL: https://codereview.chromium.org/116183002 git-svn-id: http://skia.googlecode.com/svn/trunk@12686 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 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 I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
* explicitly track if a path is finite or notGravatar reed@google.com2012-07-26
| | | | | | | | we need this (it appears) so we can definitively reject non-finite paths in canvas, before passing them down into the guts. Review URL: https://codereview.appspot.com/6453047 git-svn-id: http://skia.googlecode.com/svn/trunk@4784 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove unused variable (isNaN)Gravatar reed@google.com2012-05-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3976 2bbb7eff-a529-9590-31e7-b0007b416f81
* for scalar==float, tis faster to always to MIN and MAX, than to put an ELSEGravatar reed@google.com2012-05-15
| | | | | | | | | | | | | | | | | | betwixt them. if (x < min) min = x; else if (x > max) max = x; This expression forces the compiler to know if the min expression executed, and insert a conditional jump before the max. Slow. if (x < min) min = x; if (x > max) max = x; This version allows the compiler to emitt MINSS and MAXSS unconditionally, giving us a loop with zero branches inside. git-svn-id: http://skia.googlecode.com/svn/trunk@3939 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use x*0 instead of x!=x to detect non-finite values, since x*0 also detects ↵Gravatar reed@google.com2012-05-15
| | | | | | | | | | | | | infinities and it is faster (at least faster in SkRect::set). Add unittest for SkRect::set to see that it correctly detects NaN and infinities. git-svn-id: http://skia.googlecode.com/svn/trunk@3936 2bbb7eff-a529-9590-31e7-b0007b416f81
* rename hasValidCoordinates to isFinite (on SkRect) and reimplement for speedGravatar reed@google.com2011-12-06
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2811 2bbb7eff-a529-9590-31e7-b0007b416f81
* handle NaN values in clipPathGravatar reed@google.com2011-11-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2632 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkRect::intersect(a, b), matching what was already available in SkIRectGravatar reed@google.com2011-10-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2513 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
* reformat for coding style, no logic changesGravatar reed@google.com2011-02-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@776 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkScalarIsFinite(), and use it for a more portable impl of ↵Gravatar reed@google.com2011-02-08
| | | | | | SkRect::isValidCoords() git-svn-id: http://skia.googlecode.com/svn/trunk@775 2bbb7eff-a529-9590-31e7-b0007b416f81
* Proposed fix for crash in Cr70244.Gravatar wjmaclean@chromium.org2011-02-07
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@764 2bbb7eff-a529-9590-31e7-b0007b416f81
* use sk_bzero instead of bzero, since it isn't always available.Gravatar reed@android.com2009-06-29
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@244 2bbb7eff-a529-9590-31e7-b0007b416f81
* grab from latest androidGravatar reed@android.com2008-12-17
git-svn-id: http://skia.googlecode.com/svn/trunk@27 2bbb7eff-a529-9590-31e7-b0007b416f81