MCPcopy Index your code
hub / github.com/benfry/processing4 / setFillImpl

Method setFillImpl

core/src/processing/opengl/PShapeOpenGL.java:1966–1997  ·  view source on GitHub ↗
(int fill)

Source from the content-addressed store, hash-verified

1964
1965
1966 protected void setFillImpl(int fill) {
1967 if (fillColor == fill) return;
1968 fillColor = fill;
1969
1970 if (image == null) {
1971 Arrays.fill(inGeo.colors, 0, inGeo.vertexCount,
1972 PGL.javaToNativeARGB(fillColor));
1973 if (shapeCreated && tessellated && hasPolys) {
1974 if (is3D()) {
1975 Arrays.fill(tessGeo.polyColors, firstPolyVertex, lastPolyVertex + 1,
1976 PGL.javaToNativeARGB(fillColor));
1977 root.setModifiedPolyColors(firstPolyVertex, lastPolyVertex);
1978 } else if (is2D()) {
1979 int last1 = lastPolyVertex + 1;
1980 if (-1 < firstLineVertex) last1 = firstLineVertex;
1981 if (-1 < firstPointVertex) last1 = firstPointVertex;
1982 Arrays.fill(tessGeo.polyColors, firstPolyVertex, last1,
1983 PGL.javaToNativeARGB(fillColor));
1984 root.setModifiedPolyColors(firstPolyVertex, last1 - 1);
1985 }
1986 }
1987 }
1988
1989 if (!setAmbient) {
1990 // Setting the ambient color from the current fill
1991 // is what the old P3D did and allows to have an
1992 // default ambient color when the user doesn't specify
1993 // it explicitly.
1994 setAmbientImpl(fill);
1995 setAmbient = false;
1996 }
1997 }
1998
1999
2000 @Override

Callers 1

setFillMethod · 0.95

Calls 6

javaToNativeARGBMethod · 0.95
setAmbientImplMethod · 0.95
setModifiedPolyColorsMethod · 0.80
fillMethod · 0.45
is3DMethod · 0.45
is2DMethod · 0.45

Tested by

no test coverage detected