Merge "Issue #2956 remove unsafe glMultiDrawArrays(), undo previous change" into omaha_14.3.1

Former-commit-id: 4e1bc16d70 [formerly 478cedd3a3] [formerly 4e1bc16d70 [formerly 478cedd3a3] [formerly d4a138c534 [formerly f124cee1070a3dd0e09cb54f773f63095f18bd16]]]
Former-commit-id: d4a138c534
Former-commit-id: 160ce06137 [formerly 1b7dd13525]
Former-commit-id: 67eb0867ea
This commit is contained in:
Richard Peter 2014-05-02 09:50:40 -05:00 committed by Gerrit Code Review
commit 7481634fdb
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);