IDEA-97406 switch on scalable effects by default

It also fixes an issue with Retina on Mac (see JBHiDPIScaledImage)
This commit is contained in:
Sergey Malenkov
2016-09-06 16:50:50 +03:00
parent b1af9cb9ef
commit e3babadd95
2 changed files with 6 additions and 7 deletions
@@ -265,9 +265,7 @@ public enum EffectPainter implements RegionPainter<Paint> {
Long key = color.getRGB() ^ ((long)height << 32);
BufferedImage image = myCache.get(key);
if (image == null || UIUtil.isRetina(g) != (image instanceof JBHiDPIScaledImage)) {
int period = getPeriod(height);
image = UIUtil.createImageForGraphics(g, period << 8, height, BufferedImage.TYPE_INT_ARGB);
paintImage(image.createGraphics(), color, image.getWidth(), image.getHeight(), period);
image = createImage(g, color, height);
myCache.put(key, image);
}
return image;
@@ -275,8 +273,9 @@ public enum EffectPainter implements RegionPainter<Paint> {
BufferedImage createImage(Graphics2D g, Paint paint, int height) {
int period = getPeriod(height);
BufferedImage image = UIUtil.createImageForGraphics(g, period << 1, height, BufferedImage.TYPE_INT_ARGB);
paintImage(image.createGraphics(), paint, image.getWidth(), image.getHeight(), period);
int width = period << (paint instanceof Color ? 8 : 1);
BufferedImage image = UIUtil.createImageForGraphics(g, width, height, BufferedImage.TYPE_INT_ARGB);
paintImage(image.createGraphics(), paint, width, height, period);
return image;
}
@@ -780,9 +780,9 @@ cidr.xcode.derived.data.override.description=Ignore Xcode DerivedData location s
editor.rainbow.identifiers=false
editor.rainbow.identifiers.description=Rainbow identifiers in editor
ide.text.effect.new=false
ide.text.effect.new=true
ide.text.effect.new.description=Enables new effect painter for text
ide.text.effect.new.scale=false
ide.text.effect.new.scale=true
ide.text.effect.new.scale.description=Enables scalable effect painter for text
ide.intellij.laf.win10.ui=false