< prev index next >
src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java
Print this page
*** 36,45 ****
--- 36,47 ----
import sun.java2d.SunGraphics2D;
import sun.java2d.SurfaceData;
import sun.lwawt.macosx.CPlatformView;
+ import static sun.java2d.opengl.OGLContext.OGLContextCaps.CAPS_EXT_LCD_SHADER;
+
public abstract class CGLSurfaceData extends OGLSurfaceData {
protected final int scale;
protected final int width;
protected final int height;
*** 340,349 ****
--- 342,363 ----
offscreenImage = image;
initSurface(this.width, this.height);
}
@Override
+ public boolean canRenderLCDText(SunGraphics2D sg2d) {
+ // relax the condition to render the lcd text
+ // by removal the transparency check, because
+ // we have to create translucent buffers due to
+ // shaped windows support on macosx.
+ return
+ getOGLGraphicsConfig().isCapPresent(CAPS_EXT_LCD_SHADER) &&
+ sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY &&
+ sg2d.paintState <= SunGraphics2D.PAINT_OPAQUECOLOR;
+ }
+
+ @Override
public SurfaceData getReplacement() {
return restoreContents(offscreenImage);
}
@Override
< prev index next >