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 "SkParse.h" | 8 #include "SkParse.h" |
9 #include "SkParsePath.h" | 9 #include "SkParsePath.h" |
10 | 10 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 for (;;) { | 79 for (;;) { |
80 data = skip_ws(data); | 80 data = skip_ws(data); |
81 if (data[0] == '\0') { | 81 if (data[0] == '\0') { |
82 break; | 82 break; |
83 } | 83 } |
84 char ch = data[0]; | 84 char ch = data[0]; |
85 if (is_digit(ch) || ch == '-' || ch == '+') { | 85 if (is_digit(ch) || ch == '-' || ch == '+') { |
86 if (op == '\0') { | 86 if (op == '\0') { |
87 return false; | 87 return false; |
88 } | 88 } |
| 89 } else if (is_sep(ch)) { |
| 90 data = skip_sep(data); |
89 } else { | 91 } else { |
90 op = ch; | 92 op = ch; |
91 relative = false; | 93 relative = false; |
92 if (is_lower(op)) { | 94 if (is_lower(op)) { |
93 op = (char) to_upper(op); | 95 op = (char) to_upper(op); |
94 relative = true; | 96 relative = true; |
95 } | 97 } |
96 data++; | 98 data++; |
97 data = skip_sep(data); | 99 data = skip_sep(data); |
98 } | 100 } |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 case SkPath::kClose_Verb: | 242 case SkPath::kClose_Verb: |
241 stream.write("Z", 1); | 243 stream.write("Z", 1); |
242 break; | 244 break; |
243 case SkPath::kDone_Verb: | 245 case SkPath::kDone_Verb: |
244 str->resize(stream.getOffset()); | 246 str->resize(stream.getOffset()); |
245 stream.copyTo(str->writable_str()); | 247 stream.copyTo(str->writable_str()); |
246 return; | 248 return; |
247 } | 249 } |
248 } | 250 } |
249 } | 251 } |
OLD | NEW |