From 6d79e2e3e5de43fdb4de0544beba2b01799bdf40 Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Wed, 25 Mar 2015 17:38:28 +0300 Subject: [PATCH] Remove moved to the custom jdk code. --- .../src/com/intellij/ide/ui/UISettings.java | 1 - .../openapi/editor/impl/EditorImpl.java | 2 - .../com/intellij/util/ui/GraphicsUtil.java | 2 - .../util/src/com/intellij/util/ui/UIUtil.java | 50 ------------------- 4 files changed, 55 deletions(-) diff --git a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java index 1d8166ffe8b0..048c186dc2b6 100644 --- a/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java +++ b/platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java @@ -291,7 +291,6 @@ public class UISettings extends SimpleModificationTracker implements PersistentS g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } } - UIUtil.setHintingForLCDText(g2d); } /** diff --git a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java index 8ab01eca0b71..0384012b6011 100644 --- a/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java @@ -3088,8 +3088,6 @@ public final class EditorImpl extends UserDataHolderBase implements EditorEx, Hi if (!Comparing.equal(color[i], currentColor)) { currentColor = color[i] != null ? color[i] : JBColor.black; - UIUtil.updateLCDContrastBasingOnForegroundColor(g, currentColor); - g.setColor(currentColor); } diff --git a/platform/util/src/com/intellij/util/ui/GraphicsUtil.java b/platform/util/src/com/intellij/util/ui/GraphicsUtil.java index 21b0aa6bffa1..da223902b78e 100644 --- a/platform/util/src/com/intellij/util/ui/GraphicsUtil.java +++ b/platform/util/src/com/intellij/util/ui/GraphicsUtil.java @@ -71,8 +71,6 @@ public class GraphicsUtil { g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, enableAA ? RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR : RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } - - UIUtil.setHintingForLCDText(g); } } diff --git a/platform/util/src/com/intellij/util/ui/UIUtil.java b/platform/util/src/com/intellij/util/ui/UIUtil.java index 75258ab3d519..631dbd2c7171 100644 --- a/platform/util/src/com/intellij/util/ui/UIUtil.java +++ b/platform/util/src/com/intellij/util/ui/UIUtil.java @@ -1771,56 +1771,6 @@ public class UIUtil { Map map = (Map)tk.getDesktopProperty("awt.font.desktophints"); if (map != null) { g2d.addRenderingHints(map); - setHintingForLCDText(g2d); - } - } - - private static int THEME_BASED_TEXT_LCD_CONTRAST = 0; - private static int BEST_DARK_LCD_CONTRAST = 250; - private static int BEST_LIGHT_LCD_CONTRAST = 100; - - public static int getContrastForColor (Color color) { - // YIQ - int yiqValue = ((color.getRed() * 299) + (color.getGreen() * 587) + (color.getBlue() * 114)) / 1000; - return yiqValue * 150/255 + 100; - } - - - public static void updateLCDContrastBasingOnForegroundColor(Graphics g, Color color) { - Graphics2D g2d = (Graphics2D)g; - - if (SystemInfo.isJetbrainsJvm && Registry.is("force.subpixel.hinting")) { - g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); - g2d.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, getContrastForColor(color)); - } - } - - public static void setHintingForLCDText(Graphics2D g2d) { - if (SystemInfo.isJetbrainsJvm && Registry.is("force.subpixel.hinting")) { - g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); - - // According to JavaDoc we can set values form 100 to 250 - // So we can use 0 as a special flag - int registryLcdContrastValue = Registry.intValue("lcd.contrast.value"); - if (registryLcdContrastValue == THEME_BASED_TEXT_LCD_CONTRAST) { - if (isUnderDarcula()) { - registryLcdContrastValue = BEST_DARK_LCD_CONTRAST; - } else { - registryLcdContrastValue = BEST_LIGHT_LCD_CONTRAST; - } - } - - // Wrong values prevent IDE from start - // So we have to be careful - if (registryLcdContrastValue < 100) { - LOG.warn("Wrong value of text LCD contrast " + registryLcdContrastValue); - registryLcdContrastValue = 100; - } else if (registryLcdContrastValue > 250) { - LOG.warn("Wrong value of text LCD contrast " + registryLcdContrastValue); - registryLcdContrastValue = 250; - } - - g2d.setRenderingHint(RenderingHints.KEY_TEXT_LCD_CONTRAST, registryLcdContrastValue); } }