Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1485)

Issue 6875047: add function to compute path's interior

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by caryclark1
Modified:
11 years, 4 months ago
Reviewers:
robertphillips, reed1
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

add function to compute path's interior This works for nested rectangles and nested round rects. It also returns the interior of single rectangles and single round rects. It returns false for non-rectangular trapezoids. I ran this function against all paths in all checked-in skp files, and visually verified the output for many cases -- superficially, it looks good. I'll wait to see if this is what Mike wants before writing additional tests.

Patch Set 1 #

Patch Set 2 : #

Total comments: 15
Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -0 lines) Patch
M include/core/SkPath.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/core/SkPath.cpp View 1 1 chunk +195 lines, -0 lines 15 comments Download

Messages

Total messages: 6
caryclark1
11 years, 4 months ago (2012-12-03 20:58:15 UTC) #1
caryclark1
11 years, 4 months ago (2012-12-04 14:59:25 UTC) #2
reed1
API seems right to me. Can you write a gm or sample that shows a ...
11 years, 4 months ago (2012-12-04 15:55:13 UTC) #3
reed1
skia rev. 6668 adds a new gm: pathinterior.cpp, which has #if 0 around calling this ...
11 years, 4 months ago (2012-12-04 23:25:27 UTC) #4
robertphillips
LGTM + some suggestions. I do believe we will need substantial testing once we agree ...
11 years, 4 months ago (2012-12-11 16:46:30 UTC) #5
caryclark1
11 years, 4 months ago (2012-12-11 17:07:35 UTC) #6
https://codereview.appspot.com/6875047/diff/3001/src/core/SkPath.cpp
File src/core/SkPath.cpp (right):

https://codereview.appspot.com/6875047/diff/3001/src/core/SkPath.cpp#newcode456
src/core/SkPath.cpp:456: // Bounds, unlike Rect, does not consider a line or
point to be empty.
On 2012/12/11 16:46:30, robertphillips wrote:
> SkBounds?
Since this is local (and private) to SkPath.cpp, I didn't include the 'Sk',
following the convention set by 'Convexicator', further down.

https://codereview.appspot.com/6875047/diff/3001/src/core/SkPath.cpp#newcode462
src/core/SkPath.cpp:462: }
On 2012/12/11 16:46:30, robertphillips wrote:
> {}'s?

Not defending this, but I followed the pattern in SkRect::join and others here.

https://codereview.appspot.com/6875047/diff/3001/src/core/SkPath.cpp#newcode468
src/core/SkPath.cpp:468: 
On 2012/12/11 16:46:30, robertphillips wrote:
> isInside? contains?

Although SkRect doesn't have intersects, if it did, I assume it would be
analogous to this one :( . Not that this justifies the name choice.

https://codereview.appspot.com/6875047/diff/3001/src/core/SkPath.cpp#newcode479
src/core/SkPath.cpp:479: SkASSERT(!bounds.isEmpty());
On 2012/12/11 16:46:30, robertphillips wrote:
> if (!this->intersects(bounds))?

Yet another helper function could be added to do this, but since it's only in
this one place, adding it seems premature.

https://codereview.appspot.com/6875047/diff/3001/src/core/SkPath.cpp#newcode518
src/core/SkPath.cpp:518: // pair is either top/bottom or left/right
On 2012/12/11 16:46:30, robertphillips wrote:
> More documentation?

Agreed. Once we decide that this is worthwhile, I can write up more
documentation and unit tests.

https://codereview.appspot.com/6875047/diff/3001/src/core/SkPath.cpp#newcode551
src/core/SkPath.cpp:551: 
On 2012/12/11 16:46:30, robertphillips wrote:
> Doc algorithm?

Ditto.

https://codereview.appspot.com/6875047/diff/3001/src/core/SkPath.cpp#newcode596
src/core/SkPath.cpp:596: }
On 2012/12/11 16:46:30, robertphillips wrote:
> 9 or more edges?

A pair of nested rectangles can only have 8 horizontal + vertical segments. This
is will fail if, for instance, a rectangle side is made up of multiple adjacent
edges.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b