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

Method flush

core/src/processing/opengl/PGraphicsOpenGL.java:2246–2323  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2244
2245
2246 @Override
2247 public void flush() {
2248 boolean hasPolys = 0 < tessGeo.polyVertexCount &&
2249 0 < tessGeo.polyIndexCount;
2250 boolean hasLines = 0 < tessGeo.lineVertexCount &&
2251 0 < tessGeo.lineIndexCount;
2252 boolean hasPoints = 0 < tessGeo.pointVertexCount &&
2253 0 < tessGeo.pointIndexCount;
2254
2255 boolean hasPixels = modified && pixels != null;
2256
2257 if (hasPixels) {
2258 // If the user has been manipulating individual pixels,
2259 // the changes need to be copied to the screen before
2260 // drawing any new geometry.
2261 flushPixels();
2262 }
2263
2264 if (hasPoints || hasLines || hasPolys) {
2265 PMatrix3D modelview0 = null;
2266 PMatrix3D modelviewInv0 = null;
2267 if (flushMode == FLUSH_WHEN_FULL) {
2268 // The modelview transformation has been applied already to the
2269 // tessellated vertices, so we set the OpenGL modelview matrix as
2270 // the identity to avoid applying the model transformations twice.
2271 // We save the modelview objects and temporarily use the identity
2272 // static matrix to avoid calling pushMatrix(), resetMatrix(),
2273 // popMatrix().
2274 modelview0 = modelview;
2275 modelviewInv0 = modelviewInv;
2276 modelview = modelviewInv = identity;
2277 projmodelview.set(projection);
2278 }
2279
2280 if (hasPolys && !isDepthSortingEnabled) {
2281 flushPolys();
2282 if (raw != null) {
2283 rawPolys();
2284 }
2285 }
2286
2287 if (is3D()) {
2288 if (hasLines) {
2289 flushLines();
2290 if (raw != null) {
2291 rawLines();
2292 }
2293 }
2294
2295 if (hasPoints) {
2296 flushPoints();
2297 if (raw != null) {
2298 rawPoints();
2299 }
2300 }
2301 }
2302
2303 if (hasPolys && isDepthSortingEnabled) {

Callers 15

saveImplMethod · 0.95
endDrawMethod · 0.95
beginPGLMethod · 0.95
hintMethod · 0.95
endShapeMethod · 0.95
textureWrapMethod · 0.95
clipImplMethod · 0.95
noClipMethod · 0.95
shapeMethod · 0.95
popProjectionMethod · 0.95
resetProjectionMethod · 0.95
applyProjectionMethod · 0.95

Calls 13

flushPixelsMethod · 0.95
flushPolysMethod · 0.95
rawPolysMethod · 0.95
flushLinesMethod · 0.95
rawLinesMethod · 0.95
flushPointsMethod · 0.95
rawPointsMethod · 0.95
flushSortedPolysMethod · 0.95
rawSortedPolysMethod · 0.95
updateProjmodelviewMethod · 0.95
setMethod · 0.65
is3DMethod · 0.45

Tested by

no test coverage detected