--- old/modules/graphics/src/main/java/com/sun/prism/es2/ES2Context.java 2015-01-09 14:57:20.000000000 -0800 +++ new/modules/graphics/src/main/java/com/sun/prism/es2/ES2Context.java 2015-01-09 14:57:20.000000000 -0800 @@ -96,14 +96,6 @@ quadIndices = vb.genQuadsIndexBuffer(NUM_QUADS); setIndexBuffer(quadIndices); state = new State(); - - // JIRA: RT-21739 - // TODO: This is a temporary mechanism to work well with Glass on Mac due - // to the CALayer work. Need to be removed in the early future for 3.0 - if (PlatformUtil.isMac() || PlatformUtil.isIOS()) { - HashMap devDetails = (HashMap) ES2Pipeline.getInstance().getDeviceDetails(); - ES2Pipeline.glFactory.updateDeviceDetails(devDetails, glContext); - } } final void clearContext() { --- old/modules/graphics/src/main/java/com/sun/prism/es2/GLFactory.java 2015-01-09 14:57:21.000000000 -0800 +++ new/modules/graphics/src/main/java/com/sun/prism/es2/GLFactory.java 2015-01-09 14:57:21.000000000 -0800 @@ -224,14 +224,6 @@ abstract void updateDeviceDetails(HashMap deviceDetails); - // JIRA: RT-21739 - // TODO: This is a temporary mechanism to work well with Glass on Mac due - // to the CALayer work. Need to be removed in the early future for 3.0 - void updateDeviceDetails(HashMap deviceDetails, GLContext glContext) { - // NOP for all platforms except for Mac which will override it in its - // platform specific implementation code - } - void printDriverInformation(int adapter) { /* We are assuming a system with a single or homogeneous GPUs. */ System.out.println("Graphics Vendor: " + nGetGLVendor(nativeCtxInfo)); --- old/modules/graphics/src/main/java/com/sun/prism/es2/IOSGLFactory.java 2015-01-09 14:57:22.000000000 -0800 +++ new/modules/graphics/src/main/java/com/sun/prism/es2/IOSGLFactory.java 2015-01-09 14:57:22.000000000 -0800 @@ -58,7 +58,15 @@ @Override GLContext createGLContext(GLDrawable drawable, GLPixelFormat pixelFormat, GLContext shareCtx, boolean vSyncRequest) { - return new IOSGLContext(drawable, pixelFormat, shareCtx, vSyncRequest); + GLContext prismCtx = new IOSGLContext(drawable, pixelFormat, shareCtx, vSyncRequest); + + // JIRA: RT-21739 + // TODO: This is a temporary mechanism to work well with Glass on Mac due + // to the CALayer work. Need to be removed in the early future for 3.0 + HashMap devDetails = (HashMap) ES2Pipeline.getInstance().getDeviceDetails(); + updateDeviceDetails(devDetails, prismCtx); + + return prismCtx; } @Override @@ -122,8 +130,7 @@ // JIRA: RT-21739 // This is a temporary mechanism to work well with Glass on iOS due // to the CALayer work. Need to be removed in the early future for 3.0 - @Override - void updateDeviceDetails(HashMap deviceDetails, GLContext glContext) { + private void updateDeviceDetails(HashMap deviceDetails, GLContext glContext) { deviceDetails.put("contextPtr", glContext.getNativeHandle()); } } --- old/modules/graphics/src/main/java/com/sun/prism/es2/MacGLFactory.java 2015-01-09 14:57:22.000000000 -0800 +++ new/modules/graphics/src/main/java/com/sun/prism/es2/MacGLFactory.java 2015-01-09 14:57:22.000000000 -0800 @@ -63,7 +63,15 @@ @Override GLContext createGLContext(GLDrawable drawable, GLPixelFormat pixelFormat, GLContext shareCtx, boolean vSyncRequest) { - return new MacGLContext(drawable, pixelFormat, shareCtx, vSyncRequest); + GLContext prismCtx = new MacGLContext(drawable, pixelFormat, shareCtx, vSyncRequest); + + // JIRA: RT-21739 + // TODO: This is a temporary mechanism to work well with Glass on Mac due + // to the CALayer work. Need to be removed in the early future for 3.0 + HashMap devDetails = (HashMap) ES2Pipeline.getInstance().getDeviceDetails(); + updateDeviceDetails(devDetails, prismCtx); + + return prismCtx; } @Override @@ -125,8 +133,7 @@ // JIRA: RT-21739 // TODO: This is a temporary mechanism to work well with Glass on Mac due // to the CALayer work. Need to be removed in the early future for 3.0 - @Override - void updateDeviceDetails(HashMap deviceDetails, GLContext glContext) { + private void updateDeviceDetails(HashMap deviceDetails, GLContext glContext) { deviceDetails.put("contextPtr", glContext.getNativeHandle()); } }