Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(887)

Issue 2243313002: Implement Conics in SkCurveMeasure (Closed)

Created:
4 years, 4 months ago by Harry Stern
Modified:
3 years, 11 months ago
Reviewers:
caryclark, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@cubic_fix
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Implement Conics in SkCurveMeasure BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2243313002

Patch Set 1 #

Total comments: 18

Patch Set 2 : Fix several things #

Patch Set 3 : Make some consts static const #

Patch Set 4 : Fix flipped sign in conic evalutaion, add comment explaining derivation #

Patch Set 5 : Add comment about fixed precision of quadrature used #

Total comments: 8

Patch Set 6 : Refactor coefficients and minor fixups #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -42 lines) Patch
M src/utils/SkCurveMeasure.h View 1 2 3 4 3 chunks +25 lines, -17 lines 0 comments Download
M src/utils/SkCurveMeasure.cpp View 1 2 3 4 5 6 chunks +99 lines, -25 lines 0 comments Download

Messages

Total messages: 27 (16 generated)
Harry Stern
4 years, 4 months ago (2016-08-15 16:50:12 UTC) #5
reed1
1. When/where do we set fConicW ? 2. Can you add a test or gm ...
4 years, 4 months ago (2016-08-15 17:55:49 UTC) #8
Harry Stern
On 2016/08/15 17:55:49, reed1 wrote: > 1. When/where do we set fConicW ? > 2. ...
4 years, 4 months ago (2016-08-15 18:01:12 UTC) #9
Harry Stern
https://codereview.chromium.org/2243313002/diff/1/src/utils/SkCurveMeasure.cpp File src/utils/SkCurveMeasure.cpp (right): https://codereview.chromium.org/2243313002/diff/1/src/utils/SkCurveMeasure.cpp#newcode154 src/utils/SkCurveMeasure.cpp:154: fConicW = pts[3].x(); fConicW gets set here
4 years, 4 months ago (2016-08-15 18:01:22 UTC) #10
caryclark
https://codereview.chromium.org/2243313002/diff/1/src/utils/SkCurveMeasure.cpp File src/utils/SkCurveMeasure.cpp (right): https://codereview.chromium.org/2243313002/diff/1/src/utils/SkCurveMeasure.cpp#newcode14 src/utils/SkCurveMeasure.cpp:14: #define UNIMPLEMENTED SkDEBUGF(("%s:%d unimplemented\n", __FILE__, __LINE__)) Make this an ...
4 years, 4 months ago (2016-08-15 19:13:04 UTC) #11
Harry Stern
https://codereview.chromium.org/2243313002/diff/1/src/utils/SkCurveMeasure.cpp File src/utils/SkCurveMeasure.cpp (right): https://codereview.chromium.org/2243313002/diff/1/src/utils/SkCurveMeasure.cpp#newcode14 src/utils/SkCurveMeasure.cpp:14: #define UNIMPLEMENTED SkDEBUGF(("%s:%d unimplemented\n", __FILE__, __LINE__)) On 2016/08/15 19:13:04, ...
4 years, 4 months ago (2016-08-15 20:55:17 UTC) #12
Harry Stern
https://codereview.chromium.org/2243313002/diff/1/src/utils/SkCurveMeasure.cpp File src/utils/SkCurveMeasure.cpp (right): https://codereview.chromium.org/2243313002/diff/1/src/utils/SkCurveMeasure.cpp#newcode90 src/utils/SkCurveMeasure.cpp:90: 8*w*w + ts*(4 - 8*w + 4*w*w)))) + 1; ...
4 years, 4 months ago (2016-08-17 02:48:47 UTC) #14
reed1
cary, is this good to go?
4 years, 4 months ago (2016-08-18 22:31:34 UTC) #20
caryclark
https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasure.cpp File src/utils/SkCurveMeasure.cpp (right): https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasure.cpp#newcode130 src/utils/SkCurveMeasure.cpp:130: + ts*(w484)))) + 1; More factoring is possible here, ...
4 years, 4 months ago (2016-08-19 11:48:30 UTC) #21
Harry Stern
https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasure.cpp File src/utils/SkCurveMeasure.cpp (right): https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasure.cpp#newcode130 src/utils/SkCurveMeasure.cpp:130: + ts*(w484)))) + 1; On 2016/08/19 11:48:29, caryclark wrote: ...
4 years, 4 months ago (2016-08-19 16:31:28 UTC) #22
HarryStern
4 years, 3 months ago (2016-09-01 18:21:04 UTC) #27
On 2016/08/19 at 16:31:28, hstern wrote:
>
https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasu...
> File src/utils/SkCurveMeasure.cpp (right):
> 
>
https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasu...
> src/utils/SkCurveMeasure.cpp:130: + ts*(w484)))) + 1;
> On 2016/08/19 11:48:29, caryclark wrote:
> > More factoring is possible here, e.g. -(-4 + 4*w) + w484
> 
> Oh clever, I didn't think of that. Done.
> 
>
https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasu...
> src/utils/SkCurveMeasure.cpp:205: fYCoeff[2] = Sk8f(-2*(Ay*w - By*w));
> On 2016/08/19 11:48:29, caryclark wrote:
> > Can come elements, e.g. -2*(Ax*w - Bx*w) be factored out here?
> 
> Sure. The only reason I didn't do it initially is because this is called at
construction, so it only happens once per segment of a path.
> 
> Done.
> 
>
https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasu...
> src/utils/SkCurveMeasure.cpp:223: lengths = lengths*(t*0.5f);
> On 2016/08/19 11:48:30, caryclark wrote:
> > Thanks for adding spaces around the 'weight * lengths' above. Can you add
spaces
> > everywhere on both sides of multiplies?
> 
> In a previous review mtklein basically said not to do so everywhere, though I
thought it was fine for the above two.
> 
> He gave the reasoning that multiplication binds tighter than addition,
essentially.
> 
> I really don't have a preference either way.
> 
>
https://codereview.chromium.org/2243313002/diff/100001/src/utils/SkCurveMeasu...
> src/utils/SkCurveMeasure.cpp:288: (SkScalarNearlyEqual(targetLength,
currentLength))) {
> On 2016/08/19 11:48:29, caryclark wrote:
> > parens unneeded
> > 
> > targetLength - some_epsilon >= currentLength
> 
> Per discussion we're going to leave it like it is.

ping/ptal

Powered by Google App Engine
This is Rietveld 408576698