Re: [OpenMap Users] xthreshold

From: Tore Halset <halset_at_pvv.ntnu.no>
Date: Fri, 2 Mar 2012 15:50:54 +0100

Hello.

By disabling the XTHRESHOLD stuff, I got in to a Java 2D hang as I render lots of images in parallelle.

        at sun.dc.pr.PathDasher.appendLine(Native Method)
        at sun.dc.pr.Rasterizer.appendLine(Rasterizer.java:462)
        at sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:495)
        at sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:97)
        at sun.java2d.pipe.DuctusShapeRenderer.draw(DuctusShapeRenderer.java:46)
        at sun.java2d.pipe.PixelToParallelogramConverter.draw(PixelToParallelogramConverter.java:130)
        at sun.java2d.SunGraphics2D.draw(SunGraphics2D.java:2618)

It looks like I still need to clip things that is far out of the view, but without changing the angle of lines. Here is the relevant part of GeoProj#forwardPoly.

        if (Environment.doingXWindowsWorkaround && (scale <= XSCALE_THRESHOLD)) {
            int i, j, size = stuff.size();
            float[] xpts, ypts;
            for (i = 0; i < size; i += 2) {
                xpts = stuff.get(i);
                ypts = stuff.get(i + 1);
                for (j = 0; j < xpts.length; j++) {
                    if (xpts[j] <= -XTHRESHOLD) {
                        xpts[j] = -XTHRESHOLD;
                    } else if (xpts[j] >= XTHRESHOLD) {
                        xpts[j] = XTHRESHOLD;
                    }
                    if (ypts[j] <= -XTHRESHOLD) {
                        ypts[j] = -XTHRESHOLD;
                    } else if (ypts[j] >= XTHRESHOLD) {
                        ypts[j] = XTHRESHOLD;
                    }
                }
                stuff.set(i, xpts);
                stuff.set(i + 1, ypts);
            }
        }

 - Tore.

On Mar 2, 2012, at 12:29 , Tore Halset wrote:

> Hello.
>
> I have a OMLine between two lat/lon points. When the user zoom very far in to a part of the line, the line suddenly changes its angle.
>
> The cause of this strange behaviour is in GeoProj#forwardPoly that adjust screen coordinates outside of XTHRESHOLD with value 16384.
>
> This is controlled by the Environment.doingXWindowsWorkaround parameter. For Linux and OS X, this seem to be code from svn revision 980 dating back to late 2003. Perhaps this could be removed now?
>
> Regards,
> Tore Halset.
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Mar 02 2012 - 09:53:13 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT