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

Side by Side Diff: src/utils/SkPathUtils.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/utils/SkCamera.cpp ('k') | src/utils/win/SkDWriteGeometrySink.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/utils/SkCamera.cpp ('k') | src/utils/win/SkDWriteGeometrySink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698