incorporate https://github.com/processing/processing/pull/5881 for FBO fix on Intel HD Graphics 3000 devices

This commit is contained in:
Ben Fry
2019-10-07 18:27:24 -04:00
parent 8f994389c4
commit 269f626f98
4 changed files with 37 additions and 6 deletions
+11
View File
@@ -165,6 +165,17 @@ public abstract class PGL {
protected boolean usingFrontTex = false;
protected boolean needSepFrontTex = false;
/**
* Defines if FBO Layer is allowed in the given environment.
* Using FBO can cause a fatal error during runtime for
* Intel HD Graphics 3000 chipsets (commonly used on older MacBooks)
* <a href="https://github.com/processing/processing/issues/4104">#4104</a>
* The value remains as 'true' unless set false during init.
* TODO There's already code in here to enable/disable the FBO properly,
* this should be making use of that mechanism instead. [fry 191007]
*/
protected boolean fboAllowed = true;
// ........................................................
// Texture rendering
@@ -36,6 +36,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
@@ -178,6 +179,22 @@ public class PSurfaceJOGL implements PSurface {
GraphicsConfiguration config = awtDisplayDevice.getDefaultConfiguration();
displayRect = config.getBounds();
/** See explanation at {@link PGL#fboAllowed} in PGL */
if (PApplet.platform == PConstants.MACOS) {
try {
Class<?> cglClass = Class.forName("sun.java2d.opengl.CGLGraphicsConfig");
Method cglMethod = cglClass.getMethod("getContextCapabilities");
Class<?> ctcClass = Class.forName("sun.java2d.pipe.hw.ContextCapabilities");
Method ctcMethod = ctcClass.getMethod("getAdapterId");
Object cglInstance = cglClass.cast(config);
Object ctcInstance = cglMethod.invoke(cglInstance);
Object idInstance = ctcMethod.invoke(ctcInstance);
if (String.valueOf(idInstance).contains("Intel HD Graphics 3000")) {
pgl.fboAllowed = false;
}
} catch (Exception e) { }
}
}
+8 -5
View File
@@ -1,4 +1,9 @@
0270 (3.5.4 or 3.6)
1270 (4.x alpha)
X check for disabling FBO code (fixes Intel HD 3000)
X https://github.com/processing/processing/issues/4104
X https://github.com/processing/processing/pull/5881
_ size() issues on Mojave? (3.4 works, 3.5.3 does not)
_ https://github.com/processing/processing/issues/5791
_ use exit event to set mouseY to 0 on macOS
@@ -11,12 +16,10 @@ _ simple rotateZ() fix
_ https://github.com/processing/processing/pull/5821
_ https://github.com/processing/processing/issues/5770
_ check for disabling FBO code (fixes Intel HD 3000)
_ https://github.com/processing/processing/issues/4104
_ https://github.com/processing/processing/pull/5881
high-ish
_ Update isAccessible() in Table to use JDK 11 reflection methods
_ https://github.com/processing/processing4/issues/3
_ add separator option to loadTable()
_ https://github.com/processing/processing/issues/5068
_ make setting the window icon automatic, based on files in local dirs
+1 -1
View File
@@ -1,4 +1,4 @@
0270 (4.x)
1270 (4.x alpha)
X use ctrl-page up/down for tabs on Windows
X https://github.com/processing/processing/issues/5794
X fix potential highlighting issue that wasn't selecting portions of text