aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPath.cpp
Commit message (Collapse)AuthorAge
* Add an SkPath conic conversion utility.Gravatar fmalita2015-12-01
| | | | | | | | | Expose SkConic::chopIntoQuadsPOW2() as SkPath::ConvertConicToQuads(). BUG=chromium:315277 R=reed@google.com Review URL: https://codereview.chromium.org/1484373002
* add SkPath::isRRectGravatar caryclark2015-11-19
| | | | | | | | | | | Add helper to track when a round rect was added to a path, and then return the SkRRect specification that describes it. Move the implementation for SkPath::RawIter to SkPathRef so it can be used there as well. R=reed@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/1461763004
* Parametric SkPath oval/rect/rrect starting pointGravatar fmalita2015-11-17
| | | | | | | | | | | Extend the SkPath API to allow specifying the contour starting point. This will allow removing the explicit cubic code from Blink/Path. BUG=chromium:315277 R=reed@google.com,caryclark@google.com Review URL: https://codereview.chromium.org/1452203002
* Base SkAutoTUnref on skstd::unique_ptr.Gravatar bungeman2015-10-01
| | | | | | | | | To further consolidate the various unique owning classes, this bases SkAutoTUnref on skstd::unique_ptr. Users are updated because of two breaking changes, swap now takes a reference and reset no longer returns its argument. Review URL: https://codereview.chromium.org/1370803002
* Make SkPath fFirstDirection atomic to fix tsan.Gravatar herb2015-09-28
| | | | | | | | | | There is no API change. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1372103003
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Very tiny paths are subsumed by the ConvexicatorGravatar caryclark2015-07-14
| | | | | | | | | | | | | | | and are treated as convex when they are not. Allow the SkPath::Iter to leave degenerate path segments unmolested by passing an additional exact bool to next(). Treat any non-zero length as significant in addPt(). R=reed@google.com,robertphillips@google.com BUG=493450 Review URL: https://codereview.chromium.org/1228383002
* Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate.Gravatar mtklein2015-07-07
| | | | | | | | | | | | | | SkThread.h doesn't do anything anymore execept include those two, and thankfully, it doesn't seem to be mentioned outside Skia. No public API changes. TBR=reed@google.com BUG=skia: Committed: https://skia.googlesource.com/skia/+/c50acf2321d7a934c80d754e9cbe936dfb8eb4cc Review URL: https://codereview.chromium.org/1215393002
* Revert of Remove SkThread.h, include SkMutex.h or SkAtomics.h as ↵Gravatar jvanverth2015-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appropriate. (patchset #4 id:60001 of https://codereview.chromium.org/1215393002/) Reason for revert: Breaking the roll. E.g. on android_chromium_gn_compile_dbg: FAILED: /b/build/goma/gomacc ../../third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -MMD -MF obj/skia/ext/libskia.SkMemory_new_handler.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=1 -DENABLE_NOTIFICATIONS -DENABLE_BROWSER_CDMS -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DDONT_EMBED_BUILD_METADATA -DUSE_OPENSSL=1 -DUSE_OPENSSL_CERTS=1 -DNO_TCMALLOC -DDISABLE_NACL -DENABLE_CONFIGURATION_POLICY -DENABLE_SUPERVISED_USERS=1 -DENABLE_AUTOFILL_DIALOG=1 -DUSE_PROPRIETARY_CODECS -DV8_USE_EXTERNAL_STARTUP_DATA -DVIDEO_HOLE=1 -DMOBILE_SAFE_BROWSING -DSAFE_BROWSING_SERVICE -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -DANDROID -DHAVE_SYS_UIO_H -DCOMPONENT_BUILD -D__GNU_SOURCE=1 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DSKIA_IMPLEMENTATION=1 -DSK_ARM_HAS_OPTIONAL_NEON -DSK_GAMMA_APPLY_TO_A8 -DSK_GAMMA_EXPONENT=1.4 -DSK_GAMMA_CONTRAST=0.0 -DSK_DEFAULT_FONT_CACHE_LIMIT=1048576 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_SUPPORT_GPU=1 -DSK_BUILD_FOR_ANDROID -DUSE_CHROMIUM_SKIA -DXML_STATIC -I../.. -Igen -I../../third_party/skia/include/private -I../../third_party/skia/src/core -I../../third_party/skia/src/image -I../../third_party/skia/src/opts -I../../third_party/skia/src/pdf -I../../third_party/skia/src/ports -I../../third_party/skia/src/sfnt -I../../third_party/skia/src/utils -I../../third_party/skia/src/lazy -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/gpu -I../../third_party/skia/src/gpu -I../../third_party/zlib -I../../third_party/expat/files/lib -I../../third_party/freetype-android/include -I../../third_party/freetype-android/src/include -I../../third_party/android_tools/ndk/sources/android/cpufeatures -fno-strict-aliasing -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a -mthumb -mthumb-interwork -fno-tree-sra -fno-caller-saves -funwind-tables -fPIC -pipe -ffunction-sections -funwind-tables -fno-short-enums -finline-limit=64 -mfpu=vfpv3-d16 -isystem../../third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libcxx/include -isystem../../third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/include -isystem../../third_party/android_tools/ndk/sources/android/support/include -fvisibility=hidden --sysroot=/b/build/slave/android_chromium_gn/build/src/third_party/android_tools/ndk/platforms/android-16/arch-arm -Os -fdata-sections -ffunction-sections -fomit-frame-pointer -g1 -Wno-format -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wno-extra -Wno-ignored-qualifiers -Wno-type-limits -Wno-unused-local-typedefs -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -fno-rtti -fno-exceptions -Wno-deprecated -Wno-narrowing -Wno-literal-suffix -Wno-error=c++0x-compat -Wno-non-virtual-dtor -Wno-sign-promo -c ../../skia/ext/SkMemory_new_handler.cpp -o obj/skia/ext/libskia.SkMemory_new_handler.o ../../skia/ext/SkMemory_new_handler.cpp:12:52: fatal error: third_party/skia/include/core/SkThread.h: No such file or directory #include "third_party/skia/include/core/SkThread.h" Original issue's description: > Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate. > > SkThread.h doesn't do anything anymore execept include those two, > and thankfully, it doesn't seem to be mentioned outside Skia. > > No public API changes. > TBR=reed@google.com > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/c50acf2321d7a934c80d754e9cbe936dfb8eb4cc TBR=mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1214603003
* Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate.Gravatar mtklein2015-07-01
| | | | | | | | | | | | SkThread.h doesn't do anything anymore execept include those two, and thankfully, it doesn't seem to be mentioned outside Skia. No public API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1215393002
* fix deserialization after FirstDirection change to pathsGravatar reed2015-06-11
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1185453003
* 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
* simplify RawIter - don't return a pt in kCloseGravatar reed2015-05-27
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1156893003
* simplify RawIterGravatar reed2015-05-13
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1137783006
* Fix build warning: 'this' pointer cannot be null in well-defined C++ code; ↵Gravatar dongseong.hwang2015-04-30
| | | | | | comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] Review URL: https://codereview.chromium.org/1109933003
* Fix build warning: reference cannot be bound to dereferenced null pointer in ↵Gravatar dongseong.hwang2015-04-30
| | | | | | well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] Review URL: https://codereview.chromium.org/1110353003
* minor fixes to cubics code and overall alignment of how bounds and tops are ↵Gravatar caryclark2015-04-29
| | | | | | | | | | | | computed for all curve types All but 17 extended tests work. A helper function is privately added to SkPath.h to permit a test to modify a given point in a path. BUG=skia:3588 Review URL: https://codereview.chromium.org/1107353004
* Now, path ops natively intersect conics, quads, and cubics in any ↵Gravatar caryclark2015-04-20
| | | | | | | | | | | combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall. Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops. TBR=reed BUG=skia:3588 Review URL: https://codereview.chromium.org/1037953004
* change isNestedRect to isNestedFillRectGravatar caryclark2015-04-08
| | | | | | | | | R=reed@google.com, bsalomon@google.com Let isNested(Fill)Rect return true if drawn path describes filled rectangles. Review URL: https://codereview.chromium.org/1073473002
* remove SK_SUPPORT_LEGACY_ARCTO_QUADS codeGravatar reed2015-03-20
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1023103004
* Remove SK_SUPPORT_LEGACY_ADDOVALGravatar fmalita2015-03-09
| | | | | | | | | The flad has been retired from Chromium. BUG=chromium:458898 R=reed@google.com Review URL: https://codereview.chromium.org/994533002
* add double precision convex testGravatar caryclark2015-03-02
| | | | | | BUG=389050 Review URL: https://codereview.chromium.org/975523002
* treat backwards quads as not convexGravatar caryclark2015-03-02
| | | | | | | | | | If a quad, cubic, or conic goes back on itself, assume it's not convex. In a future CL, we could check to see if the curve is linear so that linear curves are treated the same as lines. BUG=skia:3469 Review URL: https://codereview.chromium.org/971773002
* fuzzer fixesGravatar caryclark2015-02-25
| | | | | | | | | | | | | | | | | | | Fix path bugs exposed by the path fuzzer. Changes to existing gm and samplecode files defer their calls to construct SkPath objects until the first draw instead of at test initialization. Add an experimental call to SkPath to validate the internal SkPathRef. Fix SkPath::addPoly to set the last moveto after adding a close verb. Fix stroke to handle failures when computing the unit normal. Add a unit test for the unit normal failure. R=reed@google.com Review URL: https://codereview.chromium.org/953383002
* Reset conicWeights in SkPath::consumeDegenerateSegments when rewinding to ↵Gravatar robertphillips2015-02-23
| | | | | | | | | | | | last Move op Without this patch the iterator can end up running off the end of the conic weights if there is a mixture of degenerate and non-degenerate ops Note: we might want to suppress the generation of degenerate conics and lines in SkPath::addRRect BUG=459897 Review URL: https://codereview.chromium.org/954453003
* add gm for path-arcs, and catch degenerate arc in conic-caseGravatar reed2015-02-17
| | | | | | BUG=skia:3428 Review URL: https://codereview.chromium.org/931183002
* Remove SK_SUPPORT_LEGACY_ADDRRECTGravatar fmalita2015-02-17
| | | | | | | | | The flag is no longer used in Chromium. BUG=458898 R=reed@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/929173002
* Remove android specific srcPath from SkPathGravatar djsollen2015-02-17
| | | | Review URL: https://codereview.chromium.org/926693002
* use conics for arcToGravatar reed2015-02-09
| | | | | | | | guarded by SK_SUPPORT_LEGACY_ARCTO_QUADS BUG=skia: Review URL: https://codereview.chromium.org/892703002
* share code between arcTo and addArc, update doxGravatar reed2015-01-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/863123005
* reorg some path routines, preparing to switch arcs to conicsGravatar reed2015-01-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/887783002
* use conics for ovals and roundrectsGravatar reed2015-01-06
| | | | | | | | | This reverts commit e3b61eb7997d12c5f9b844dd3af1847492d9f411. BUG=skia: TBR= Review URL: https://codereview.chromium.org/834303002
* Revert of use conics for ovals and roundrects (patchset #1 id:1 of ↵Gravatar reed2015-01-06
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/817283005/) Reason for revert: need fix in edgebuilder+aa Original issue's description: > use conics for ovals and roundrects > > adapted from https://codereview.chromium.org/831313002/ > > BUG=skia: > TBR= > > Committed: https://skia.googlesource.com/skia/+/2bf1c4d58b84c73c6421edcb25e3afb4971da200 TBR=reed@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/840573002
* use conics for ovals and roundrectsGravatar reed2015-01-05
| | | | | | | | | adapted from https://codereview.chromium.org/831313002/ BUG=skia: TBR= Review URL: https://codereview.chromium.org/817283005
* Remove SkPath::asRectGravatar robertphillips2015-01-05
| | | | | | | | | | AFAICT the asRect entry point is not needed. Greg: GPU Reed: API Cary: Path Review URL: https://codereview.chromium.org/833193002
* Cleanup isRect variantsGravatar robertphillips2015-01-05
| | | | Review URL: https://codereview.chromium.org/832083002
* Update stroke path to use rect returned from isRect (to fix trailing moveTo bug)Gravatar robertphillips2014-12-29
| | | | | | | | | | This basically recreates what was done in: https://codereview.chromium.org/16950021/ (add rect-output parameter to isRect, allowing us to return the correct bounds even if a rectagular path has a trailing moveTo) with the addition of GM representation BUG=skia:247770 Review URL: https://codereview.chromium.org/834503002
* Fix bound returned by SkPath::isRect when the path contains a trailing moveToGravatar robertphillips2014-12-29
| | | | | | | | | | | | | | | | | | Oddly enough this was fixed in: https://codereview.chromium.org/16950021/ (add rect-output parameter to isRect, allowing us to return the correct bounds even if a rectagular path has a trailing moveTo) but was reverted here: https://skia.googlesource.com/skia/+/8fd160350ca5f57fbb1b2e03383c5778414a9b48 since it appeared to be crashing Chrome's trybots. I think it just fell through the cracks after that. If this sticks I will land a follow on patch for the stroke issue reported in the original bug (crbug.com/247770). BUG=247770,445368 Review URL: https://codereview.chromium.org/834483002
* use conics for addRRectGravatar reed2014-12-17
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/792493005
* use conicsGravatar reed2014-12-17
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/455043002
* Fix rrects that are large enough that we lose/gain a bit when we add the ↵Gravatar reed2014-12-15
| | | | | | | | | | radius to a bounds coordinate. add test that triggers assert in addRRect BUG=skia:3239 Review URL: https://codereview.chromium.org/803153003
* add dumpHex option to rect and rrect, to match pathGravatar reed2014-12-15
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/801383002
* change SkPoint::setLength to set itself to (0,0) if it starting length is ↵Gravatar reed2014-12-09
| | | | | | | | | degenerate. BUG=skia:3203 TBR=caryclark Review URL: https://codereview.chromium.org/785933003
* add convexity logic and tests for scalar max, Inf, and NaNGravatar caryclark2014-12-08
| | | | | | | | | | PathOps relies on isConvex() only returning true for trivially convex paths. The old logic also returns true if the paths that contain NaNs and Infinities. Return kUnknown_Convexity instead in those cases and in cases where the convexity logic computes intermediaries that overflow. Review URL: https://codereview.chromium.org/784593002
* Fix yet another convexicator issueGravatar robertphillips2014-11-17
| | | | | | | | | | | | | | | | This CL fixes the case where a bad initial vector (i.e., nearly zero) managed to short circuit all of the convexicator's logic. The initial bad vector would become the last vector and then never get displaced. The history of this is: https://codereview.chromium.org/298973004/ Switched the convexicator to not advance the last vector when the cross product wasn't significant https://codereview.chromium.org/573763002/ Fixed a bug (crbug.com/412640) wherein a zero area path was being incorrectly categorized as convex b.c. opposite but equal vectors were not signaling concavity. BUG=433683 Review URL: https://codereview.chromium.org/727283003
* Set temporary paths volatile so we don't cache them.Gravatar jvanverth2014-10-24
| | | | | | | | | | Any path that is generated frame-to-frame should not be rendered by using the DistanceFieldPathRenderer, because generating the initial distance field, uploading it and rendering it takes longer than the SoftwarePathRenderer. BUG=skia:2935 Review URL: https://codereview.chromium.org/677463002
* add float equivalent in dumpHex output as commentGravatar caryclark2014-10-23
| | | | | | R=reed@google.com,bsalomon@google.com Review URL: https://codereview.chromium.org/676803002
* Fix convexicator bugGravatar robertphillips2014-09-16
| | | | | | | | | BUG=crbug.com/412640 R=caryclark@google.com, bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/573763002
* add dumpHex() option to SkPathGravatar caryclark2014-09-15
| | | | | | | | | | | | | This provides exact precision to help debugging when the float representation of a SkScalar may introduce error. R=reed@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/571973003
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002