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

Method render

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

Source from the content-addressed store, hash-verified

228
229
230 synchronized protected void render() {
231 if (canvas.isDisplayable() &&
232 graphics.image != null) {
233 if (canvas.getBufferStrategy() == null) {
234 canvas.createBufferStrategy(2);
235 }
236 BufferStrategy strategy = canvas.getBufferStrategy();
237 if (strategy != null) {
238 // Render single frame
239 do {
240 // The following loop ensures that the contents of the drawing buffer
241 // are consistent in case the underlying surface was recreated
242 do {
243 Graphics2D draw = (Graphics2D) strategy.getDrawGraphics();
244 // draw to width/height, since this may be a 2x image
245 draw.drawImage(graphics.image, 0, 0, sketchWidth, sketchHeight, null);
246 draw.dispose();
247 } while (strategy.contentsRestored());
248
249 // Display the buffer
250 strategy.show();
251
252 // Repeat the rendering if the drawing buffer was lost
253 } while (strategy.contentsLost());
254 }
255 }
256 }
257
258
259 @Override

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