OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "PathOpsExtendedTest.h" | 8 #include "PathOpsExtendedTest.h" |
9 #include "PathOpsTestCommon.h" | 9 #include "PathOpsTestCommon.h" |
10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 path.addRect(2, 2, 3, 3, SkPath::kCW_Direction); | 143 path.addRect(2, 2, 3, 3, SkPath::kCW_Direction); |
144 pathB.setFillType(SkPath::kEvenOdd_FillType); | 144 pathB.setFillType(SkPath::kEvenOdd_FillType); |
145 pathB.addRect(3, 3, 4, 4, SkPath::kCW_Direction); | 145 pathB.addRect(3, 3, 4, 4, SkPath::kCW_Direction); |
146 pathB.addRect(3, 3, 4, 4, SkPath::kCW_Direction); | 146 pathB.addRect(3, 3, 4, 4, SkPath::kCW_Direction); |
147 SkOpBuilder builder; | 147 SkOpBuilder builder; |
148 builder.add(path, kUnion_SkPathOp); | 148 builder.add(path, kUnion_SkPathOp); |
149 builder.add(pathB, kDifference_SkPathOp); | 149 builder.add(pathB, kDifference_SkPathOp); |
150 SkPath result; | 150 SkPath result; |
151 builder.resolve(&result); | 151 builder.resolve(&result); |
152 } | 152 } |
| 153 |
| 154 DEF_TEST(Fuzz846, reporter) { |
| 155 /* |
| 156 <clipPath id="clip-circle"> |
| 157 <circle id="circle" cx="60" cy="60" r="50" /> |
| 158 </clipPath> |
| 159 <clipPath id="clip-rect"> |
| 160 <clipPath id="clip-rect"> |
| 161 <clipPath id="clip-rect"> |
| 162 <clipPath id="clip-rect"> |
| 163 <rect x="10" y="30" width="0" height="60" /> |
| 164 <rect x="10" y="30" width="0" height="60" /> |
| 165 <rect x="10" y="30" width="100" height="60" /> |
| 166 <rect x="10" y="30" width="32668" /> |
| 167 <rect x="10" y="30" width="100" height="18446744073709551615" /> |
| 168 <rect x="10" y="255" width="100" height="60" /> |
| 169 <rect width="100" height="60" /> |
| 170 <rect x="10" y="30" width="100" height="60" /> |
| 171 <rect x="10" y="30" width="100" height="4294967236" /> |
| 172 <rect x="10" y="30" width="100" height="60" /> |
| 173 </clipPath> |
| 174 <rect x="10" y="30" width="0" height="60" /> |
| 175 <rect x="10" y="30" width="0" height="0.18093252719929986369568203"
/> |
| 176 <rect x="10" y="30" width="100" height="60" /> |
| 177 <rect x="10" y="30" width="32668" height="60" /> |
| 178 <rect x="10" y="30" width="100" height="18446744073709551615" /> |
| 179 <rect x="10" y="255" width="100" height="60" /> |
| 180 <rect x="2147483649" y="30" width="100" height="60" /> |
| 181 <rect x="10" y="30" width="100" height="60" /> |
| 182 <rect x="10" y="30" width="100" height="60" /> |
| 183 <rect x="10" y="30" width="100" height="60" /> |
| 184 </clipPath> |
| 185 <rect x="10" y="30" width="0" height="60" /> |
| 186 <rect x="10" y="30" width="0" height="60" /> |
| 187 <rect x="10" y="30" width="100" height="60" /> |
| 188 <rect x="10" y="30" width="32668" height="60" /> |
| 189 <rect x="10" y="30" width="100" height="18446744073709551615" /> |
| 190 <rect x="10" y="255" width="100" height="60" /> |
| 191 <rect x="2147483649" y="30" width="100" height="60" /> |
| 192 <rect x="10" y="30" width="100" height="60" /> |
| 193 <rect x="10" y="2879753595" width="100" height="60" /> |
| 194 <rect x="10" y="30" width="100" height="60" /> |
| 195 </clipPath> |
| 196 <rect x="10" y="30" width="100" height="60" /> |
| 197 <rect x="10" y="30" width="0" height="60" /> |
| 198 <rect x="10" y="30" width="100" height="60" /> |
| 199 <rect x="10" y="30" width="32668" height="60" /> |
| 200 <rect x="10" y="30" width="100" height="18446744073709551615" /> |
| 201 <rect x="10" y="255" width="100" height="60" /> |
| 202 <rect x="2147483649" y="30" width="100" height="60" /> |
| 203 <rect x="10" y="30" width="100" height="60" /> |
| 204 <rect x="10" y="30" width="100" height="4294967236" /> |
| 205 <rect x="10" y="30" width="100" height="4294967236" /> |
| 206 <rect x="10" y="30" width="100" height="4294967236" /> |
| 207 <rect x="10" y="30" width="100" height="4294967236" /> |
| 208 <rect x="10" y="30" width="100" height="60" /> |
| 209 <rect x="757798030" y="30" width="100" height="60" /> |
| 210 */ |
| 211 SkPath clipCircle, clipRect; |
| 212 SkPath inner; |
| 213 clipCircle.addCircle(60, 60, 50); // <circle id="circle" cx="60"
cy="60" r="50" /> |
| 214 |
| 215 inner.addRect(10, 30, 10+0, 30+60); // <rect x="10" y="30" width="
0" height="60" /> |
| 216 inner.addRect(10, 30, 10+0, 30+60); // <rect x="10" y="30" width="
0" height="60" /> |
| 217 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 218 inner.addRect(10, 30, 10+32668, 30+0); // <rect x="10" y="30" width="
32668" /> |
| 219 inner.addRect(10, 30, 10+100, 30+18446744073709551615.f); // <rect x="10" y=
"30" width="100" height="18446744073709551615" /> |
| 220 inner.addRect(10, 255, 10+100, 255+60); // <rect x="10" y="255" width=
"100" height="60" /> |
| 221 inner.addRect(0, 0, 0+100, 0+60); // <rect width="100" height="
60" /> |
| 222 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 223 inner.addRect(10, 30, 10+100, 30+4294967236.f); // <rect x="10" y="30" width
="100" height="4294967236" /> |
| 224 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 225 clipRect.addPath(inner); |
| 226 inner.reset(); |
| 227 inner.addRect(10, 30, 10+0, 30+60); // <rect x="10" y="30" width="
0" height="60" /> |
| 228 inner.addRect(10, 30, 10+0, 30+0.18093252719929986369568203f); // <rect x="1
0" y="30" width="0" height="0.18093252719929986369568203" /> |
| 229 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 230 inner.addRect(10, 30, 10+32668, 30+60); // <rect x="10" y="30" width="
32668" height="60" /> |
| 231 inner.addRect(10, 30, 10+100, 30+18446744073709551615.f); // <rect x="10" y=
"30" width="100" height="18446744073709551615" /> |
| 232 inner.addRect(10, 255, 10+100, 255+60); // <rect x="10" y="255" width=
"100" height="60" /> |
| 233 inner.addRect(2147483649.f, 30, 2147483649.f+100, 30+60); // <rect x="214748
3649" y="30" width="100" height="60" /> |
| 234 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 235 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 236 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 237 clipRect.addPath(inner); |
| 238 inner.reset(); |
| 239 inner.addRect(10, 30, 10+0, 30+60); // <rect x="10" y="30" width="
0" height="60" /> |
| 240 inner.addRect(10, 30, 10+0, 30+60); // <rect x="10" y="30" width="
0" height="60" /> |
| 241 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 242 inner.addRect(10, 30, 10+32668, 30+60); // <rect x="10" y="30" width="
32668" height="60" /> |
| 243 inner.addRect(10, 30, 10+100, 30+18446744073709551615.f); // <rect x="10" y=
"30" width="100" height="18446744073709551615" /> |
| 244 inner.addRect(10, 255, 10+100, 255+60); // <rect x="10" y="255" width=
"100" height="60" /> |
| 245 inner.addRect(2147483649.f, 30, 2147483649.f+100, 30+60); // <rect x="214748
3649" y="30" width="100" height="60" /> |
| 246 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 247 inner.addRect(10, 2879753595.f, 10+100, 30+2879753595.f); // <rect x="10" y=
"2879753595" width="100" height="60" /> |
| 248 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 249 clipRect.addPath(inner); |
| 250 inner.reset(); |
| 251 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 252 inner.addRect(10, 30, 10+0, 30+60); // <rect x="10" y="30" width="
0" height="60" /> |
| 253 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 254 inner.addRect(10, 30, 10+32668, 30+60); // <rect x="10" y="30" width="
32668" height="60" /> |
| 255 inner.addRect(10, 30, 10+100, 30+18446744073709551615.f); // <rect x="10" y=
"30" width="100" height="18446744073709551615" /> |
| 256 inner.addRect(10, 255, 10+100, 255+60); // <rect x="10" y="255" width=
"100" height="60" /> |
| 257 inner.addRect(2147483649.f, 30, 2147483649.f+100, 30+60); // <rect x="214748
3649" y="30" width="100" height="60" /> |
| 258 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 259 inner.addRect(10, 30, 10+100, 30+4294967236.f); // <rect x="10" y="30" width
="100" height="4294967236" /> |
| 260 inner.addRect(10, 30, 10+100, 30+4294967236.f); // <rect x="10" y="30" width
="100" height="4294967236" /> |
| 261 inner.addRect(10, 30, 10+100, 30+4294967236.f); // <rect x="10" y="30" width
="100" height="4294967236" /> |
| 262 inner.addRect(10, 30, 10+100, 30+4294967236.f); // <rect x="10" y="30" width
="100" height="4294967236" /> |
| 263 inner.addRect(10, 30, 10+100, 30+60); // <rect x="10" y="30" width="
100" height="60" /> |
| 264 inner.addRect(757798030.f, 30, 757798030.f+100, 30+60); // <rect x="75779803
0" y="30" width="100" height="60" /> |
| 265 clipRect.addPath(inner); |
| 266 |
| 267 SkOpBuilder builder; |
| 268 builder.add(clipCircle, kUnion_SkPathOp); |
| 269 builder.add(clipRect, kDifference_SkPathOp); |
| 270 SkPath result; |
| 271 builder.resolve(&result); |
| 272 } |
| 273 |
OLD | NEW |