Issue #2956 remove unsafe glMultiDrawArrays(), undo previous change

Change-Id: I25bd1305568d26940b69565f53a06661955f240b

Former-commit-id: 137818d03a [formerly 137818d03a [formerly 6f8ef50f7cf8f245f749bf8ff9dbcc33a1d64d64]]
Former-commit-id: a73a310709
Former-commit-id: 84dbedcff5
This commit is contained in:
Nate Jensen 2014-05-01 16:20:35 -05:00
parent 472077fbd5
commit c7ddb6d476
2 changed files with 6 additions and 22 deletions

View file

@ -41,7 +41,6 @@ import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.geospatial.TransformFactory;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.drawables.IShape;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.core.gl.Activator;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.LineString;
@ -61,6 +60,7 @@ import com.vividsolutions.jts.geom.LineString;
* Apr 25, 2013 1954 bsteffen Speed up creation of
* GLColormapShadedShapes.
* Apr 15, 2014 2956 njensen Safety check of buffers before glMultiDrawArray
* May 01, 2014 2956 njensen Removed unsafe glMultiDrawArrays()
*
*
* </pre>
@ -318,8 +318,7 @@ public class GLShadedShapeBase implements IShape {
}
protected synchronized void paint(GL gl,
boolean cardSupportsHighEndFeatures, float brightness)
throws VizException {
boolean cardSupportsHighEndFeatures, float brightness) {
if (!polygons.isEmpty()) {
compile();
}
@ -357,23 +356,9 @@ public class GLShadedShapeBase implements IShape {
} else {
contourLengthBuffer.rewind();
contourStartBuffer.rewind();
if (cardSupportsHighEndFeatures) {
if (contourStartBuffer.capacity() > 0
&& contourLengthBuffer.capacity() > 0) {
gl.glMultiDrawArrays(GL.GL_POLYGON, contourStartBuffer,
contourLengthBuffer, contourLengthBuffer.capacity());
} else {
throw new VizException(
"Dangerous parameters passed to glMultiDrawArrays: contourStartBufferCapacity="
+ contourStartBuffer.capacity()
+ ", contourLengthBufferCapacity="
+ contourLengthBuffer.capacity());
}
} else {
while (contourLengthBuffer.hasRemaining()) {
gl.glDrawArrays(GL.GL_POLYGON, contourStartBuffer.get(),
contourLengthBuffer.get());
}
while (contourLengthBuffer.hasRemaining()) {
gl.glDrawArrays(GL.GL_POLYGON, contourStartBuffer.get(),
contourLengthBuffer.get());
}
}

View file

@ -144,7 +144,6 @@ import com.sun.opengl.util.j2d.TextRenderer;
* if changed
* Apr 04, 2014 2920 bsteffen Allow strings to use mulitple styles.
* Apr 08, 2014 2950 bsteffen Reduce oversized colormaps.
* Apr 15, 2014 2956 njensen Throw VizException from drawShadedShapesInternal
*
* </pre>
*
@ -837,7 +836,7 @@ public class GLTarget extends AbstractGraphicsTarget implements IGLTarget {
}
private void drawShadedShapesInternal(List<GLShadedShape> shapes,
float alpha, float brightness) throws VizException {
float alpha, float brightness) {
brightness = Math.max(brightness, 0.0f);
brightness = Math.min(brightness, 1.0f);