MCPcopy Index your code
hub / github.com/processing/processing / render

Method render

core/src/processing/awt/PSurfaceAWT.java:284–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

282
283
284 synchronized protected void render() {
285 if (canvas.isDisplayable() &&
286 graphics.image != null) {
287 if (canvas.getBufferStrategy() == null) {
288 canvas.createBufferStrategy(2);
289 }
290 BufferStrategy strategy = canvas.getBufferStrategy();
291 if (strategy != null) {
292 // Render single frame
293// try {
294 do {
295 // The following loop ensures that the contents of the drawing buffer
296 // are consistent in case the underlying surface was recreated
297 do {
298 Graphics2D draw = (Graphics2D) strategy.getDrawGraphics();
299 // draw to width/height, since this may be a 2x image
300 draw.drawImage(graphics.image, 0, 0, sketchWidth, sketchHeight, null);
301 draw.dispose();
302 } while (strategy.contentsRestored());
303
304 // Display the buffer
305 strategy.show();
306
307 // Repeat the rendering if the drawing buffer was lost
308 } while (strategy.contentsLost());
309 }
310 }
311 }
312
313
314 /*

Callers 3

callDrawMethod · 0.95
validateMethod · 0.45
paintMethod · 0.45

Calls 2

disposeMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected