Skip to content

Commit d13e944

Browse files
committed
Sams July 2020 staging
1 parent 25738ff commit d13e944

File tree

12 files changed

+8714
-12338
lines changed

12 files changed

+8714
-12338
lines changed

src/main/java/processing/awt/PGraphicsJava2D.java

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.awt.geom.*;
3030
import java.awt.image.*;
3131
import java.util.Arrays;
32-
import java.util.HashMap;
3332
import java.util.Map;
3433

3534
import processing.core.*;
@@ -295,10 +294,10 @@ public PSurface createSurface() {
295294
* is going to return the {@link Graphics2D} object.
296295
* @return
297296
*/
298-
@Override
299-
public Image getImage() {
300-
return image;
301-
}
297+
// @Override
298+
// public Image getImage() {
299+
// return image;
300+
// }
302301

303302

304303
/** Returns the java.awt.Graphics2D object used by this renderer.
@@ -346,30 +345,30 @@ public Graphics2D checkImage() {
346345
// image = new BufferedImage(width * pixelFactor, height * pixelFactor
347346
// format == RGB ? BufferedImage.TYPE_INT_ARGB);
348347

349-
GraphicsConfiguration gc = null;
350-
if (surface != null) {
351-
Component comp = null; //surface.getComponent();
352-
if (comp == null) {
353-
// System.out.println("component null, but parent.frame is " + parent.frame);
354-
comp = parent.frame;
355-
}
356-
if (comp != null) {
357-
gc = comp.getGraphicsConfiguration();
358-
}
359-
}
360-
// If not realized (off-screen, i.e the Color Selector Tool), gc will be null.
361-
if (gc == null) {
362-
//System.err.println("GraphicsConfiguration null in initImage()");
363-
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
364-
gc = ge.getDefaultScreenDevice().getDefaultConfiguration();
365-
}
348+
// GraphicsConfiguration gc = null;
349+
// if (surface != null) {
350+
// Component comp = null; //surface.getComponent();
351+
// if (comp == null) {
352+
//// System.out.println("component null, but parent.frame is " + parent.frame);
353+
// comp = parent.frame;
354+
// }
355+
// if (comp != null) {
356+
// gc = comp.getGraphicsConfiguration();
357+
// }
358+
// }
359+
// // If not realized (off-screen, i.e the Color Selector Tool), gc will be null.
360+
// if (gc == null) {
361+
// //System.err.println("GraphicsConfiguration null in initImage()");
362+
// GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
363+
// gc = ge.getDefaultScreenDevice().getDefaultConfiguration();
364+
// }
366365

367366
// Formerly this was broken into separate versions based on offscreen or
368367
// not, but we may as well create a compatible image; it won't hurt, right?
369368
int wide = width * pixelDensity;
370369
int high = height * pixelDensity;
371370
// System.out.println("re-creating image");
372-
image = gc.createCompatibleImage(wide, high, Transparency.TRANSLUCENT);
371+
image = new BufferedImage(wide, high, BufferedImage.TYPE_INT_ARGB);
373372
// image = gc.createCompatibleVolatileImage(wide, high);
374373
//image = surface.getComponent().createImage(width, height);
375374
}

0 commit comments

Comments
 (0)