Code Monkey home page Code Monkey logo

Comments (20)

bourgesl avatar bourgesl commented on August 25, 2024

Thanks for your report, but it is very difficult to understand what is the problem ?

Moreover, I am not a Zulu expert, but I suppose it provides marlin 0.9.1.1...

Could you try latest Marlin renderer for Java 8 ?
https://github.com/bourgesl/marlin-renderer/releases/tag/v0_9_4_3

It includes latest know fixes so it could explain some difference with Zulu 8.x

Do you have some test code to reproduce the problem ?

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Latest Zulu8-44 includes Marlin renderer 0.9.1.1 (only).

Your problem may be related to the bug that is fixed in OpenJDK 11.0.5:
https://bugs.openjdk.java.net/browse/JDK-8226789

from marlin-renderer.

zjqzfyc avatar zjqzfyc commented on August 25, 2024

First thanks a lot for you quick reponse.

About my question, please see my attachment BugDetails.zip, there are three images in it. When dragging vernier, the chart will be refreshed, the "expect.jpg" is the expected result, the "overlay.jpg" is the issue that I met. "TestResult.jpg" shows my test results on different JDK and Render versions.

https://bugs.openjdk.java.net/browse/JDK-8226789 is a JavaFX issue, but the Zulu JDKs we use don't contain JavaFX. I tried with Zulu11.2.5 JavaFX version (OpenJDK 11.01) and it has the issue as JDK-8226789 described, but our application can work well on Zulu 11.2.5 JavaFX version.

I also tried with the latest Marlin renderer 0.9.4.3 and it doesn't fix the overlay issue.

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

I looked at your images but it did not help me guessing what is the concrete problem.
As it does not happen in zulu11, I expect it to be related to the different marlin releases in zulu 8 vs 11.

This is a java2d not javafx issue that's why I asked to test with marlin 0.9.4.3.

Did you set the jvm flags to enable it in your test ?
See https://github.com/bourgesl/marlin-renderer/wiki/How-to-use

What is the marlin version in your log (std out) ? It should be 0.9.4.3.

from marlin-renderer.

zjqzfyc avatar zjqzfyc commented on August 25, 2024

I tried both Zulu 8.30 + Marlin 0.9.4.1 and Zulu 8.30 + Marlin 0.9.4.3 and I am sure the new Marlin renderer is enabled, I saw the log printed like following. But it does not fix the overlay issue.
INFO: Marlin software rasterizer = ENABLED
INFO: Version = [marlin-X.Y.Z-Unsafe]

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Bad news, you found a problem. However it is impossible to me to guess what it is without any reproducer code or instructions.
If it works on Zulu 11, the problem may be related to other java2d bugs fixed in OpenJDK 9/10/11.
Is your application open-sourced or publicly available ? If I can run your code, it could help me diagnosing what's happening.

Finally could you run another test with the jvm arg "-Dsun.java2d.renderer.clip=false" to disable Marlin's internal path clipper ?

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Could you try recording your drawing using MapBench's ShapeDumpingGraphics2D ?
See https://github.com/bourgesl/mapbench/wiki/Recording-a-rendering-session-and-using-it-in-mapbench

from marlin-renderer.

zjqzfyc avatar zjqzfyc commented on August 25, 2024

The dump.zip file is the MapBench's drawing record when overlay occurs.

Share with you a new observation. Below code is from a class that extends from JPanel, in the paintComponent(Graphics) method, we create a chart buffer (double buffering) and update the chart buffer only when the chart is changed. When double buffering is enabled, the overlay occurs when the chart refreshed dozens of times.
overlay

But if I disable the double buffering, the overlay never occurs.
expect

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Probably there is a problem in your code: multi threading, jfreechart version ... or your panel buffer implementation is buggy ?

By default chart.draw uses background paint to clear the drawing area every time...
Are you sure your paint code is only called from EDT ?

Why not use jfreechart's ChartPanel ?
It always preserve clipping, g2d state and perform fill rect before draw():
https://github.com/jfree/jfreechart/blob/101f52257532673ef22944b7115455f689ed7a7c/src/main/java/org/jfree/chart/ChartPanel.java#L1384

Are you able to write a basic reproducer code ?
Or share your application code.

from marlin-renderer.

zjqzfyc avatar zjqzfyc commented on August 25, 2024
  1. I am sure the paint is from UI thread.
  2. Why not use jfreechart's ChartPanel is to workround a bug. But even I use jfreechart's ChartPanel, it also has overlay.
  3. The code link you showed me is jfreechart 1.5. But in jfreechart 0.9.9 that we use, it only perform fill rect in this.freeChart.drw(...) method. I just follow jfreechart 1.5 to fill rect before draw(), overly still occurs.
  4. I am unable to reproduce this issue with some basic code. And this issue is not reproduced after we migrate to jfreechart 1.5. // Note that this issue is not reproduced after migrating JDK to 11 or use Pisces render in any JDK versions.

After disabling the double buffering, this bug is not reproduced, so I still think this is probably a renderer or JDK bug in some certain conditions.

from marlin-renderer.

zjqzfyc avatar zjqzfyc commented on August 25, 2024

Unexpected drawing occurs on another chart. See the attached screenshot, the oblique lines are unexpected.
overlay2

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

This last one looks like the following bug, fixed in openjdk11. I do not know if it is fixed in zulu 11 or 8.

https://bugs.openjdk.java.net/browse/JDK-8228711
Try with latest marlin 0.9.4.3 or zulu11 to confirm.

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Once again, please test again your problems with the jvm arg "-Dsun.java2d.renderer.clip=false" to disable Marlin's internal path clipper ?
It will let us know if the problems are related to the clipper.
Probably as Pisces nor Ductus does not have any clipper.
It is a big & complicated code in the Marlin renderer that is not trivial to test in all possible cases, even if I made intensive automated tests.

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

FYI I am preparing a new repository marlin-chart that tests jfreechart 0.9.9 with a simple xy line chart...
It works well with a custom double-buffered panel with marlin 0.9.4.3, zulu 8-44 ... I use EDT to set the domain axis range to mimic scrolling over x-axis.
How do you make your thumbnail chart and set the axis range ?

Will push on github before tomorrow to let you try my test code and let you propose changes in order to reproduce your problem.

WorksForMe

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Maybe you could contact the azul zulu team ? Maybe send an email to report your problem to Andrew Brygin : abrygin at azul.com

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Here is the marlin-chart repository:
https://github.com/bourgesl/marlin-chart

Please try reproducing your problem here by hacking the test code...

PS: zulu 8.30 provides Marlin 0.7.4 (jdk9 version), but zulu 8.44 provides Marlin 0.9.1.1 (jdk13 version)

from marlin-renderer.

zjqzfyc avatar zjqzfyc commented on August 25, 2024

Great thanks for your warm help. I will try again to write a standalone application to reproduce this issue and then send application source code to you. This time I will extract all the chart framework code and delete other irrelevant feature code, it will be must eaiser to reproduce this issue.

Below are my answers for your question:

  1. Forget to reply you that I have tried -Dsun.java2d.renderer.clip=false and it doesn't work.
  2. I have contacted zulu team and they also want a standalone application.

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Good luck to track this bug and reproduce it.
How is my simple code using jfreechart ? Does it mimic your use case ?

Looking forward your test code...

Laurent

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Any progress / clue in your bug hunting ?

I checked Marlin state mostly kept dirty, cleanup in dispose()... looks good and safe.

Still no idea where I should look at ...

from marlin-renderer.

bourgesl avatar bourgesl commented on August 25, 2024

Do you have reproduced the problem ?
If not I will close this bug report.

Worksforme

from marlin-renderer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.