JBR-1986 Enabling fractional metrics causes visual artifacts in font rendering on macOS 10.14+

Disable subpixel positioning for macOS 10.13+ if legacy LCD rendering is disabled

(cherry picked from commit dbd24232e4)
(cherry picked from commit 9fbf990e83)
This commit is contained in:
Alexey Ushakov
2019-11-28 01:18:12 +03:00
committed by jbrbot
parent 7f4be96d42
commit f38df17114
4 changed files with 6 additions and 0 deletions

View File

@@ -39,6 +39,8 @@ extern int gNumberOfButtons;
// InputEvent mask array
extern jint* gButtonDownMasks;
extern int lcdSubPixelPosSupported;
extern int useFontSmoothing;
@interface AWTToolkit : NSObject { }

View File

@@ -52,6 +52,7 @@
int gNumberOfButtons;
jint* gButtonDownMasks;
int lcdSubPixelPosSupported;
int useFontSmoothing;
// Indicates that the app has been started with -XstartOnFirstThread

View File

@@ -230,6 +230,7 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
CFPreferencesGetAppBooleanValue(
CFSTR("CGFontRenderingFontSmoothingDisabled"),
kCFPreferencesCurrentApplication, &status);
lcdSubPixelPosSupported = YES;
useFontSmoothing = NO;
if (status) {
if (fontSmoothingDisabled) {
@@ -248,6 +249,7 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
if (!status) {
smoothFonts = YES;
}
lcdSubPixelPosSupported = !smoothFonts;
useFontSmoothing = smoothFonts;
if (!smoothFonts) {
J2dRlsTraceLn(J2D_TRACE_INFO,

View File

@@ -1171,6 +1171,7 @@ OGLTR_DrawColorGlyphNoCache(OGLContext *oglc, GlyphInfo *ginfo, jint x, jint y)
// Control subpixel positioning for macOS 13+ grayscale glyphs
#ifdef MACOSX
extern int lcdSubPixelPosSupported;
extern int useFontSmoothing;
#endif