src/java.desktop/share/classes/sun/java2d/pipe/RenderingEngine.java
Print this page
*** 94,106 ****
* <pre>
* java -Dsun.java2d.renderer=<classname>
* </pre>
*
* If no specific {@code RenderingEngine} is specified on the command
! * or Ductus renderer is specified, it will first attempt loading the
! * sun.dc.DuctusRenderingEngine class using Class.forName, if that
! * is not found, then it will look for Pisces.
* <p>
* Runtime tracing of the actions of the {@code RenderingEngine}
* can be enabled by specifying the runtime flag:
* <pre>
* java -Dsun.java2d.renderer.trace=<any string>
--- 94,111 ----
* <pre>
* java -Dsun.java2d.renderer=<classname>
* </pre>
*
* If no specific {@code RenderingEngine} is specified on the command
! * line or the requested class fails to load, then the Marlin
! * renderer will be used as the default.
! * <p>
! * A printout of which RenderingEngine is loaded and used can be
! * enabled by specifying the runtime flag:
! * <pre>
! * java -Dsun.java2d.renderer.verbose=true
! * </pre>
* <p>
* Runtime tracing of the actions of the {@code RenderingEngine}
* can be enabled by specifying the runtime flag:
* <pre>
* java -Dsun.java2d.renderer.trace=<any string>
*** 111,143 ****
public static synchronized RenderingEngine getInstance() {
if (reImpl != null) {
return reImpl;
}
! /* Look first for ductus or an app-override renderer,
! * if not specified or present, then look for pisces.
*/
- final String ductusREClass = "sun.dc.DuctusRenderingEngine";
- final String piscesREClass = "sun.java2d.pisces.PiscesRenderingEngine";
GetPropertyAction gpa =
! new GetPropertyAction("sun.java2d.renderer", ductusREClass);
String reClass = AccessController.doPrivileged(gpa);
try {
Class<?> cls = Class.forName(reClass);
reImpl = (RenderingEngine) cls.newInstance();
} catch (ReflectiveOperationException ignored0) {
try {
! Class<?> cls = Class.forName(piscesREClass);
reImpl = (RenderingEngine) cls.newInstance();
} catch (ReflectiveOperationException ignored1) {
}
}
if (reImpl == null) {
throw new InternalError("No RenderingEngine module found");
}
gpa = new GetPropertyAction("sun.java2d.renderer.trace");
String reTrace = AccessController.doPrivileged(gpa);
if (reTrace != null) {
reImpl = new Tracer(reImpl);
}
--- 116,157 ----
public static synchronized RenderingEngine getInstance() {
if (reImpl != null) {
return reImpl;
}
! /* Look first for an app-override renderer,
! * if not specified or present, then look for marlin.
*/
GetPropertyAction gpa =
! new GetPropertyAction("sun.java2d.renderer");
String reClass = AccessController.doPrivileged(gpa);
+ if (reClass != null) {
try {
Class<?> cls = Class.forName(reClass);
reImpl = (RenderingEngine) cls.newInstance();
} catch (ReflectiveOperationException ignored0) {
+ }
+ }
+ if (reImpl == null) {
+ final String marlinREClass = "sun.java2d.marlin.MarlinRenderingEngine";
try {
! Class<?> cls = Class.forName(marlinREClass);
reImpl = (RenderingEngine) cls.newInstance();
} catch (ReflectiveOperationException ignored1) {
}
}
if (reImpl == null) {
throw new InternalError("No RenderingEngine module found");
}
+ gpa = new GetPropertyAction("sun.java2d.renderer.verbose");
+ String verbose = AccessController.doPrivileged(gpa);
+ if (verbose != null && verbose.startsWith("t")) {
+ System.out.println("RenderingEngine = "+reImpl);
+ }
+
gpa = new GetPropertyAction("sun.java2d.renderer.trace");
String reTrace = AccessController.doPrivileged(gpa);
if (reTrace != null) {
reImpl = new Tracer(reImpl);
}