jdk/src/share/classes/sun/java2d/pipe/RenderingEngine.java
changeset 11080 7e18e343964e
parent 10087 e1bbe4597795
child 21278 ef8a3a2a72f2
equal deleted inserted replaced
11059:b5060eae3b32 11080:7e18e343964e
   115     public static synchronized RenderingEngine getInstance() {
   115     public static synchronized RenderingEngine getInstance() {
   116         if (reImpl != null) {
   116         if (reImpl != null) {
   117             return reImpl;
   117             return reImpl;
   118         }
   118         }
   119 
   119 
   120         reImpl = (RenderingEngine)
   120         reImpl =
   121             AccessController.doPrivileged(new PrivilegedAction() {
   121             AccessController.doPrivileged(new PrivilegedAction<RenderingEngine>() {
   122                 public Object run() {
   122                 public RenderingEngine run() {
   123                     final String ductusREClass = "sun.dc.DuctusRenderingEngine";
   123                     final String ductusREClass = "sun.dc.DuctusRenderingEngine";
   124                     String reClass =
   124                     String reClass =
   125                         System.getProperty("sun.java2d.renderer", ductusREClass);
   125                         System.getProperty("sun.java2d.renderer", ductusREClass);
   126                     if (reClass.equals(ductusREClass)) {
   126                     if (reClass.equals(ductusREClass)) {
   127                         try {
   127                         try {
   128                             Class cls = Class.forName(ductusREClass);
   128                             Class<?> cls = Class.forName(ductusREClass);
   129                             return cls.newInstance();
   129                             return (RenderingEngine) cls.newInstance();
   130                         } catch (ReflectiveOperationException ignored) {
   130                         } catch (ReflectiveOperationException ignored) {
   131                             // not found
   131                             // not found
   132                         }
   132                         }
   133                     }
   133                     }
   134 
   134 
   151             throw new InternalError("No RenderingEngine module found");
   151             throw new InternalError("No RenderingEngine module found");
   152         }
   152         }
   153 
   153 
   154         GetPropertyAction gpa =
   154         GetPropertyAction gpa =
   155             new GetPropertyAction("sun.java2d.renderer.trace");
   155             new GetPropertyAction("sun.java2d.renderer.trace");
   156         String reTrace = (String) AccessController.doPrivileged(gpa);
   156         String reTrace = AccessController.doPrivileged(gpa);
   157         if (reTrace != null) {
   157         if (reTrace != null) {
   158             reImpl = new Tracer(reImpl);
   158             reImpl = new Tracer(reImpl);
   159         }
   159         }
   160 
   160 
   161         return reImpl;
   161         return reImpl;