109 * can be enabled by specifying the runtime flag: 110 * <pre> 111 * java -Dsun.java2d.renderer.trace=<any string> 112 * </pre> 113 * @return an instance of {@code RenderingEngine} 114 * @since 1.7 115 */ 116 public static synchronized RenderingEngine getInstance() { 117 if (reImpl != null) { 118 return reImpl; 119 } 120 121 /* Look first for an app-override renderer, 122 * if not specified or present, then look for marlin. 123 */ 124 GetPropertyAction gpa = 125 new GetPropertyAction("sun.java2d.renderer"); 126 String reClass = AccessController.doPrivileged(gpa); 127 if (reClass != null) { 128 try { 129 Class<?> cls = Class.forName(reClass); 130 reImpl = (RenderingEngine) cls.newInstance(); 131 } catch (ReflectiveOperationException ignored0) { 132 } 133 } 134 if (reImpl == null) { 135 final String marlinREClass = "sun.java2d.marlin.MarlinRenderingEngine"; 136 try { 137 Class<?> cls = Class.forName(marlinREClass); 138 reImpl = (RenderingEngine) cls.newInstance(); 139 } catch (ReflectiveOperationException ignored1) { 140 } 141 } 142 143 if (reImpl == null) { 144 throw new InternalError("No RenderingEngine module found"); 145 } 146 147 gpa = new GetPropertyAction("sun.java2d.renderer.verbose"); 148 String verbose = AccessController.doPrivileged(gpa); 149 if (verbose != null && verbose.startsWith("t")) { 150 System.out.println("RenderingEngine = "+reImpl); 151 } 152 153 gpa = new GetPropertyAction("sun.java2d.renderer.trace"); 154 String reTrace = AccessController.doPrivileged(gpa); 155 if (reTrace != null) { 156 reImpl = new Tracer(reImpl); 157 } 158 | 109 * can be enabled by specifying the runtime flag: 110 * <pre> 111 * java -Dsun.java2d.renderer.trace=<any string> 112 * </pre> 113 * @return an instance of {@code RenderingEngine} 114 * @since 1.7 115 */ 116 public static synchronized RenderingEngine getInstance() { 117 if (reImpl != null) { 118 return reImpl; 119 } 120 121 /* Look first for an app-override renderer, 122 * if not specified or present, then look for marlin. 123 */ 124 GetPropertyAction gpa = 125 new GetPropertyAction("sun.java2d.renderer"); 126 String reClass = AccessController.doPrivileged(gpa); 127 if (reClass != null) { 128 try { 129 @SuppressWarnings("deprecation") 130 Object tmp = Class.forName(reClass).newInstance(); 131 reImpl = (RenderingEngine) tmp; 132 } catch (ReflectiveOperationException ignored0) { 133 } 134 } 135 if (reImpl == null) { 136 final String marlinREClass = "sun.java2d.marlin.MarlinRenderingEngine"; 137 try { 138 @SuppressWarnings("deprecation") 139 Object tmp = Class.forName(marlinREClass).newInstance(); 140 reImpl = (RenderingEngine) tmp; 141 } catch (ReflectiveOperationException ignored1) { 142 } 143 } 144 145 if (reImpl == null) { 146 throw new InternalError("No RenderingEngine module found"); 147 } 148 149 gpa = new GetPropertyAction("sun.java2d.renderer.verbose"); 150 String verbose = AccessController.doPrivileged(gpa); 151 if (verbose != null && verbose.startsWith("t")) { 152 System.out.println("RenderingEngine = "+reImpl); 153 } 154 155 gpa = new GetPropertyAction("sun.java2d.renderer.trace"); 156 String reTrace = AccessController.doPrivileged(gpa); 157 if (reTrace != null) { 158 reImpl = new Tracer(reImpl); 159 } 160 |