()
| 3584 | |
| 3585 | |
| 3586 | protected void tessellate() { |
| 3587 | if (root == this && parent == null) { // Root shape |
| 3588 | boolean initAttr = false; |
| 3589 | if (polyAttribs == null) { |
| 3590 | polyAttribs = PGraphicsOpenGL.newAttributeMap(); |
| 3591 | initAttr = true; |
| 3592 | } |
| 3593 | |
| 3594 | if (tessGeo == null) { |
| 3595 | tessGeo = PGraphicsOpenGL.newTessGeometry(pg, polyAttribs, PGraphicsOpenGL.RETAINED, |
| 3596 | PGL.bufferStreamingRetained); |
| 3597 | } |
| 3598 | tessGeo.clear(); |
| 3599 | |
| 3600 | if (initAttr) { |
| 3601 | collectPolyAttribs(); |
| 3602 | } |
| 3603 | |
| 3604 | for (int i = 0; i < polyAttribs.size(); i++) { |
| 3605 | VertexAttribute attrib = polyAttribs.get(i); |
| 3606 | tessGeo.initAttrib(attrib); |
| 3607 | } |
| 3608 | |
| 3609 | tessellateImpl(); |
| 3610 | |
| 3611 | // Tessellated arrays are trimmed since they are expanded |
| 3612 | // by doubling their old size, which might lead to arrays |
| 3613 | // larger than the vertex counts. |
| 3614 | tessGeo.trim(); |
| 3615 | } |
| 3616 | } |
| 3617 | |
| 3618 | |
| 3619 | protected void collectPolyAttribs() { |
no test coverage detected