aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathTest.cpp
Commit message (Collapse)AuthorAge
...
* Adding storage of SkPath::fIsOvalGravatar robertphillips@google.com2012-08-07
| | | | | | | | http://codereview.appspot.com/6453085/ git-svn-id: http://skia.googlecode.com/svn/trunk@4991 2bbb7eff-a529-9590-31e7-b0007b416f81
* check that copied paths have the same segment-masks as their srcGravatar reed@google.com2012-08-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4898 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
* Handle convex paths with degeneracies in cheap direction computationGravatar bsalomon@google.com2012-07-10
| | | | | | | | Review URL: http://codereview.appspot.com/6349085/ git-svn-id: http://skia.googlecode.com/svn/trunk@4515 2bbb7eff-a529-9590-31e7-b0007b416f81
* Really fix the build.Gravatar schenney@chromium.org2012-06-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4253 2bbb7eff-a529-9590-31e7-b0007b416f81
* Speculative build fix. Tests do not fail locally.Gravatar schenney@chromium.org2012-06-13
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4248 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix the problem of rendering closePath not properly after a moveTo call inGravatar schenney@chromium.org2012-06-13
| | | | | | | | | | | | | | | | | | | | canvas 2D interface. If there is a polyline, followed by a moveTo and a closePath, both the moveTo and the closePath should be ignored for the purposes of drawing, and the polyline should not be closed (unless force closed is true (for filling, for instance). Tested for path with both valid and degenerate content, when asked to consume degenerates and not, force closed and not. This patch also includes a uni test refactoring to reduce the amount of code to test path iteration and zero length paths. BUG=6297049 TEST=tests/PathTest.cpp, testIter method. Review URL: https://codereview.appspot.com/6300086 git-svn-id: http://skia.googlecode.com/svn/trunk@4247 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rename the existing flatten(void*) methods.Gravatar djsollen@google.com2012-06-08
| | | | | | | | This change avoids naminc confusion with the SkFlattenable flatten methods and also changes SkPath to use the void* model instead of taking a SkReader32. Review URL: https://codereview.appspot.com/6299062 git-svn-id: http://skia.googlecode.com/svn/trunk@4215 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkPath::getVerbs/countVerbsGravatar bsalomon@google.com2012-06-07
| | | | | | | Review URL: http://codereview.appspot.com/6306053/ git-svn-id: http://skia.googlecode.com/svn/trunk@4209 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warnings on Mac in testsGravatar caryclark@google.com2012-06-06
| | | | | | | | | | | | | | | | | | Fix these class of warnings: - unused functions - unused locals - sign mismatch - missing function prototypes - missing newline at end of file - 64 to 32 bit truncation The changes prefer to link in dead code in the debug build with 'if (false)' than to comment it out, but trivial cases are commented out or sometimes deleted if it appears to be a copy/paste error. Review URL: https://codereview.appspot.com/6301045 git-svn-id: http://skia.googlecode.com/svn/trunk@4175 2bbb7eff-a529-9590-31e7-b0007b416f81
* Windows compiler complaint cleanupGravatar robertphillips@google.com2012-05-31
| | | | | | | | http://codereview.appspot.com/6262047/ git-svn-id: http://skia.googlecode.com/svn/trunk@4098 2bbb7eff-a529-9590-31e7-b0007b416f81
* addPoly() entry-point, to quickly add MoveTo+N*LineTo (useful in dashing)Gravatar reed@google.com2012-05-29
| | | | | | Review URL: https://codereview.appspot.com/6256063 git-svn-id: http://skia.googlecode.com/svn/trunk@4061 2bbb7eff-a529-9590-31e7-b0007b416f81
* Detect when the caller was hairline AND strokeandfill, and resolve that into ↵Gravatar reed@google.com2012-05-29
| | | | | | | | | FILL This fixes the unittests on WIN in the trybot for DEPS roll 4048 Review URL: https://codereview.appspot.com/6242057 git-svn-id: http://skia.googlecode.com/svn/trunk@4057 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkPath::isLine(), similar to isRect()Gravatar reed@google.com2012-05-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3892 2bbb7eff-a529-9590-31e7-b0007b416f81
* Track oval in SkPathGravatar bsalomon@google.com2012-04-18
| | | | | | | | | | Committed on behalf of Guanqun.Lu@gmail.com Review URL:http://codereview.appspot.com/6012047/ git-svn-id: http://skia.googlecode.com/svn/trunk@3716 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r3705 for fixed pt failures. Gravatar bsalomon@google.com2012-04-17
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3706 2bbb7eff-a529-9590-31e7-b0007b416f81
* track oval in SkPathGravatar bsalomon@google.com2012-04-17
| | | | | | | | | | Committed on behalf of Guanqun.Lu@gmail.com Review URL: http://codereview.appspot.com/6012047/ git-svn-id: http://skia.googlecode.com/svn/trunk@3705 2bbb7eff-a529-9590-31e7-b0007b416f81
* misc fixesGravatar bsalomon@google.com2012-04-10
| | | | | | | | | | Submitted on behalf of Guanqun.Lu@gmail.com Review URL: http://codereview.appspot.com/5988070/ git-svn-id: http://skia.googlecode.com/svn/trunk@3640 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing Windows compiler complaintsGravatar robertphillips@google.com2012-04-06
| | | | | | | | http://codereview.appspot.com/5991056/ git-svn-id: http://skia.googlecode.com/svn/trunk@3626 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix line endings.Gravatar bsalomon@google.com2012-02-23
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3234 2bbb7eff-a529-9590-31e7-b0007b416f81
* Turn off test in fixed pt build.Gravatar bsalomon@google.com2012-02-17
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3217 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make cross_prod used in SkPath::cheapComputeDirection fallback to double ↵Gravatar bsalomon@google.com2012-02-17
| | | | | | computation when result is 0. Verbal LGTM from reed. git-svn-id: http://skia.googlecode.com/svn/trunk@3216 2bbb7eff-a529-9590-31e7-b0007b416f81
* add additional tests for path direction with multiple pts on y-maxGravatar reed@google.com2012-01-31
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3121 2bbb7eff-a529-9590-31e7-b0007b416f81
* use contour with global ymax to determine directionGravatar reed@google.com2012-01-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3110 2bbb7eff-a529-9590-31e7-b0007b416f81
* automatically inject a moveTo if we see a close followed by a line/quad/cubicGravatar reed@google.com2012-01-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3027 2bbb7eff-a529-9590-31e7-b0007b416f81
* reenable direction test, fix handling of degenerate segments in the ↵Gravatar reed@google.com2012-01-11
| | | | | | non-convex case git-svn-id: http://skia.googlecode.com/svn/trunk@3021 2bbb7eff-a529-9590-31e7-b0007b416f81
* disable test until I can fix itGravatar reed@google.com2012-01-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3018 2bbb7eff-a529-9590-31e7-b0007b416f81
* use SkIntToScalar(10) instead of 10 for parameters (for scalar==fixed)Gravatar reed@google.com2012-01-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3002 2bbb7eff-a529-9590-31e7-b0007b416f81
* add gm for reverseAddPathGravatar reed@google.com2012-01-10
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3001 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add the ability to iterate through a path without modification. This change isGravatar schenney@chromium.org2012-01-04
| | | | | | | | | | required by WebKit SVG in order to correctly draw markers and endcaps. BUG=415 TEST=TestPath in the unit tests Review URL: http://codereview.appspot.com/5505097 git-svn-id: http://skia.googlecode.com/svn/trunk@2962 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing PathTest. It was always broken in the convexity test code dueGravatar schenney@chromium.org2011-12-20
| | | | | | to a failure to correctly use SkScalar. git-svn-id: http://skia.googlecode.com/svn/trunk@2904 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing the build for FIXED tests. PathTest was incorrect using "1" instead ↵Gravatar schenney@chromium.org2011-12-20
| | | | | | of "SK_Scalar1". git-svn-id: http://skia.googlecode.com/svn/trunk@2902 2bbb7eff-a529-9590-31e7-b0007b416f81
* Modifying SkPath to store all verbs provided by the user, and to giveGravatar schenney@chromium.org2011-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | correct results for all stroke and fill modes even on the various types of degenerate paths. The goals of this patch include: 1. Have Skia store all of the verbs implied by path construction methods, even if those define degenerate paths. The SVG implementation in WebKit, which is backed by Skia, needs to know about all elements of the path, even degenerate ones, for the correct drawing of markers and line caps. For example, in SVG you should be able to draw a scatter plot by specifying a marker for vertices and then giving a sequence of moveTo commands. Skia will not store the moveTos, requiring a different storage mechanism. 2. Assuming 1, maintain the current Skia behavior. That is, make Skia robust to degenerate paths. 3. Fix an existing bug in Skia where a degenerate moveTo-lineTo pair spits out warnings from rasterization and produces incorrect results in inverse-fill renderings. 4. Adds extensive testing for degenerate paths and path rendering in general. To meet these goals, the patch I am proposing will result in minor additional storage for degenerate paths (a few bytes per degenerate path, only if the user defines such paths). There is also some additional overhead in the iteration code, with the path now cleaned to remove degenerate segments as part of the iteration process. I suspect this will also fix issues with computing normal vectors to degenerate segments. Benchmarking suggests that this change may result in slightly (< 1%) slower path drawing due to the checks for degeneracy. This overhead could be removed (in fact, a significant speedup could occur) if the results of iterating to clean up the path were cached. This would cost memory, of course, and quite a bit of it. BUG=398 TEST=tests/PathTest.cpp gm/cubicpaths.cpp gm/degeneratesegments.cpp gm/movepaths.cpp gm/linepaths.cpp gm/quadpaths.cpp Review URL: http://codereview.appspot.com/5482051 git-svn-id: http://skia.googlecode.com/svn/trunk@2901 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix autobounds dude to call a custom version of rect.join that doesn't ignoreGravatar reed@google.com2011-11-14
| | | | | | | | | empty rects (since path.bounds must be the bounds of its control-pts, including empty subcontours) git-svn-id: http://skia.googlecode.com/svn/trunk@2679 2bbb7eff-a529-9590-31e7-b0007b416f81
* add test for bounds (disabled as it fails)Gravatar reed@google.com2011-11-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2677 2bbb7eff-a529-9590-31e7-b0007b416f81
* add tests for flatten, unflatten and transformGravatar reed@google.com2011-09-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2303 2bbb7eff-a529-9590-31e7-b0007b416f81
* add segment types query to SkPath (i.e. does it have any quads)Gravatar reed@google.com2011-09-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2292 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkPoint::CanNormalize to unify decisions about when a vector is degenerateGravatar reed@google.com2011-09-07
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@2236 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix initialization of variables; eliminates warnings on Linux.Gravatar tomhudson@google.com2011-07-28
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1990 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
* Add functionality for isRect() to SkPath.Gravatar caryclark@google.com2011-07-26
| | | | | | | | | | | http://codereview.appspot.com/4807052/ M src/core/SkPath.cpp M tests/PathTest.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@1964 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix path iter returned pt on close, test path close pt in unit test.Gravatar bsalomon@google.com2011-07-13
| | | | | | | | Review URL: http://codereview.appspot.com/4715044/ git-svn-id: http://skia.googlecode.com/svn/trunk@1849 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix PathTest for SKIA_SCALAR=fixedGravatar epoger@google.com2011-05-18
| | | | | | | | http://codereview.appspot.com/4528083/ git-svn-id: http://skia.googlecode.com/svn/trunk@1371 2bbb7eff-a529-9590-31e7-b0007b416f81
* get tests closer to passing for SKIA_SCALAR=fixedGravatar epoger@google.com2011-05-17
| | | | | | | | http://codereview.appspot.com/4532064/ git-svn-id: http://skia.googlecode.com/svn/trunk@1351 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change getConvexity() to now compute it if the value is set to kUnkown.Gravatar reed@google.com2011-05-16
| | | | | | | | Change behavior for degenerate paths: now those return kConvex instead of kUnknown git-svn-id: http://skia.googlecode.com/svn/trunk@1330 2bbb7eff-a529-9590-31e7-b0007b416f81
* detect more than one loop in computeconvexityGravatar reed@google.com2011-05-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1326 2bbb7eff-a529-9590-31e7-b0007b416f81
* migrate more tests from GrPath.cppGravatar reed@google.com2011-05-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1325 2bbb7eff-a529-9590-31e7-b0007b416f81
* add Convexity enum to SkPathGravatar reed@google.com2011-05-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1324 2bbb7eff-a529-9590-31e7-b0007b416f81
* clear the convex-hint in reset() and rewind(), to match its state in a newlyGravatar reed@google.com2011-02-07
| | | | | | | | | | created path. todo: convexity perhaps should be tristate: yes, no, unknown git-svn-id: http://skia.googlecode.com/svn/trunk@768 2bbb7eff-a529-9590-31e7-b0007b416f81
* add Make to SkTSizeGravatar reed@android.com2010-02-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@497 2bbb7eff-a529-9590-31e7-b0007b416f81