mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JRE-1028 fwport(9): JRE-1008 Do not use LCD shader on macOS 10.14+ in font rendering
Disable LCD text shader on macOS 10.14+ if LCD rendering is not explicitly specified (cherry picked from commitdffea9d701) (cherry picked from commit1628d6120e)
This commit is contained in:
@@ -53,3 +53,13 @@ extern jint* gButtonDownMasks;
|
||||
|
||||
/** Macro to cast a jlong to an Objective-C object (id). Casts to long on 32-bit systems to quiesce the compiler. */
|
||||
#define OBJC(jl) ((id)jlong_to_ptr(jl))
|
||||
|
||||
#ifndef kCFCoreFoundationVersionNumber10_13_Max
|
||||
#define kCFCoreFoundationVersionNumber10_13_Max 1499
|
||||
#endif
|
||||
|
||||
#ifndef IS_OSX_GT10_13
|
||||
#define IS_OSX_GT10_13 (floor(kCFCoreFoundationVersionNumber) > \
|
||||
kCFCoreFoundationVersionNumber10_13_Max)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -225,6 +225,24 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
|
||||
jint caps = CAPS_EMPTY;
|
||||
OGLContext_GetExtensionInfo(env, &caps);
|
||||
|
||||
Boolean status = false;
|
||||
Boolean fontSmoothingDisabled =
|
||||
CFPreferencesGetAppBooleanValue(
|
||||
CFSTR("CGFontRenderingFontSmoothingDisabled"),
|
||||
kCFPreferencesCurrentApplication, &status);
|
||||
|
||||
if (status) {
|
||||
if (fontSmoothingDisabled) {
|
||||
J2dRlsTraceLn(J2D_TRACE_INFO,
|
||||
"LCD_SHADER: disabled via macOS settings");
|
||||
caps &= ~CAPS_EXT_LCD_SHADER;
|
||||
}
|
||||
} else if (IS_OSX_GT10_13) {
|
||||
J2dRlsTraceLn(J2D_TRACE_INFO,
|
||||
"LCD_SHADER: disabled on macOS 10.14+ by default");
|
||||
caps &= ~CAPS_EXT_LCD_SHADER;
|
||||
}
|
||||
|
||||
GLint value = 0;
|
||||
[sharedPixelFormat
|
||||
getValues: &value
|
||||
|
||||
Reference in New Issue
Block a user