Skip to content

Commit 2c6f2cf

Browse files
committed
remove dead code, remove danger, rename methods to avoid mix-ups
1 parent 2ba31c8 commit 2c6f2cf

5 files changed

Lines changed: 32 additions & 305 deletions

File tree

core/src/processing/core/PConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public interface PConstants {
6767
static final String OPENGL = P3D;
6868

6969
// Experimental, higher-performance Java 2D renderer (but no pixel ops)
70-
static final String E2D = PGraphicsDanger2D.class.getName();
70+
// static final String E2D = PGraphicsDanger2D.class.getName();
7171

7272
// Experimental JavaFX renderer; even better 2D performance
7373
static final String FX2D = PGraphicsFX2D.class.getName();

core/src/processing/core/PGraphicsDanger2D.java

Lines changed: 0 additions & 198 deletions
This file was deleted.

core/src/processing/core/PSurfaceAWT.java

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class PSurfaceAWT extends PSurfaceNone {
4949
Rectangle screenRect;
5050

5151
// 3.0a5 didn't use strategy, and active was shut off during init() w/ retina
52-
boolean useStrategy = true;
52+
// boolean useStrategy = true;
5353

5454
// Canvas canvas;
5555
Component canvas;
@@ -85,9 +85,9 @@ public PSurfaceAWT(PGraphics graphics) {
8585
// useStrategy = false;
8686
}
8787
canvas = new SmoothCanvas();
88-
if (useStrategy) {
89-
canvas.setIgnoreRepaint(true);
90-
}
88+
// if (useStrategy) {
89+
canvas.setIgnoreRepaint(true);
90+
// }
9191

9292
// Pass tab key to the sketch, rather than moving between components
9393
canvas.setFocusTraversalKeysEnabled(false);
@@ -191,22 +191,21 @@ public void update(Graphics g) {
191191
@Override
192192
public void paint(Graphics screen) {
193193
// System.out.println("painting");
194-
// validate();
195-
if (useStrategy) {
196-
render();
194+
// if (useStrategy) {
195+
render();
197196

198-
} else {
199-
// new Exception("painting").printStackTrace(System.out);
200-
// if (graphics.image != null) { // && !sketch.insideDraw) {
201-
if (onscreen != null) {
202-
// synchronized (graphics.image) {
203-
// Needs the width/height to be set so that retina images are properly scaled down
204-
// screen.drawImage(graphics.image, 0, 0, sketchWidth, sketchHeight, null);
205-
synchronized (offscreenLock) {
206-
screen.drawImage(onscreen, 0, 0, sketchWidth, sketchHeight, null);
207-
}
208-
}
209-
}
197+
// } else {
198+
//// new Exception("painting").printStackTrace(System.out);
199+
//// if (graphics.image != null) { // && !sketch.insideDraw) {
200+
// if (onscreen != null) {
201+
//// synchronized (graphics.image) {
202+
// // Needs the width/height to be set so that retina images are properly scaled down
203+
//// screen.drawImage(graphics.image, 0, 0, sketchWidth, sketchHeight, null);
204+
// synchronized (offscreenLock) {
205+
// screen.drawImage(onscreen, 0, 0, sketchWidth, sketchHeight, null);
206+
// }
207+
// }
208+
// }
210209
}
211210
}
212211

@@ -313,12 +312,12 @@ protected synchronized void render() {
313312
}
314313

315314

316-
Object offscreenLock = new Object();
317-
BufferedImage offscreen;
318-
BufferedImage onscreen;
319-
// Graphics off;
315+
// Object offscreenLock = new Object();
316+
// BufferedImage offscreen;
317+
// BufferedImage onscreen;
320318

321319

320+
/*
322321
protected void blit() {
323322
// Other folks that call render() (i.e. paint()) are already on the EDT.
324323
// We need to be using the EDT since we're messing with the Canvas
@@ -360,6 +359,7 @@ protected void blit() {
360359
}
361360
}
362361
}
362+
*/
363363

364364

365365
// what needs to happen here?
@@ -1372,9 +1372,10 @@ public void hideCursor() {
13721372
public Thread createThread() {
13731373
return new AnimationThread() {
13741374
@Override
1375-
public void render() {
1375+
public void callDraw() {
13761376
sketch.handleDraw();
1377-
blit();
1377+
//blit();
1378+
render();
13781379
}
13791380
};
13801381
}

core/src/processing/core/PSurfaceDanger.java

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)