()
| 2830 | |
| 2831 | |
| 2832 | protected void tessellate() { |
| 2833 | if (root == this && parent == null) { // Root shape |
| 2834 | boolean initAttr = false; |
| 2835 | if (polyAttribs == null) { |
| 2836 | polyAttribs = PGraphicsOpenGL.newAttributeMap(); |
| 2837 | initAttr = true; |
| 2838 | } |
| 2839 | |
| 2840 | if (tessGeo == null) { |
| 2841 | tessGeo = PGraphicsOpenGL.newTessGeometry(pg, polyAttribs, PGraphicsOpenGL.RETAINED); |
| 2842 | } |
| 2843 | tessGeo.clear(); |
| 2844 | |
| 2845 | if (initAttr) { |
| 2846 | collectPolyAttribs(); |
| 2847 | } |
| 2848 | |
| 2849 | for (int i = 0; i < polyAttribs.size(); i++) { |
| 2850 | VertexAttribute attrib = polyAttribs.get(i); |
| 2851 | tessGeo.initAttrib(attrib); |
| 2852 | } |
| 2853 | |
| 2854 | tessellateImpl(); |
| 2855 | |
| 2856 | // Tessellated arrays are trimmed since they are expanded |
| 2857 | // by doubling their old size, which might lead to arrays |
| 2858 | // larger than the vertex counts. |
| 2859 | tessGeo.trim(); |
| 2860 | } |
| 2861 | } |
| 2862 | |
| 2863 | |
| 2864 | protected void collectPolyAttribs() { |
no test coverage detected