| 351 | } |
| 352 | |
| 353 | void Path::loadCommands(const CommandList& commands) { |
| 354 | startNewPath(); |
| 355 | for (const auto& command : commands) { |
| 356 | switch (command.type) { |
| 357 | case 'M': moveTo(command.end); break; |
| 358 | case 'L': lineTo(command.end); break; |
| 359 | case 'H': horizontalTo(command.end.x); break; |
| 360 | case 'V': verticalTo(command.end.y); break; |
| 361 | case 'Q': quadraticTo(command.control1, command.end); break; |
| 362 | case 'T': smoothQuadraticTo(command.end); break; |
| 363 | case 'C': bezierTo(command.control1, command.control2, command.end); break; |
| 364 | case 'S': smoothBezierTo(command.control1, command.end); break; |
| 365 | case 'A': |
| 366 | arcTo(command.control1.x, command.control1.y, command.control2.x, |
| 367 | command.flags & CommandList::kLargeArc, command.flags & CommandList::kSweep, command.end); |
| 368 | break; |
| 369 | case 'Z': close(); break; |
| 370 | default: VISAGE_ASSERT(false); break; |
| 371 | } |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | Path Path::combine(Path& other, FillRule fill_rule) const { |
| 376 | Path combined = *this; |
no outgoing calls
no test coverage detected