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

Issue 6815058: SkRoundRect start (Closed)

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

Description

This intended as a start for making round rects top level objects to enable future optimizations.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Added more tests & handled negative radii #

Total comments: 2

Patch Set 3 : removed use of memcmp for == check & now use kPoint instead of 2d array #

Patch Set 4 : Updated to use SkScalarsEqual #

Patch Set 5 : update #

Patch Set 6 : Made more like SkMatrix #

Patch Set 7 : Now with files #

Patch Set 8 : Added "path forward" comment #

Total comments: 7

Patch Set 9 : Addressed code review issues #

Patch Set 10 : altered API #

Total comments: 23

Patch Set 11 : Added Validate method & addressed other code review issues #

Total comments: 5

Patch Set 12 : Added comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+812 lines, -0 lines) Patch
M gyp/core.gypi View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M gyp/tests.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A include/core/SkRRect.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +215 lines, -0 lines 0 comments Download
A src/core/SkRRect.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +286 lines, -0 lines 0 comments Download
A tests/RoundRectTest.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +308 lines, -0 lines 0 comments Download

Messages

Total messages: 23
robertphillips
11 years, 8 months ago (2012-10-31 15:20:14 UTC) #1
bsalomon
Do you think we need a separate class for simple or should there be an ...
11 years, 8 months ago (2012-10-31 15:38:55 UTC) #2
robertphillips
I think we do want an SkSimpleRoundRect class. Most of the round rects from the ...
11 years, 8 months ago (2012-10-31 16:41:56 UTC) #3
bsalomon
LGTM but I defer to Mike https://codereview.appspot.com/6815058/diff/4001/include/core/SkRoundRect.h File include/core/SkRoundRect.h (right): https://codereview.appspot.com/6815058/diff/4001/include/core/SkRoundRect.h#newcode14 include/core/SkRoundRect.h:14: // Negative radii ...
11 years, 8 months ago (2012-10-31 18:03:53 UTC) #4
reed1
- can't use memcmp for equality w/ floats (negative zero for one) - can we ...
11 years, 8 months ago (2012-10-31 18:19:44 UTC) #5
robertphillips
https://codereview.appspot.com/6815058/diff/4001/include/core/SkRoundRect.h File include/core/SkRoundRect.h (right): https://codereview.appspot.com/6815058/diff/4001/include/core/SkRoundRect.h#newcode14 include/core/SkRoundRect.h:14: // Negative radii are treated as zeros We assert ...
11 years, 8 months ago (2012-10-31 18:34:25 UTC) #6
robertphillips
- can't use memcmp for equality w/ floats (negative zero for one) Done. Should I ...
11 years, 8 months ago (2012-10-31 19:40:49 UTC) #7
robertphillips
Updated to use SkScalarsEqual
11 years, 8 months ago (2012-11-01 13:34:58 UTC) #8
robertphillips
Mike - do you have any more input on this?
11 years, 7 months ago (2012-11-02 12:22:29 UTC) #9
robertphillips
PTAL - the SkRRect class has been updated to be more like SkMatrix than SkRect.
11 years, 7 months ago (2012-11-26 13:31:20 UTC) #10
reed1
1. Do we promis that we always "clean up" the input radii such that they ...
11 years, 7 months ago (2012-11-26 14:56:27 UTC) #11
reed1
We have started to move SkPath::isRect() to just return the boolean, but not the rect ...
11 years, 7 months ago (2012-11-26 14:57:17 UTC) #12
bsalomon
https://codereview.appspot.com/6815058/diff/18008/include/core/SkRRect.h File include/core/SkRRect.h (right): https://codereview.appspot.com/6815058/diff/18008/include/core/SkRRect.h#newcode183 include/core/SkRRect.h:183: On 2012/11/26 14:56:28, reed1 wrote: > Do we need ...
11 years, 7 months ago (2012-11-26 15:38:26 UTC) #13
robertphillips
> 1. Do we promise that we always "clean up" the input radii such that ...
11 years, 7 months ago (2012-11-26 18:07:44 UTC) #14
robertphillips
PTAL, this patch: removes non-const accessors adds setRect & setOval entry points converts from bit ...
11 years, 7 months ago (2012-11-28 15:38:53 UTC) #15
reed1
make sense to add a validate() debugging method? see SkPath and SkRegion if you're interested. ...
11 years, 7 months ago (2012-11-28 17:14:06 UTC) #16
robertphillips
Added Validate method & addressed other issues https://codereview.appspot.com/6815058/diff/28007/include/core/SkRRect.h File include/core/SkRRect.h (right): https://codereview.appspot.com/6815058/diff/28007/include/core/SkRRect.h#newcode55 include/core/SkRRect.h:55: */ On ...
11 years, 7 months ago (2012-11-28 20:59:02 UTC) #17
reed1
lgtm w/ not important nits. incorporate or not as you please. https://codereview.appspot.com/6815058/diff/20008/include/core/SkRRect.h File include/core/SkRRect.h (right): ...
11 years, 7 months ago (2012-11-28 22:09:59 UTC) #18
reed1
may want to add a (possibly private) method addRRectToPath. I know that should live in ...
11 years, 7 months ago (2012-11-28 22:11:28 UTC) #19
robertphillips
committed as r6595 https://codereview.appspot.com/6815058/diff/20008/include/core/SkRRect.h File include/core/SkRRect.h (right): https://codereview.appspot.com/6815058/diff/20008/include/core/SkRRect.h#newcode205 include/core/SkRRect.h:205: SkVector fRadii[4]; // Order is UL, ...
11 years, 7 months ago (2012-11-29 13:25:20 UTC) #20
tyler.r.w.abbott
On 2012/11/29 13:25:20, robertphillips wrote: > committed as r6595 > > https://codereview.appspot.com/6815058/diff/20008/include/core/SkRRect.h > File include/core/SkRRect.h ...
10 years, 4 months ago (2014-02-19 19:36:08 UTC) #21
reed1
On 2014/02/19 19:36:08, tyler.r.w.abbott wrote: > On 2012/11/29 13:25:20, robertphillips wrote: > > committed as ...
10 years, 4 months ago (2014-02-19 19:42:03 UTC) #22
tyler.r.w.abbott
10 years, 4 months ago (2014-02-19 20:27:10 UTC) #23
Message was sent while issue was closed.
On 2014/02/19 19:42:03, reed1 wrote:
> On 2014/02/19 19:36:08, tyler.r.w.abbott wrote:
> > On 2012/11/29 13:25:20, robertphillips wrote:
> > > committed as r6595
> > > 
> > > https://codereview.appspot.com/6815058/diff/20008/include/core/SkRRect.h
> > > File include/core/SkRRect.h (right):
> > > 
> > >
> >
>
https://codereview.appspot.com/6815058/diff/20008/include/core/SkRRect.h#newc...
> > > include/core/SkRRect.h:205: SkVector fRadii[4];     // Order is UL, UR,
LR,
> LL
> > > On 2012/11/28 22:09:59, reed1 wrote:
> > > > // use Corner enum to index into fRadii[]
> > > 
> > > Done.
> > > 
> > >
> >
>
https://codereview.appspot.com/6815058/diff/20008/include/core/SkRRect.h#newc...
> > > include/core/SkRRect.h:206: mutable Type fType;
> > > Added as TODO.
> > 
> > Why was it decided to set any empty fRect to a SkRect a XYWH of 0, 0, 0, 0?
> This
> > can greatly complicate code where it is perfectly valid to a SkRRect
represent
> a
> > point.
> 
> depends on how you interpret empty. If empty means zero area (width==0,
> height==0), but "valid", then 0,0,0,0 is a good (but not unique)
representation.
> This was the thinking at the time.

Thanks for the speedy response!

My particular use case involves insetting and outsetting a SkRRect and then
joining the corners in various ways. If the SkRRect is inset by its width then
it "moves" it to XY 0,0 by the `if (isEmpty()) setEmtpy()` convention of
SkRRect. This means the code needs to check for an empty SkRRect and do
completely different calculations to achieve sensible results. Is there any
chance that the behaviour could be changed or at least provide some mechanism to
create a SkRRect with zero width and height at a position other than 0,0?
Sign in to reply to this message.

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