| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkView.h" | 9 #include "SkView.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 FINISHED: | 73 FINISHED: |
| 74 array = new SkIPoint[n]; | 74 array = new SkIPoint[n]; |
| 75 n = 0; | 75 n = 0; |
| 76 | 76 |
| 77 { | 77 { |
| 78 SkPath::Iter iter(path, false); | 78 SkPath::Iter iter(path, false); |
| 79 for (;;) | 79 for (;;) |
| 80 switch (iter.next(pts)) { | 80 switch (iter.next(pts)) { |
| 81 case SkPath::kMove_Verb: | 81 case SkPath::kMove_Verb: |
| 82 array[n++].set(SkScalarRound(pts[0].fX), SkScalarRound(pts[0].fY
)); | 82 array[n++].set(SkScalarRoundToInt(pts[0].fX), |
| 83 SkScalarRoundToInt(pts[0].fY)); |
| 83 break; | 84 break; |
| 84 case SkPath::kLine_Verb: | 85 case SkPath::kLine_Verb: |
| 85 array[n++].set(SkScalarRound(pts[1].fX), SkScalarRound(pts[1].fY
)); | 86 array[n++].set(SkScalarRoundToInt(pts[1].fX), |
| 87 SkScalarRoundToInt(pts[1].fY)); |
| 86 break; | 88 break; |
| 87 case SkPath::kDone_Verb: | 89 case SkPath::kDone_Verb: |
| 88 goto FINISHED2; | 90 goto FINISHED2; |
| 89 default: | 91 default: |
| 90 break; | 92 break; |
| 91 } | 93 } |
| 92 } | 94 } |
| 93 | 95 |
| 94 FINISHED2: | 96 FINISHED2: |
| 95 *count = n; | 97 *count = n; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 SkPath fPath; | 188 SkPath fPath; |
| 187 int fPtCount; | 189 int fPtCount; |
| 188 | 190 |
| 189 typedef SampleView INHERITED; | 191 typedef SampleView INHERITED; |
| 190 }; | 192 }; |
| 191 | 193 |
| 192 ////////////////////////////////////////////////////////////////////////////// | 194 ////////////////////////////////////////////////////////////////////////////// |
| 193 | 195 |
| 194 static SkView* MyFactory() { return new CullView; } | 196 static SkView* MyFactory() { return new CullView; } |
| 195 static SkViewRegister reg(MyFactory); | 197 static SkViewRegister reg(MyFactory); |
| OLD | NEW |