aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkEdgeClipper.cpp
Commit message (Collapse)AuthorAge
* Stop using SkTSwap.Gravatar Ben Wagner2018-06-19
| | | | | | | | | | | | | Use std::swap instead. It does not appear that any external user specializes SkTSwap, but some may still use it. This removes all use in Skia so that SkTSwap can later be removed in a smaller CL. After that the <utility> include can be removed from SkTypes.h. Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753 Reviewed-on: https://skia-review.googlesource.com/135578 Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* SkTypes: more into SkMacrosGravatar Hal Canary2018-06-12
| | | | | | | | Change-Id: I4c9a2d81a1bc4ccebc78eea56c0de116b98d415e Reviewed-on: https://skia-review.googlesource.com/134330 Commit-Queue: Hal Canary <halcanary@google.com> Auto-Submit: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* give up on big cubics (for now) and just draw a lineGravatar Mike Reed2017-01-27
| | | | | | | | | BUG=683631, skia:6152 Change-Id: I69aa741af74a37e1d7bed25ad0401535599f6af0 Reviewed-on: https://skia-review.googlesource.com/7659 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
* extend clipper for lines, for uniformity, and so curves can call itself with ↵Gravatar Mike Reed2017-01-26
| | | | | | | | | | | lines BUG=skia: Change-Id: Id8c1fba6fcd2496802d3d17afe3f5c91bf5dfc33 Reviewed-on: https://skia-review.googlesource.com/7621 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
* re-chop if we fail on a big-bad-cubicGravatar reed2016-07-20
| | | | | | | BUG=629455 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2159223005 Review-Url: https://codereview.chromium.org/2159223005
* 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
* check bounds of each cubic segment against clipGravatar reed2015-12-17
| | | | | | | | | | | | | Timing against complex svg image (map), no tiling: no change or very slightly faster tiling (4x4): went from 3x slower (than untiled) to 2x slower no gold changes expected BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1532733002 Review URL: https://codereview.chromium.org/1532733002
* fix cubic clip in yGravatar caryclark2015-08-20
| | | | | | | | | | | | | | | | | | | Follow on to https://codereview.chromium.org/1299243002/ Clip using a geometric solution if the algebraic solution fails in Y as well as in X. If the root finder discovers real roots that are sufficiently far apart, the root in the range of 0..1 can contain so much error that it is computed to be slightly smaller than 0 or larger than 1. In this case, binary search the mono curve for the actual answer. R=reed@google.com Review URL: https://codereview.chromium.org/1303873003
* subdivide path when side-clipping failsGravatar caryclark2015-08-20
| | | | | | | | | | | | | Please review concept; I'm OK not to check this in. If the root finder fails, subdivide the curve and try again. This is complicated by the reversed nature of the curves; maybe it can be simpler, but how to do that escapes me. R=reed@google.com BUG=514246 Review URL: https://codereview.chromium.org/1299243002
* remove dead SK_SUPPORT_LEGACY_CUBIC_CHOPPER codeGravatar reed2015-05-05
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1116263005
* use pathops utils to improve precision of cubic chopping in scan converterGravatar reed2015-04-30
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1113963002
* cull edges that are to the right of the clipGravatar reed2015-02-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/913503002
* don't overclamp cubics (see skbug.com/1316)Gravatar reed@google.com2013-05-23
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/15924003 git-svn-id: http://skia.googlecode.com/svn/trunk@9262 2bbb7eff-a529-9590-31e7-b0007b416f81
* need to clamp all of the cubic points after a chop, in case our finite precisionGravatar reed@google.com2013-05-08
| | | | | | | | | | | | meant we didn't compute values below the chop-point. crbug:234190 R=caryclark@google.com Review URL: https://codereview.chromium.org/14607012 git-svn-id: http://skia.googlecode.com/svn/trunk@9071 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove obsolete build flags:Gravatar reed@google.com2013-02-22
| | | | | | | | | | | | | SK_IGNORE_TRANS_CLAMP_FIX SK_IGNORE_1XN_BITMAP_OPT SK_IGNORE_CLIP_BUG_FIX SK_IGNORE_FAST_SCALEMATRIX_INVERT SK_IGNORE_QUAD_STROKE_FIX SK_IGNORE_MULTIPLY_XFERMODE_OPT SK_IGNORE_LARGE_DASH_OPT Review URL: https://codereview.appspot.com/7381050 git-svn-id: http://skia.googlecode.com/svn/trunk@7829 2bbb7eff-a529-9590-31e7-b0007b416f81
* Place fix in r7278 behind compile flagGravatar robertphillips@google.com2013-01-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7300 2bbb7eff-a529-9590-31e7-b0007b416f81
* increase iteration count from 16 to 24, when computing cubic-line intersection.Gravatar reed@google.com2013-01-18
| | | | | | | | | | | This fixes crbug 170666. Before the fix, were were finishing the "clip" step with a curve that was still partly negative, and so as assert would fire. added unittest to confirm that the assert doesn't fire. git-svn-id: http://skia.googlecode.com/svn/trunk@7278 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix bug in cubic-clipper (SkEdgeClipper). When we chop the cubic on Top/BottomGravatar reed@google.com2013-01-15
| | | | | | | | | | | | | | | | | of the cliprect, we (correctly) clamp the Y coordinate of the control-point right next to the on-curve point that was chopped (this ensures we don't go slightly outside of the clip-rect due to imperfect T value calculation). However, the code was also clamping the other control-point as well, resulting in warping the cubic, which could sometimes force it outside of the clip. The fix is to just remove the line of code that clampped the 2nd control-point. unittest added to reproduce a test cubic that triggered an assert, due to the cubic being outside of the cliprect. The test (w/o the fix) will assert in a SK_DEBUG build. Review URL: https://codereview.appspot.com/7100056 git-svn-id: http://skia.googlecode.com/svn/trunk@7184 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
* fix clamping when we chop a cubicGravatar reed@google.com2012-04-16
| | | | | | Review URL: https://codereview.appspot.com/6039048 git-svn-id: http://skia.googlecode.com/svn/trunk@3691 2bbb7eff-a529-9590-31e7-b0007b416f81
* pin the edge points to the clip, rather than just calling clamp_ge/le in theGravatar reed@google.com2012-04-13
| | | | | | | | | | | quad chopper. This fixes some gaps we were seeing when the float match lost precisions. fixes http://code.google.com/p/skia/issues/detail?id=533 git-svn-id: http://skia.googlecode.com/svn/trunk@3677 2bbb7eff-a529-9590-31e7-b0007b416f81
* improve clamping logic when handling imprecise chopping of cubicsGravatar reed@google.com2012-01-11
| | | | | | | | http://code.google.com/p/skia/issues/detail?id=444 git-svn-id: http://skia.googlecode.com/svn/trunk@3011 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkDEBUGFAIL to clean up use of SkASSERT(!"text");Gravatar tomhudson@google.com2011-12-28
| | | | | | | | | | catch a couple of latent SkASSERT("text") bugs. http://codereview.appspot.com/5504090/ git-svn-id: http://skia.googlecode.com/svn/trunk@2926 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
* handle NaN in curve choppers and edgeclipperGravatar reed@android.com2010-03-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@522 2bbb7eff-a529-9590-31e7-b0007b416f81
* add unittest for IntersectLine, used by hairlinesGravatar reed@android.com2009-11-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@447 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix index-out-of-range constantGravatar reed@android.com2009-11-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@437 2bbb7eff-a529-9590-31e7-b0007b416f81
* return early if we hit overflow when chopping on the left (i.e. the entireGravatar reed@android.com2009-11-19
| | | | | | | | segment is effectively to the left) git-svn-id: http://skia.googlecode.com/svn/trunk@434 2bbb7eff-a529-9590-31e7-b0007b416f81
* new scanconversion techniqueGravatar reed@android.com2009-11-18
This technique geometrically clips all segments against the clip bounds, ensuring that we never send a value to the edgelist that might overflow in fixedpoint. Current disabled in SkScan_Path.cpp by a #define. There are a few minor pixel differences between this and the old technique, as found by the gm tool, so at the moment this new code is off by default. git-svn-id: http://skia.googlecode.com/svn/trunk@432 2bbb7eff-a529-9590-31e7-b0007b416f81