intellij 10.5 with xrender/JDK 1.7 enabled

Hi there,
Is there any way to enable xrender for intellij?
If I do -Dsun.java2d.xrender=True with java 1.7 the text in the editor is unreadable.

I want to use xrender as Intellij running over remote X (NX from nomachine) is a lot more responsive (like a loooot!!). Even though the text is garbled I can tell everyting else is a lot faster, as fast as eclipse over remote X.

There seems to be an issue with the SRC operator. I am wondering if JetBrain is considering a fix??

This would make the life of all Linux user so much nicer....

Thanks.

0
10 comments

Hi,

I had the same problem. After experimenting a bit with different JVM options, I've found that you can solve the rendering problem by appending:

-Dsun.java2d.opengl=True

to the JVM parameters.

Start from a console to see if OpenGL was really used on your system. The upper-case 'T' in true switches verbose output on.

Hope that helps,

- Артём

0

The suggested fix:
-Dsun.java2d.opengl=True
turns on another different rendering pipeline negating the xrender option completely.

It's like saying I fixed your problem by using
-Dsun.java2d.xrender=false


I too woul dlike to have proper xrender support for Intellij.  It's the only app I use which has this issue.  For example, netbeans works fine as iReport.  The author of the xrender support in JDK7 (clemens) has pointed out the issue and I believe a fix in the JVM might be in the works, but it would be much better if Intellij made the fix on their end too so that the users could be happy.   Intellij with remote displays and NX systems is unusable otherwise.

Note that
-Dsun.java2d.xrender=true
is expected to be the default in JDK8 so a fix would be nice especially now that weekly JDK8 builds are available.

0

I'll second this.  Please please please provide a workaround....

0

Hi there,
Yes the option with opengl is not correct. Besides opengl rendering DOES NOT work with NX as NX only supports an older version of GL.

I actually did chat with clemens and he pointed out the problem.
I took Intellij source code and hacked to Editor Code (com/intellij/openapi/editor/impl/EditorComponentImpl.java) and removed the antialiasing code. (See below how I did that).
Actually it worked and the editor renders. It gave me a taste of what speed I could get under NX where basically Intellij renders fast, as fast as any native Apps, including Eclipse!!
However, when xrender is enabled Intellij is not stable and ends up crashing a lot, I'm not sure of the cause. Furthermore, with my hack when using Intellij over NX it ends up crashing the NX client.

So two problems:
-Swing is doing some really odd things whith AntiAliasing that xrender does not like.
-NX seems to not quite like xrender for some things.

If anyone can help pinpoint the problem I would appreciate.

I basically commented out the AntiAliasing code in paintComponent of EditorComponentImpl:

@Override
  public void paintComponent(Graphics g) {
    ((ApplicationImpl)ApplicationManager.getApplication()).editorPaintStart();

    try {
 //    ((Graphics2D)g).setComposite(AlphaComposite.Src);

 //UISettings.setupAntialiasing(g);
      myEditor.paint(g);
    }
    finally {
      ((ApplicationImpl)ApplicationManager.getApplication()).editorPaintFinish();
    }
  }

0

It's my understanding that replacing the AlphaComposite.SRC with  .SRC_OVER is all that is needed.

Have you tried that?

0

No I haven't.
I will but I doubt that it will solve the satbilities issues.
Will report back when I get a chance to try...

0

I understand regarding stability and I also observed those issues.   I should note that I did have some luck running the display through an ssh channell.   Sounds silly I know but it made a big difference when attempting to use xrender...

It worked for a while and then core dumped the NX display process.    I don't know if this experience is local to Intellij or also impacts other Java apps.

0

Alan,
If you have a core dump for NX you should send it to NoMachine. I could not get one myself.
I'm pretty sure this is not entirely Intellij fault, rather the xrender pipeline.

0

Hi there,
I just tried replacing with SrcOver and yes it works. Intellij still crashes my NX client and on a non remote X it sometimes freeze/becomes unresponsive (using xrender pipeline).
I still cannot figure out what the issues are there.
Pierre

0

Hello,

that is very good news.  Perhaps this is something that can be passed along to an Intellij employee to incorporate/test.  At the very least perhaps a command line option can be added to select one option or another.

Have you tried using other applications with xrender?  I've used iReport often with xrender and hadn't had any issues that I can recall when working locally and over ssh tunnels.   I haven't tried it with NX.   I'm gueesing the quality of the frame buffer device driver must matter to some extent as well for xrender.

If I get some time I might try your experiment.

0

Please sign in to leave a comment.