(PathIterator pi, LineStroker lsink)
| 470 | |
| 471 | |
| 472 | private static void pathTo(PathIterator pi, LineStroker lsink) { |
| 473 | float coords[] = new float[6]; |
| 474 | while (!pi.isDone()) { |
| 475 | int color; |
| 476 | switch (pi.currentSegment(coords)) { |
| 477 | case SEG_MOVETO: |
| 478 | color = ((int)coords[2]<<24) | |
| 479 | ((int)coords[3]<<16) | |
| 480 | ((int)coords[4]<< 8) | |
| 481 | (int)coords[5]; |
| 482 | lsink.moveTo(FloatToS15_16(coords[0]), FloatToS15_16(coords[1]), color); |
| 483 | break; |
| 484 | case SEG_LINETO: |
| 485 | color = ((int)coords[2]<<24) | |
| 486 | ((int)coords[3]<<16) | |
| 487 | ((int)coords[4]<< 8) | |
| 488 | (int)coords[5]; |
| 489 | lsink.lineJoin(); |
| 490 | lsink.lineTo(FloatToS15_16(coords[0]), FloatToS15_16(coords[1]), color); |
| 491 | break; |
| 492 | case SEG_CLOSE: |
| 493 | lsink.lineJoin(); |
| 494 | lsink.close(); |
| 495 | break; |
| 496 | default: |
| 497 | throw new InternalError("unknown flattened segment type"); |
| 498 | } |
| 499 | pi.next(); |
| 500 | } |
| 501 | lsink.end(); |
| 502 | } |
| 503 | |
| 504 | |
| 505 | ///////////////////////////////////////////////////////////////////////////// |
no test coverage detected