| Index: src/core/SkRegion_path.cpp
|
| diff --git a/src/core/SkRegion_path.cpp b/src/core/SkRegion_path.cpp
|
| index 80149a383651f094f7394fcb028e8ba62abce242..0a5a40180989075bb2321d7a1e72c6328dc7116f 100644
|
| --- a/src/core/SkRegion_path.cpp
|
| +++ b/src/core/SkRegion_path.cpp
|
| @@ -216,25 +216,36 @@ void SkRgnBuilder::copyToRgn(SkRegion::RunType runs[]) const {
|
| *runs = SkRegion::kRunTypeSentinel;
|
| }
|
|
|
| -static int count_path_runtype_values(const SkPath& path, int* itop, int* ibot) {
|
| +static unsigned verb_to_initial_last_index(unsigned verb) {
|
| static const uint8_t gPathVerbToInitialLastIndex[] = {
|
| 0, // kMove_Verb
|
| 1, // kLine_Verb
|
| 2, // kQuad_Verb
|
| + 2, // kConic_Verb
|
| 3, // kCubic_Verb
|
| 0, // kClose_Verb
|
| 0 // kDone_Verb
|
| };
|
| + SkASSERT((unsigned)verb < SK_ARRAY_COUNT(gPathVerbToInitialLastIndex));
|
| + return gPathVerbToInitialLastIndex[verb];
|
| +}
|
|
|
| +static unsigned verb_to_max_edges(unsigned verb) {
|
| static const uint8_t gPathVerbToMaxEdges[] = {
|
| 0, // kMove_Verb
|
| 1, // kLine_Verb
|
| 2, // kQuad_VerbB
|
| + 2, // kConic_VerbB
|
| 3, // kCubic_Verb
|
| 0, // kClose_Verb
|
| 0 // kDone_Verb
|
| };
|
| + SkASSERT((unsigned)verb < SK_ARRAY_COUNT(gPathVerbToMaxEdges));
|
| + return gPathVerbToMaxEdges[verb];
|
| +}
|
|
|
| +
|
| +static int count_path_runtype_values(const SkPath& path, int* itop, int* ibot) {
|
| SkPath::Iter iter(path, true);
|
| SkPoint pts[4];
|
| SkPath::Verb verb;
|
| @@ -244,9 +255,9 @@ static int count_path_runtype_values(const SkPath& path, int* itop, int* ibot) {
|
| SkScalar bot = SkIntToScalar(SK_MinS16);
|
|
|
| while ((verb = iter.next(pts, false)) != SkPath::kDone_Verb) {
|
| - maxEdges += gPathVerbToMaxEdges[verb];
|
| + maxEdges += verb_to_max_edges(verb);
|
|
|
| - int lastIndex = gPathVerbToInitialLastIndex[verb];
|
| + int lastIndex = verb_to_initial_last_index(verb);
|
| if (lastIndex > 0) {
|
| for (int i = 1; i <= lastIndex; i++) {
|
| if (top > pts[i].fY) {
|
|
|