| OLD | NEW |
| 1 /* | 1 /* |
| 2 * CAUTION: EXPERIMENTAL CODE | 2 * CAUTION: EXPERIMENTAL CODE |
| 3 * | 3 * |
| 4 * This code is not to be used and will not be supported | 4 * This code is not to be used and will not be supported |
| 5 * if it fails on you. DO NOT USE! | 5 * if it fails on you. DO NOT USE! |
| 6 * | 6 * |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "SkPathUtils.h" | 9 #include "SkPathUtils.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 static void Line2path_pixelCircle(SkPath* path, const char* line, | 51 static void Line2path_pixelCircle(SkPath* path, const char* line, |
| 52 int lineIdx, int width) { | 52 int lineIdx, int width) { |
| 53 for (int i = 0; i < width; ++i) { | 53 for (int i = 0; i < width; ++i) { |
| 54 // simply makes every ON pixel into a circle path | 54 // simply makes every ON pixel into a circle path |
| 55 if (GetBit(line,i)) { | 55 if (GetBit(line,i)) { |
| 56 path->addCircle(i + SK_ScalarHalf, | 56 path->addCircle(i + SK_ScalarHalf, |
| 57 lineIdx + SK_ScalarHalf, | 57 lineIdx + SK_ScalarHalf, |
| 58 SkFloatToScalar(SQRT_2 / 2.0f)); | 58 SQRT_2 / 2.0f); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 */ | 62 */ |
| 63 | 63 |
| 64 static void Line2path_span(SkPath* path, const char* line, | 64 static void Line2path_span(SkPath* path, const char* line, |
| 65 int lineIdx, int width) { | 65 int lineIdx, int width) { |
| 66 bool inRun = 0; | 66 bool inRun = 0; |
| 67 int start = 1; | 67 int start = 1; |
| 68 | 68 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 } else if ( GetBit(line,w-1) ) { // if last pixel on add rect | 144 } else if ( GetBit(line,w-1) ) { // if last pixel on add rect |
| 145 // add the thing here | 145 // add the thing here |
| 146 region.op(SkIRect::MakeXYWH(w-1, y, 1, 1), | 146 region.op(SkIRect::MakeXYWH(w-1, y, 1, 1), |
| 147 SkRegion::kUnion_Op ); | 147 SkRegion::kUnion_Op ); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 // convert region to path | 150 // convert region to path |
| 151 region.getBoundaryPath(path); | 151 region.getBoundaryPath(path); |
| 152 } | 152 } |
| OLD | NEW |