aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGeometry.h
Commit message (Collapse)AuthorAge
* partial revert of https://skia-review.googlesource.com/c/skia/+/90026 for ↵Gravatar Mike Reed2018-01-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android Some errors: frameworks/base/core/jni/android/graphics/Bitmap.cpp:385: error: undefined reference to 'gDitherMatrix_4Bit_16' frameworks/base/core/jni/android/graphics/Bitmap.cpp:397: error: undefined reference to 'gDitherMatrix_4Bit_16' frameworks/base/core/jni/android/graphics/Bitmap.cpp:373: error: undefined reference to 'gDitherMatrix_3Bit_16' frameworks/base/core/jni/android/graphics/Bitmap.cpp:322: error: undefined reference to 'SkPM4f::toF16() const' frameworks/base/core/jni/android/graphics/Bitmap.cpp:333: error: undefined reference to 'SkFloatToHalf(float)' frameworks/base/core/jni/android/graphics/Bitmap.cpp:334: error: undefined reference to 'SkFloatToHalf(float)' frameworks/base/core/jni/android/graphics/Bitmap.cpp:335: error: undefined reference to 'SkFloatToHalf(float)' frameworks/base/core/jni/android/graphics/Bitmap.cpp:336: error: undefined reference to 'SkFloatToHalf(float)' frameworks/base/core/jni/android/graphics/Bitmap.cpp:639: error: undefined reference to 'SkPM4f::toF16() const' frameworks/base/core/jni/android/graphics/Bitmap.cpp:494: error: undefined reference to 'SkPM4f::FromF16(unsigned short const*)' frameworks/base/core/jni/android/graphics/Bitmap.cpp:494: error: undefined reference to 'SkPM4f::unpremul() const' external/skia/src/core/SkUtils.h:24: error: undefined reference to 'SkOpts::memset32' frameworks/base/core/jni/android/graphics/NinePatch.cpp:112: error: undefined reference to 'SkLatticeIter::Valid(int, int, SkCanvas::Lattice const&)' frameworks/base/core/jni/android/graphics/NinePatch.cpp:113: error: undefined reference to 'SkLatticeIter::SkLatticeIter(SkCanvas::Lattice const&, SkRect const&)' frameworks/base/core/jni/android/graphics/NinePatch.cpp:118: error: undefined reference to 'SkLatticeIter::next(SkRect*, SkRect*, bool*, unsigned int*)' frameworks/base/core/jni/android/graphics/NinePatch.cpp:118: error: undefined reference to 'SkLatticeIter::next(SkRect*, SkRect*, bool*, unsigned int*)' frameworks/base/core/jni/android/graphics/NinePatch.cpp:118: error: undefined reference to 'SkLatticeIter::next(SkRect*, SkRect*, bool*, unsigned int*)' external/skia/src/core/SkGeometry.h:427: error: undefined reference to 'SkConic::computeQuadPOW2(float) const' external/skia/src/core/SkGeometry.h:430: error: undefined reference to 'SkConic::chopIntoQuadsPOW2(SkPoint*, int) const' frameworks/base/core/jni/android/graphics/Shader.cpp:77: error: undefined reference to 'SkMakeImageFromRasterBitmap(SkBitmap const&, SkCopyPixelsMode)' Bug: skia:7454 Change-Id: I49b7c0890ac38b576b39e1ce76b22e2420c99889 Reviewed-on: https://skia-review.googlesource.com/90524 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* remove unused declarationsGravatar Mike Reed2018-01-03
| | | | | | | | Bug: skia: Change-Id: If8ca5e3d649dab3cf8b2bdb1cf072ff23cea9465 Reviewed-on: https://skia-review.googlesource.com/90026 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* CCPR: Combine loops and serpentines back into a single shaderGravatar Chris Dalton2017-12-08
| | | | | | | | Bug: skia: Change-Id: I945471ccd2580a2d39afd9c80acb8d9e5e196435 Reviewed-on: https://skia-review.googlesource.com/82460 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Harden SkClassifyCubicGravatar Chris Dalton2017-11-09
| | | | | | | | BUG=chromium:743617 Change-Id: Idfb89832b48ebd60fd9109cd526bdd5cd5931ada Reviewed-on: https://skia-review.googlesource.com/68980 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Add SK_API to APIs used by the android framework.Gravatar Derek Sollenberger2017-09-21
| | | | | | | | | | | | | This CL enables us to set the default visibility of the symbols on Android to hidden. It is the intent that all of he SK_APIs that have been added to /src directies should be removed as soon as we can remove their callers within Android. Bug: b/31971097 Change-Id: Ic787f94df0fb0c2b8d941aa7095a12b317c4b5de Reviewed-on: https://skia-review.googlesource.com/49501 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Minor cleanups for CCPRGravatar Chris Dalton2017-09-12
| | | | | | | | Bug: skia: Change-Id: Ic4838f0e242ded0c3d0cb5c86715ed67d8152f5c Reviewed-on: https://skia-review.googlesource.com/44520 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* CCPR: Remove cubic insets and MSAA bordersGravatar Chris Dalton2017-09-05
| | | | | | | | | | | | | | | Avoids the need for MSAA cubic borders by chopping up the cubic geometry and crossing the inflections points and loop intersections with lines and quadratic(s) instead. This allows us to render the remaining cubic segments with simple hulls and analytic AA, giving better image quality and performance. Bug: skia: Change-Id: If371229f575ee0286c325c230a116d602a9d38ce Reviewed-on: https://skia-review.googlesource.com/41883 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Convert SkClassifyCubic to double precisionGravatar Chris Dalton2017-06-12
| | | | | | | | | | | | | Even though it's in homogeneous coordinates, we still get unfortunate artifacts if this math is not done in double precision. Prioritizing correctness for now; we can revisit in the future as the need for performance dictates. Bug: skia: Change-Id: If416ef6b70291f1454fcb9f7630d1108644ac2a5 Reviewed-on: https://skia-review.googlesource.com/19501 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Improve cubic KLM accuracyGravatar Chris Dalton2017-06-09
| | | | | | | | | | | | | | | | | | | | | | Moves cubic root finding logic out of GrPathUtils and PathOpsCubicIntersectionTest, and unifies it in SkGeometry. "Normalizes" the homogeneous parameter values of the roots, rather than the cubic inflection function. Does this normalization by twiddling the exponents instead of division (which causes a loss of precision). Abandons the built-in derivatives in GrCubicEffect. These don't have high enough precision on many mobile gpus. Instead we pass the KLM matrix to the vertex shader via uniform, where we can use it to set up new linear functionals from which the fragment shader can calculate the gradient of the implicit function. Bug: skia:4410 Change-Id: Ibd64e999520adc8cdef7803a492d3699995aef5a Reviewed-on: https://skia-review.googlesource.com/19017 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Improve accuracy of cubic classificationGravatar Chris Dalton2017-04-14
| | | | | | | | | | | | | | | | | | - Updates the logic to reflect the Loop-Blinn paper instead of the GPU gems website. - Removes the threshold for detecting local cusps. The serpentine codepath works for these cusps anyway, so what we really want to know is whether the discriminant is negative. - Makes sure to not scale the inflection function by 1/0. - Shifts the inflection function coefficients in d[] so they match the paper. - Stores the cubic discriminant in d[0]. Bug: skia: Change-Id: I909a522a0fd27c9c8dfbc27d968bc43eeb7a416f Reviewed-on: https://skia-review.googlesource.com/13304 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* allow conic chop to failGravatar caryclark2016-09-26
| | | | | | | | | | | | | Fuzzy values may cause the conic chop to fail. Check to see if the values are all finite, and require the caller to do the same. R=reed@google.com BUG=650178 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2368993002 Review-Url: https://codereview.chromium.org/2368993002
* fix conic path fuzzGravatar caryclark2016-08-23
| | | | | | | | | | | | The test conic has a very large weight, so it reduces to a pair of lines. Detect this case rather than subdividing the conic so much that the answers are meaningless. R=herb@google.com, reed@google.com BUG=638223 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2268073004 Review-Url: https://codereview.chromium.org/2268073004
* 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
* move more geometry to simdGravatar caryclark2016-01-26
| | | | | | | | | | | | Remove duplicate quad and cubic code around computing the polynomial coefficients, and use common SIMD-based code instead. R=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1633143002 Review URL: https://codereview.chromium.org/1633143002
* remove legacy definesGravatar caryclark2016-01-25
| | | | | | | | | | | | | | | | | | The defines SK_SUPPORT_LEGACY_ARCTO SK_SUPPORT_LEGACY_CONIC_MEASURE SK_SUPPORT_LEGACY_DASH_MEASURE SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS SK_SUPPORT_LEGACY_PATH_MEASURE_TVALUE have been removed from Chrome. This removes the obsolete code from Skia as well. R=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1627703002 Review URL: https://codereview.chromium.org/1627703002
* replace arcto quads with a conicGravatar caryclark2016-01-20
| | | | | | | | | | | also, remove code used only for the quad generation R=reed@google.com BUG=578885 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1612543003 Review URL: https://codereview.chromium.org/1612543003
* fix circular dashingGravatar caryclark2016-01-19
| | | | | | | | | | | | | | | | | | | | | Path measure cannot use the same code approach for quadratics and cubics. Subdividing cubics repeatedly does not result in subdivided t values, e.g. a quarter circle cubic divided in half twice does not have a t value equivalent to 1/4. Instead, always compute the cubic segment from a pair of t values. When finding the length of the cubic through recursive measures, it is enough to carry the point at a given t to the next subdivision. (Chrome suppression has landed already.) R=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1602153002 Review URL: https://codereview.chromium.org/1602153002
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* handle large conic strokes betterGravatar caryclark2015-05-19
| | | | | | | | | | | | | | | | | | | | A stroked conic computes the outset quad's control point by computing the intersection of the quad's endpoints. If the the denominator used to compute the scale factor for the control point is small, check to see if the numerator is also small so that the division stays bounded. Also clean up error returns and internal function calls to simplify the code. Additionally, remove comic max curvature (unimplemented) and call extrema functions instead to handle cases where the conic is degenerate or is a line. R=reed@google.com, fmalita@chromium.org BUG=skia:3843 Review URL: https://codereview.chromium.org/1144883003
* use pathops utils to improve precision of cubic chopping in scan converterGravatar reed2015-04-30
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1113963002
* remove older version of cubic->coeffGravatar reed2015-04-15
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1084623004
* Speeup hairline curves (quads and cubics) (patchset #7 id:120001 of ↵Gravatar reed2015-04-15
| | | | | | | | | | | | | https://codereview.chromium.org/1078413003/)" ah ha! Check for the define *after* we pull in SkUserConfig.h (indirectly) This reverts commit 639a82855b94b93c4fa45560e67df8ec4a8bbb3a. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1084283003
* Revert of Speeup hairline curves (quads and cubics) (patchset #7 id:120001 ↵Gravatar reed2015-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/1078413003/) Reason for revert: Crazy failings in chrome tests http://build.chromium.org/p/client.skia/builders/Linux%20Tests/builds/1862 Original issue's description: > Speeup hairline curves (quads and cubics) > > /skia/trunk> cat ../old.txt > maxrss loops min median mean max stddev samples config bench > 9M 1 4.28ms 4.32ms 4.36ms 4.67ms 3% ▄▁▁▃▂▂▁▁▂█ 8888 path_hairline_small_AA_cubic > 9M 1 743µs 767µs 770µs 825µs 4% ▃▃▇▃▁▁▅▁█▁ 8888 path_hairline_small_AA_conic > 9M 1 533µs 606µs 598µs 680µs 9% ▁▂▂█▆▇▇▄▂▂ 8888 path_hairline_small_AA_quad > 9M 1 451µs 452µs 456µs 495µs 3% ▁▁▁▁█▁▁▁▁▁ 8888 path_hairline_small_AA_line > > /skia/trunk> cat ../new.txt > maxrss loops min median mean max stddev samples config bench > 9M 1 827µs 827µs 831µs 869µs 2% ▁▁▁▁▁▁▁█▁▁ 8888 path_hairline_small_AA_cubic > 9M 1 515µs 517µs 517µs 518µs 0% ▇█▆▅▃▃▁▁▁▅ 8888 path_hairline_small_AA_conic > 9M 1 310µs 311µs 315µs 332µs 2% ▂▁█▆▁▁▁▁▁▁ 8888 path_hairline_small_AA_quad > 9M 1 254µs 254µs 258µs 276µs 3% ▁▁▁▁▁▁▁█▇▂ 8888 path_hairline_small_AA_line > > Edited revert of https://codereview.chromium.org/1085013003 > > TBR= > > Expectations: > - no effect on chrome, as it is guarded > - lots of tiny rebaselines for skia TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1092483003
* Speeup hairline curves (quads and cubics)Gravatar reed2015-04-15
| | | | | | | | | | | | | | | | | | | | | | /skia/trunk> cat ../old.txt maxrss loops min median mean max stddev samples config bench 9M 1 4.28ms 4.32ms 4.36ms 4.67ms 3% ▄▁▁▃▂▂▁▁▂█ 8888 path_hairline_small_AA_cubic 9M 1 743µs 767µs 770µs 825µs 4% ▃▃▇▃▁▁▅▁█▁ 8888 path_hairline_small_AA_conic 9M 1 533µs 606µs 598µs 680µs 9% ▁▂▂█▆▇▇▄▂▂ 8888 path_hairline_small_AA_quad 9M 1 451µs 452µs 456µs 495µs 3% ▁▁▁▁█▁▁▁▁▁ 8888 path_hairline_small_AA_line /skia/trunk> cat ../new.txt maxrss loops min median mean max stddev samples config bench 9M 1 827µs 827µs 831µs 869µs 2% ▁▁▁▁▁▁▁█▁▁ 8888 path_hairline_small_AA_cubic 9M 1 515µs 517µs 517µs 518µs 0% ▇█▆▅▃▃▁▁▁▅ 8888 path_hairline_small_AA_conic 9M 1 310µs 311µs 315µs 332µs 2% ▂▁█▆▁▁▁▁▁▁ 8888 path_hairline_small_AA_quad 9M 1 254µs 254µs 258µs 276µs 3% ▁▁▁▁▁▁▁█▇▂ 8888 path_hairline_small_AA_line Edited revert of https://codereview.chromium.org/1085013003 TBR= Review URL: https://codereview.chromium.org/1078413003
* use new faster/vector impl for chopping conicsGravatar reed2015-03-26
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1035943002
* remove slower scalar code in favor of vectorsGravatar reed2015-03-26
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1001833006
* SkChopCubicAt2 using Sk2s -- 2x fasterGravatar reed2015-03-24
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1036753002
* use Sk2s for conicsGravatar reed2015-03-20
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1025033002
* use Sk2s for EvalQuadTangent and ChopQuadAtGravatar reed2015-03-20
| | | | | | | | cloned from https://codereview.chromium.org/1026633002/ BUG=skia: Review URL: https://codereview.chromium.org/1024873003
* alt SkEvalQuadAt that returns its answer, using Sk2fGravatar reed2015-03-19
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1011493003
* remove unused SkXRay functionsGravatar reed2015-03-18
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1016263002
* Use conics for round joins and capsGravatar reed2015-02-10
| | | | | | | | | patch from issue 909013004 at patchset 20001 (http://crrev.com/909013004#ps20001) BUG=skia: TBR=caryclark Review URL: https://codereview.chromium.org/910213002
* use conics for arcToGravatar reed2015-02-09
| | | | | | | | guarded by SK_SUPPORT_LEGACY_ARCTO_QUADS BUG=skia: Review URL: https://codereview.chromium.org/892703002
* use conicsGravatar reed2014-12-17
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/455043002
* Extract cubic classification from gpu into geometryGravatar caryclark2014-12-12
| | | | | | | Move code from the GPU path utilities into geometry so that path ops can share. Review URL: https://codereview.chromium.org/787763007
* use SkScalar instead of floatGravatar reed2014-12-11
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/796803005
* move some headers out of publicGravatar reed2014-06-17
| | | | | | | | | | | patch from issue 338263003 BUG=skia: R=mtklein@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/339183002
* first cut at event-based test appGravatar reed@android.com2008-12-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@37 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