PolygonBucket: dont test bbox visibility with overzoom > 2

- workaround: seems there can be some overflow in GLMatrix.prj2d()
This commit is contained in:
Hannes Janetzek 2014-11-04 19:20:24 +01:00
parent 3178787954
commit c3ac8a412c

View File

@ -337,6 +337,7 @@ public final class PolygonBucket extends RenderBucket {
if (area.fadeScale > 0 && area.fadeScale > zoom) if (area.fadeScale > 0 && area.fadeScale > zoom)
continue; continue;
if (div > 0.5) {
/* project bbox of polygon to screen */ /* project bbox of polygon to screen */
v.mvp.prj2D(pb.bbox, 0, box, 0, 4); v.mvp.prj2D(pb.bbox, 0, box, 0, 4);
@ -351,24 +352,26 @@ public final class PolygonBucket extends RenderBucket {
} }
out |= o; out |= o;
} }
/* Check if any polygon-bucket edge intersects the screen. /* Check if any polygon-bucket edge intersects the screen.
* Also check the very unlikely case where the view might be * Also check the very unlikely case where the view might
* be
* completly contained within box */ * completly contained within box */
if ((out != 0) && (out != 0xF)) { if ((out != 0) && (out != 0xF)) {
mScreenClip.clipStart(box[0], box[1]); mScreenClip.clipStart(box[6], box[7]);
out = 0;
for (int i = 0; i < 8 && out == 0; i += 2)
out = mScreenClip.clipNext(box[i], box[i + 1]);
if (out == 0) {
//log.debug("out {}\n {}\n {}", out, Arrays.toString(pb.bbox), Arrays.toString(box));
if (mScreenClip.clipNext(box[2], box[3]) == 0 &&
mScreenClip.clipNext(box[4], box[5]) == 0 &&
mScreenClip.clipNext(box[6], box[7]) == 0 &&
mScreenClip.clipNext(box[0], box[1]) == 0) {
// log.debug("outside {} {} {}", out, // log.debug("outside {} {} {}", out,
// Arrays.toString(box), // Arrays.toString(box),
// Arrays.toString(pb.bbox)); // Arrays.toString(pb.bbox));
continue; continue;
} }
} }
}
if (mClear) { if (mClear) {
clearStencilRegion(); clearStencilRegion();
/* op for stencil method polygon drawing */ /* op for stencil method polygon drawing */