aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathUtils.cpp
Commit message (Collapse)AuthorAge
* Revert "Handle too many (or too large) paths in GrDefaultPathRenderer"Gravatar Brian Osman2017-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6383b298489504d7f8f822d7da575b04b14a9737. Reason for revert: Test failures Original change's description: > Handle too many (or too large) paths in GrDefaultPathRenderer > > PathGeoBuilder constructs the geometry with the same basic > technique as before, but allows interrupting the process > to emit multiple draws. > > Original test case was 2000 non-AA stroked circles, which > created ~66000 vertices. That now renders, as do various > tests with a single large path (as well as filled paths). > > TODO: I think that this could be extracted and re-used for > MSAA path renderer without too much work? I need to read > that code more carefully to make sure it lines up. > > Bug: skia:6695 > Change-Id: I18983ba3d4f475ae0651946958b4911008aa623f > Reviewed-on: https://skia-review.googlesource.com/18360 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:6695 Change-Id: I78ce9879a2e45e19f53027ca506cc2e8fae664b3 Reviewed-on: https://skia-review.googlesource.com/18981 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Handle too many (or too large) paths in GrDefaultPathRendererGravatar Brian Osman2017-06-07
| | | | | | | | | | | | | | | | | | | | PathGeoBuilder constructs the geometry with the same basic technique as before, but allows interrupting the process to emit multiple draws. Original test case was 2000 non-AA stroked circles, which created ~66000 vertices. That now renders, as do various tests with a single large path (as well as filled paths). TODO: I think that this could be extracted and re-used for MSAA path renderer without too much work? I need to read that code more carefully to make sure it lines up. Bug: skia:6695 Change-Id: I18983ba3d4f475ae0651946958b4911008aa623f Reviewed-on: https://skia-review.googlesource.com/18360 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Use more stable root finding methods for cubicsGravatar Christopher Dalton2017-06-06
| | | | | | | | | | | | | | Applies the quadratic formula from "Numerical Recipes in C", Section 5.6, to the homogeneous quadratic equations that find cubic inflection points and loop intersections. Also addresses KLM orientation ahead of time, rather than negating K and L after the fact. Bug: skia: Change-Id: Ic7e0818e2fe49b7724f9b583bae52281cfb1aea1 Reviewed-on: https://skia-review.googlesource.com/13481 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* Pre-clamp path toleranceGravatar Brian Osman2017-05-09
| | | | | | | | | | | | | GrDefaultPathRenderer was using GrPathUtils::worstCasePointCount, which clamped the tolerance. Then it built geometry with the unclamped value, leading to vertex overflow (found by canvas fuzzer). The new rule is if you use GrPathUtils, your tolerance must come from scaleToleranceToSrc. Bug: skia:6569 Change-Id: I851519db8e569e570c717033d697f3d4d3d787fb Reviewed-on: https://skia-review.googlesource.com/16234 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Fix missing tolerance in GrPathUtils::worstCasePointCountGravatar Robert Phillips2017-04-18
| | | | | | | | | | | | https://skia-review.googlesource.com/c/10752/ (Use correct tolerance for conic chopping in MSAA and default path renderers) changed the tolerance used in createGeom but didn't change the setting in worstCasePointCount. Bug: 711936, 712749 Change-Id: I540d8bc8cfdebc3eae5204e1acfeba3cefc2b12e Reviewed-on: https://skia-review.googlesource.com/13768 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@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>
* Fix cubic KLM solvingGravatar csmartdalton2017-04-12
| | | | | | | | | | | | Fixes calc_inverse_transpose_power_basis_matrix() to look for the determinant with the largest ABSOLUTE VALUE. BUG=skia: Change-Id: I70e26cc7ab9955d2e094fb7581f0ec9f5e0ae2d9 Reviewed-on: https://skia-review.googlesource.com/13081 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Find cubic KLM functionals directlyGravatar csmartdalton2017-03-23
| | | | | | | | | | | | | | | - Updates GrPathUtils to computes the KLM functionals directly instead of deriving them from their explicit values at the control points. - Updates the utility to return these functionals as a matrix rather than an array of scalar values. - Adds a benchmark for chopCubicAtLoopIntersection. BUG=skia: Change-Id: I97a9b5cf610d33e15c9af96b9d9a8eb4a94b1ca7 Reviewed-on: https://skia-review.googlesource.com/9951 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Generaly Fixes to gpu bezier codeGravatar Greg Daniel2017-03-14
| | | | | | | | | BUG=skia: Change-Id: I2246aa0b2bc3327df42ca30d35020a4b878a819b Reviewed-on: https://skia-review.googlesource.com/9555 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com>
* SkScalarMul is deprecatedGravatar Mike Reed2017-02-14
| | | | | | | | | BUG=skia: Change-Id: I88ecfe9d4c72506f6b1a0e0dfadd2a5c171a6cb6 Reviewed-on: https://skia-review.googlesource.com/8353 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Simplify k.w calculation in getConicKLM.Gravatar Dean McNamee2017-01-13
| | | | | | | | | | | | Additionally reformat the equations to better expose the symmetry. BUG=skia: Change-Id: If485cc7aeae97b89dedeb4d6b23efbe945036e3a Reviewed-on: https://skia-review.googlesource.com/7000 Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Dean McNamee <deanm@chromium.org> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Some assert fixes for running the Fuzzer sample in GPU mode.Gravatar senorblanco2016-08-19
| | | | | | | | | | | | | | | quadraticPointCount, cubicPointCount: passing NaN to GrNextPow2 causes it to assert, so detect that and return the max points per curve instead. Passing a zero scale to GrStyle::applyToPath() makes it assert, so draw nothing (likely what drawing with a zero scale is going to do anyway). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257423002 Review-Url: https://codereview.chromium.org/2257423002
* Remove a useless call: Calling lineVec.dot(qPts[0])Gravatar jcgregorio2016-08-11
| | | | | | | | | | | This is from https://github.com/google/skia/pull/9, an external pull request from https://github.com/sylvestre. BUG=skia: R=bsalomon GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2234563003 Review-Url: https://codereview.chromium.org/2234563003
* SkLeanWindows.h: #include "Windows.h" fewer placesGravatar halcanary2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | $ git grep -l '<windows.h>' include src include/private/SkLeanWindows.h $ git grep -l SkLeanWindows.h | grep '\.h$' include/ports/SkTypeface_win.h include/utils/win/SkHRESULT.h include/utils/win/SkTScopedComPtr.h include/views/SkEvent.h src/core/SkMathPriv.h src/ports/SkTypeface_win_dw.h src/utils/SkThreadUtils_win.h src/utils/win/SkWGL.h The same for `#include <intrin.h>` that was found in SkMath.h. Those functions that needed it are moved to SkMathPriv.h. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041943002 CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_chromium_compile_dbg_ng,win_chromium_compile_rel_ng Review-Url: https://codereview.chromium.org/2041943002
* Force values to 0.0f in QuadUVMatrix::setGravatar robertphillips2016-03-01
| | | | | | | BUG=skia:5002 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1749373002 Review URL: https://codereview.chromium.org/1749373002
* Modify interface to GrPathUtils::convertCubicToQuadsGravatar bsalomon2016-02-16
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1694403003 Review URL: https://codereview.chromium.org/1694403003
* Loosen check for zero vectors in GrPathUtils::convert_noninflect_cubic_to_quadsGravatar robertphillips2015-12-08
| | | | | | | | In the repro case the conic in question has a replicated control point at the end. These points end up being slightly different by the time they get to convert_noninflect_cubic_to_quads so the initial checks for a zero vector don't fire. The following checks, in the constrainWithinTangents path, do fire however leading to a premature termination of conversion to quads. BUG=skia:4611 Review URL: https://codereview.chromium.org/1504983003
* SkPath::Direction serves two masters:Gravatar reed2015-06-10
| | | | | | | | | | | | | - input param to addFoo (e.g. addRect), where only CW or CCW are valid) - output param from computing functions, that sometimes return kUnknown This CL's intent is to split these into distinct enums/features: - Direction (public) loses kUnknown, and is only used for input - FirstDirection (private) is used for computing the first direction we see when analyzing a contour BUG=skia: Review URL: https://codereview.chromium.org/1176953002
* Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of ↵Gravatar reed2015-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1138263002/) Reason for revert: android patched, blink has rolled Original issue's description: > Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/) > > Reason for revert: > need to wait for Blink roll (and patch android) > > Original issue's description: > > stop calling SkScalarDiv > > > > BUG=skia: > > TBR= > > > > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a > > TBR= > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/2629697933b5cc975e45d2a45c48f803fc6cbcec TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1135693003
* Revert of stop calling SkScalarDiv (patchset #4 id:60001 of ↵Gravatar reed2015-05-12
| | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1135053002/) Reason for revert: need to wait for Blink roll (and patch android) Original issue's description: > stop calling SkScalarDiv > > BUG=skia: > TBR= > > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1138263002
* stop calling SkScalarDivGravatar reed2015-05-12
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1135053002
* Fix to check for inf when generating quadratic pointsGravatar egdaniel2015-02-25
| | | | | | BUG=skia:3453 Review URL: https://codereview.chromium.org/948043003
* Add conic support to Default and AAConvex path redender.Gravatar egdaniel2015-01-05
| | | | | | | | | | This is achieved but chopping up conics into quads. With this change conics should be ready to be used on the gpu side of things BUG=skia:3258 Review URL: https://codereview.chromium.org/825443002
* 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
* Check for degenerate edges in cubic->quad conversion called by convex path ↵Gravatar bsalomon2014-06-19
| | | | | | | | | | | | | renderer. Cubics that are nearly degenerate now make it down here via the convex path renderer. They used to get filtered out by the path iterator but that was problematic. We wound up producing NaN vertices. BUG=2677 R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/338633007
* Move GrIPoint16 to SkIPoint16 (and remove GrPoint.h)Gravatar robertphillips2014-06-02
| | | | | | | | R=bsalomon@google.com, reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/309683002
* Rename SkMatrix::get(Max|Min)Stretch to get(Min|Max)ScaleGravatar commit-bot@chromium.org2014-05-20
| | | | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/295713002 git-svn-id: http://skia.googlecode.com/svn/trunk@14798 2bbb7eff-a529-9590-31e7-b0007b416f81
* SK_SUPPORT_LEGACY_GRTYPES to hide duplicate types from SkTypes.hGravatar commit-bot@chromium.org2014-03-28
| | | | | | | | | | | BUG=skia: R=bsalomon@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/216503004 git-svn-id: http://skia.googlecode.com/svn/trunk@13982 2bbb7eff-a529-9590-31e7-b0007b416f81
* deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. ↵Gravatar reed@google.com2013-12-17
| | | | | | | | | | | #define SK_SUPPORT_DEPRECATED_SCALARROUND for legacy clients BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/111353003 git-svn-id: http://skia.googlecode.com/svn/trunk@12719 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
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-12-05
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12499 2bbb7eff-a529-9590-31e7-b0007b416f81
* Simplify matrix generation for convex path rendererGravatar commit-bot@chromium.org2013-12-04
| | | | | | | | | | | | Addresses precision issues which were leading to asserts in Debug R=bsalomon@google.com, mtklein@google.com Author: jvanverth@google.com Review URL: https://codereview.chromium.org/102683002 git-svn-id: http://skia.googlecode.com/svn/trunk@12494 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFloatToScalar macroGravatar commit-bot@chromium.org2013-11-25
| | | | | | | | | | | BUG= R=reed@google.com, djsollen@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/85463005 git-svn-id: http://skia.googlecode.com/svn/trunk@12385 2bbb7eff-a529-9590-31e7-b0007b416f81
* Pull out Effect Shaders in GPU Path RendererGravatar commit-bot@chromium.org2013-08-22
| | | | | | | | | | | | | | | | | | Move the effects in HairLinePathRender (and eventually others into their own class called GrBezierEffects. This will allow for more sharing of code between different path renderers on GPU. BUG= Committed: http://code.google.com/p/skia/source/detail?r=10877 R=bsalomon@google.com, jvanverth@google.com, robertphillips@google.com Author: egdaniel@google.com Review URL: https://chromiumcodereview.appspot.com/23004010 git-svn-id: http://skia.googlecode.com/svn/trunk@10884 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Pull out Effect Shaders in GPU Path Renderer"Gravatar egdaniel@google.com2013-08-22
| | | | | | This reverts commit c48a99661cb3df9baa7012c001f8d7dcf0a2f368. git-svn-id: http://skia.googlecode.com/svn/trunk@10881 2bbb7eff-a529-9590-31e7-b0007b416f81
* Pull out Effect Shaders in GPU Path RendererGravatar commit-bot@chromium.org2013-08-22
| | | | | | | | | | | | | | | Move the effects in HairLinePathRender (and eventually others into their own class called GrBezierEffects. This will allow for more sharing of code between different path renderers on GPU. BUG= R=bsalomon@google.com, jvanverth@google.com, robertphillips@google.com Author: egdaniel@google.com Review URL: https://chromiumcodereview.appspot.com/23004010 git-svn-id: http://skia.googlecode.com/svn/trunk@10877 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move gpu conic calculations to GrPathUtilsGravatar commit-bot@chromium.org2013-08-20
| | | | | | | | | | | BUG= R=bsalomon@google.com, jvanverth@google.com Author: egdaniel@google.com Review URL: https://chromiumcodereview.appspot.com/22865023 git-svn-id: http://skia.googlecode.com/svn/trunk@10832 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add direct bezier cubic support for GPU shadersGravatar commit-bot@chromium.org2013-08-20
| | | | | | | | | | | BUG= R=bsalomon@google.com, jvanverth@google.com, robertphillips@google.com Author: egdaniel@google.com Review URL: https://chromiumcodereview.appspot.com/22900007 git-svn-id: http://skia.googlecode.com/svn/trunk@10814 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace uses of GrAssert by SkASSERT.Gravatar tfarina@chromium.org2013-08-17
| | | | | | | | R=bsalomon@google.com Review URL: https://codereview.chromium.org/22850006 git-svn-id: http://skia.googlecode.com/svn/trunk@10789 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace all instances of GrRect with SkRect.Gravatar commit-bot@chromium.org2013-07-17
| | | | | | | | | | | | And remove the typedef in GrRect.h. The same with GrIRect. R=robertphillips@google.com Author: tfarina@chromium.org Review URL: https://chromiumcodereview.appspot.com/19449002 git-svn-id: http://skia.googlecode.com/svn/trunk@10130 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove GrPathCmdGravatar bsalomon@google.com2013-05-10
| | | | | | | | R=reed@google.com Review URL: https://codereview.chromium.org/15068008 git-svn-id: http://skia.googlecode.com/svn/trunk@9097 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warning from scalar --> int32 conversionGravatar humper@google.com2013-01-07
| | | | | | | | BUG= Review URL: https://codereview.appspot.com/7065050 git-svn-id: http://skia.googlecode.com/svn/trunk@7061 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace GrMatrix with SkMatrix.Gravatar bsalomon@google.com2012-11-01
| | | | | | Review URL: https://codereview.appspot.com/6814067 git-svn-id: http://skia.googlecode.com/svn/trunk@6247 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove GrScalar, replace with SkScalar.Gravatar bsalomon@google.com2012-11-01
| | | | | | Review URL: https://codereview.appspot.com/6812064 git-svn-id: http://skia.googlecode.com/svn/trunk@6243 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 infinite recursion in cubic->quad conversion, also attempt to detect ↵Gravatar bsalomon@google.com2012-08-02
| | | | | | | | | | | | nearly flat cubics early. Review URL: http://codereview.appspot.com/6448100/ THIS WILL REQUIRE REBASELINING OF CONVEXPATHS GM. git-svn-id: http://skia.googlecode.com/svn/trunk@4917 2bbb7eff-a529-9590-31e7-b0007b416f81
* Preserve convex control point polygon in cubic->quadratic approximationGravatar bsalomon@google.com2012-07-10
| | | | | | | | | | | | GM test modified, will require rebaselining. Review URL: http://codereview.appspot.com/6355088/ git-svn-id: http://skia.googlecode.com/svn/trunk@4518 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixed Windows compiler complaintsGravatar robertphillips@google.com2012-07-10
| | | | | | | | http://codereview.appspot.com/6392044 git-svn-id: http://skia.googlecode.com/svn/trunk@4511 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove GrPath typedefGravatar bsalomon@google.com2012-04-27
| | | | | | | | Review URL: http://codereview.appspot.com/6128045/ git-svn-id: http://skia.googlecode.com/svn/trunk@3780 2bbb7eff-a529-9590-31e7-b0007b416f81
* Allow compiler to optimize applying quadratic UV matrix to vertsGravatar bsalomon@google.com2012-03-15
| | | | | | | | Code Review: http://codereview.appspot.com/5833048/ git-svn-id: http://skia.googlecode.com/svn/trunk@3398 2bbb7eff-a529-9590-31e7-b0007b416f81