(Arrays.asList(skipChunkIds));
- String chunkidstr = ChunkHelper.toString(chunkid);
- boolean critical = ChunkHelper.isCritical(chunkidstr);
+ final String chunkidstr = ChunkHelper.toString(chunkid);
+ final boolean critical = ChunkHelper.isCritical(chunkidstr);
PngChunk pngChunk = null;
boolean skip = skipforced;
if (maxTotalBytesRead > 0 && clen + offset > maxTotalBytesRead)
@@ -379,7 +379,7 @@ public class PngReader {
// clen + 4) for risk of overflow
pngChunk = new PngChunkSkipped(chunkidstr, imgInfo, clen);
} else {
- ChunkRaw chunk = new ChunkRaw(clen, chunkid, true);
+ final ChunkRaw chunk = new ChunkRaw(clen, chunkid, true);
chunk.readChunkData(inputStream, crcEnabled || critical);
pngChunk = PngChunk.factory(chunk, imgInfo);
if (!pngChunk.crit)
@@ -398,7 +398,7 @@ public class PngReader {
*
* This happens rarely - most errors are fatal.
*/
- protected void logWarn(String warn) {
+ protected void logWarn(final String warn) {
System.err.println(warn);
}
@@ -415,7 +415,7 @@ public class PngReader {
* @param chunkLoadBehaviour
* {@link ChunkLoadBehaviour}
*/
- public void setChunkLoadBehaviour(ChunkLoadBehaviour chunkLoadBehaviour) {
+ public void setChunkLoadBehaviour(final ChunkLoadBehaviour chunkLoadBehaviour) {
this.chunkLoadBehaviour = chunkLoadBehaviour;
}
@@ -459,7 +459,7 @@ public class PngReader {
*
* @see #readRowInt(int) {@link #readRowByte(int)}
*/
- public ImageLine readRow(int nrow) {
+ public ImageLine readRow(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.INT, unpackedMode);
return imgLine.sampleType != SampleType.BYTE ? readRowInt(nrow) : readRowByte(nrow);
@@ -476,7 +476,7 @@ public class PngReader {
* @return ImageLine object, also available as field. Data is in
* {@link ImageLine#scanline} (int) field.
*/
- public ImageLine readRowInt(int nrow) {
+ public ImageLine readRowInt(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.INT, unpackedMode);
if (imgLine.getRown() == nrow) // already read
@@ -499,7 +499,7 @@ public class PngReader {
* @return ImageLine object, also available as field. Data is in
* {@link ImageLine#scanlineb} (byte) field.
*/
- public ImageLine readRowByte(int nrow) {
+ public ImageLine readRowByte(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.BYTE, unpackedMode);
if (imgLine.getRown() == nrow) // already read
@@ -513,7 +513,7 @@ public class PngReader {
/**
* @see #readRowInt(int[], int)
*/
- public final int[] readRow(int[] buffer, final int nrow) {
+ public final int[] readRow(final int[] buffer, final int nrow) {
return readRowInt(buffer, nrow);
}
@@ -596,11 +596,11 @@ public class PngReader {
* @deprecated Now {@link #readRow(int)} implements the same funcion. This
* method will be removed in future releases
*/
- public ImageLine getRow(int nrow) {
+ public ImageLine getRow(final int nrow) {
return readRow(nrow);
}
- private void decodeLastReadRowToInt(int[] buffer, int bytesRead) {
+ private void decodeLastReadRowToInt(final int[] buffer, final int bytesRead) {
if (imgInfo.bitDepth <= 8)
for (int i = 0, j = 1; i < bytesRead; i++)
buffer[i] = (rowb[j++] & 0xFF); // http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
@@ -611,7 +611,7 @@ public class PngReader {
ImageLine.unpackInplaceInt(imgInfo, buffer, buffer, false);
}
- private void decodeLastReadRowToByte(byte[] buffer, int bytesRead) {
+ private void decodeLastReadRowToByte(final byte[] buffer, final int bytesRead) {
if (imgInfo.bitDepth <= 8)
System.arraycopy(rowb, 1, buffer, 0, bytesRead);
else
@@ -644,27 +644,27 @@ public class PngReader {
* even/odd lines, etc
* @return Set of lines as a ImageLines, which wraps a matrix
*/
- public ImageLines readRowsInt(int rowOffset, int nRows, int rowStep) {
+ public ImageLines readRowsInt(final int rowOffset, int nRows, final int rowStep) {
if (nRows < 0)
nRows = (imgInfo.rows - rowOffset) / rowStep;
if (rowStep < 1 || rowOffset < 0 || nRows * rowStep + rowOffset > imgInfo.rows)
throw new PngjInputException("bad args");
- ImageLines imlines = new ImageLines(imgInfo, SampleType.INT, unpackedMode, rowOffset, nRows, rowStep);
+ final ImageLines imlines = new ImageLines(imgInfo, SampleType.INT, unpackedMode, rowOffset, nRows, rowStep);
if (!interlaced) {
for (int j = 0; j < imgInfo.rows; j++) {
- int bytesread = readRowRaw(j); // read and perhaps discards
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(j); // read and perhaps discards
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0)
decodeLastReadRowToInt(imlines.scanlines[mrow], bytesread);
}
} else { // and now, for something completely different (interlaced)
- int[] buf = new int[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
+ final int[] buf = new int[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
for (int p = 1; p <= 7; p++) {
deinterlacer.setPass(p);
for (int i = 0; i < deinterlacer.getRows(); i++) {
- int bytesread = readRowRaw(i);
- int j = deinterlacer.getCurrRowReal();
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(i);
+ final int j = deinterlacer.getCurrRowReal();
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0) {
decodeLastReadRowToInt(buf, bytesread);
deinterlacer.deinterlaceInt(buf, imlines.scanlines[mrow], !unpackedMode);
@@ -709,27 +709,27 @@ public class PngReader {
* even/odd lines, etc
* @return Set of lines as a matrix
*/
- public ImageLines readRowsByte(int rowOffset, int nRows, int rowStep) {
+ public ImageLines readRowsByte(final int rowOffset, int nRows, final int rowStep) {
if (nRows < 0)
nRows = (imgInfo.rows - rowOffset) / rowStep;
if (rowStep < 1 || rowOffset < 0 || nRows * rowStep + rowOffset > imgInfo.rows)
throw new PngjInputException("bad args");
- ImageLines imlines = new ImageLines(imgInfo, SampleType.BYTE, unpackedMode, rowOffset, nRows, rowStep);
+ final ImageLines imlines = new ImageLines(imgInfo, SampleType.BYTE, unpackedMode, rowOffset, nRows, rowStep);
if (!interlaced) {
for (int j = 0; j < imgInfo.rows; j++) {
- int bytesread = readRowRaw(j); // read and perhaps discards
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(j); // read and perhaps discards
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0)
decodeLastReadRowToByte(imlines.scanlinesb[mrow], bytesread);
}
} else { // and now, for something completely different (interlaced)
- byte[] buf = new byte[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
+ final byte[] buf = new byte[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
for (int p = 1; p <= 7; p++) {
deinterlacer.setPass(p);
for (int i = 0; i < deinterlacer.getRows(); i++) {
- int bytesread = readRowRaw(i);
- int j = deinterlacer.getCurrRowReal();
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(i);
+ final int j = deinterlacer.getCurrRowReal();
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0) {
decodeLastReadRowToByte(buf, bytesread);
deinterlacer.deinterlaceByte(buf, imlines.scanlinesb[mrow], !unpackedMode);
@@ -784,7 +784,7 @@ public class PngReader {
}
rowNum = nrow;
// swap buffers
- byte[] tmp = rowb;
+ final byte[] tmp = rowb;
rowb = rowbprev;
rowbprev = tmp;
// loads in rowbfilter "raw" bytes, with filter
@@ -821,7 +821,7 @@ public class PngReader {
do {
r = iIdatCstream.read(rowbfilter, 0, buffersLen);
} while (r >= 0);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjInputException("error in raw read of IDAT", e);
}
offset = iIdatCstream.getOffset();
@@ -838,7 +838,7 @@ public class PngReader {
* These are the bytes read (not loaded) in the input stream. If exceeded,
* an exception will be thrown.
*/
- public void setMaxTotalBytesRead(long maxTotalBytesToRead) {
+ public void setMaxTotalBytesRead(final long maxTotalBytesToRead) {
this.maxTotalBytesRead = maxTotalBytesToRead;
}
@@ -854,7 +854,7 @@ public class PngReader {
* default: 5Mb).
* If exceeded, some chunks will be skipped
*/
- public void setMaxBytesMetadata(int maxBytesChunksToLoad) {
+ public void setMaxBytesMetadata(final int maxBytesChunksToLoad) {
this.maxBytesMetadata = maxBytesChunksToLoad;
}
@@ -872,7 +872,7 @@ public class PngReader {
* checked) and the chunk will be saved as a PngChunkSkipped object. See
* also setSkipChunkIds
*/
- public void setSkipChunkMaxSize(int skipChunksBySize) {
+ public void setSkipChunkMaxSize(final int skipChunksBySize) {
this.skipChunkMaxSize = skipChunksBySize;
}
@@ -888,7 +888,7 @@ public class PngReader {
* These chunks will be skipped (the CRC will not be checked) and the chunk
* will be saved as a PngChunkSkipped object. See also setSkipChunkMaxSize
*/
- public void setSkipChunkIds(String[] skipChunksById) {
+ public void setSkipChunkIds(final String[] skipChunksById) {
this.skipChunkIds = skipChunksById == null ? new String[] {} : skipChunksById;
}
@@ -904,7 +904,7 @@ public class PngReader {
*
* default=true
*/
- public void setShouldCloseStream(boolean shouldCloseStream) {
+ public void setShouldCloseStream(final boolean shouldCloseStream) {
this.shouldCloseStream = shouldCloseStream;
}
@@ -936,7 +936,7 @@ public class PngReader {
*
* @param unPackedMode
*/
- public void setUnpackedMode(boolean unPackedMode) {
+ public void setUnpackedMode(final boolean unPackedMode) {
this.unpackedMode = unPackedMode;
}
@@ -954,7 +954,7 @@ public class PngReader {
*
* @param other A PngReader that has already finished reading pixels. Can be null.
*/
- public void reuseBuffersFrom(PngReader other) {
+ public void reuseBuffersFrom(final PngReader other) {
if(other==null) return;
if (other.currentChunkGroup < ChunksList.CHUNK_GROUP_5_AFTERIDAT)
throw new PngjInputException("PngReader to be reused have not yet ended reading pixels");
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
index 2f475aab1..ed5dd7d69 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
@@ -64,7 +64,7 @@ public class PngWriter {
*/
private int deflaterStrategy = Deflater.FILTERED;
- private int[] histox = new int[256]; // auxiliar buffer, only used by reportResultsForFilter
+ private final int[] histox = new int[256]; // auxiliar buffer, only used by reportResultsForFilter
private int idatMaxSize = 0; // 0=use default (PngIDatChunkOutputStream 32768)
@@ -78,7 +78,7 @@ public class PngWriter {
// this only influences the 1-2-4 bitdepth format - and if we pass a ImageLine to writeRow, this is ignored
private boolean unpackedMode = false;
- public PngWriter(OutputStream outputStream, ImageInfo imgInfo) {
+ public PngWriter(final OutputStream outputStream, final ImageInfo imgInfo) {
this(outputStream, imgInfo, "[NO FILENAME AVAILABLE]");
}
@@ -96,7 +96,7 @@ public class PngWriter {
* @param filenameOrDescription
* Optional, just for error/debug messages
*/
- public PngWriter(OutputStream outputStream, ImageInfo imgInfo, String filenameOrDescription) {
+ public PngWriter(final OutputStream outputStream, final ImageInfo imgInfo, final String filenameOrDescription) {
this.filename = filenameOrDescription == null ? "" : filenameOrDescription;
this.os = outputStream;
this.imgInfo = imgInfo;
@@ -111,29 +111,29 @@ public class PngWriter {
private void init() {
datStream = new PngIDatChunkOutputStream(this.os, idatMaxSize);
- Deflater def = new Deflater(compLevel);
+ final Deflater def = new Deflater(compLevel);
def.setStrategy(deflaterStrategy);
datStreamDeflated = new DeflaterOutputStream(datStream, def);
writeSignatureAndIHDR();
writeFirstChunks();
}
- private void reportResultsForFilter(int rown, FilterType type, boolean tentative) {
+ private void reportResultsForFilter(final int rown, final FilterType type, final boolean tentative) {
Arrays.fill(histox, 0);
int s = 0, v;
for (int i = 1; i <= imgInfo.bytesPerRow; i++) {
v = rowbfilter[i];
if (v < 0)
- s -= (int) v;
+ s -= v;
else
- s += (int) v;
+ s += v;
histox[v & 0xFF]++;
}
filterStrat.fillResultsForFilter(rown, type, s, histox, tentative);
}
private void writeEndChunk() {
- PngChunkIEND c = new PngChunkIEND(imgInfo);
+ final PngChunkIEND c = new PngChunkIEND(imgInfo);
c.createRawChunk().writeChunk(os);
}
@@ -156,7 +156,7 @@ public class PngWriter {
currentChunkGroup = ChunksList.CHUNK_GROUP_5_AFTERIDAT;
chunksList.writeChunks(os, currentChunkGroup);
// should not be unwriten chunks
- List pending = chunksList.getQueuedChunks();
+ final List pending = chunksList.getQueuedChunks();
if (!pending.isEmpty())
throw new PngjOutputException(pending.size() + " chunks were not written! Eg: " + pending.get(0).toString());
currentChunkGroup = ChunksList.CHUNK_GROUP_6_END;
@@ -169,7 +169,7 @@ public class PngWriter {
currentChunkGroup = ChunksList.CHUNK_GROUP_0_IDHR;
PngHelperInternal.writeBytes(os, PngHelperInternal.getPngIdSignature()); // signature
- PngChunkIHDR ihdr = new PngChunkIHDR(imgInfo);
+ final PngChunkIHDR ihdr = new PngChunkIHDR(imgInfo);
// http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html
ihdr.setCols(imgInfo.cols);
ihdr.setRows(imgInfo.rows);
@@ -189,16 +189,16 @@ public class PngWriter {
}
- protected void encodeRowFromByte(byte[] row) {
+ protected void encodeRowFromByte(final byte[] row) {
if (row.length == imgInfo.samplesPerRowPacked) {
// some duplication of code - because this case is typical and it works faster this way
int j = 1;
if (imgInfo.bitDepth <= 8) {
- for (byte x : row) { // optimized
+ for (final byte x : row) { // optimized
rowb[j++] = x;
}
} else { // 16 bitspc
- for (byte x : row) { // optimized
+ for (final byte x : row) { // optimized
rowb[j] = x;
j += 2;
}
@@ -221,17 +221,17 @@ public class PngWriter {
}
}
- protected void encodeRowFromInt(int[] row) {
+ protected void encodeRowFromInt(final int[] row) {
// http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
if (row.length == imgInfo.samplesPerRowPacked) {
// some duplication of code - because this case is typical and it works faster this way
int j = 1;
if (imgInfo.bitDepth <= 8) {
- for (int x : row) { // optimized
+ for (final int x : row) { // optimized
rowb[j++] = (byte) x;
}
} else { // 16 bitspc
- for (int x : row) { // optimized
+ for (final int x : row) { // optimized
rowb[j++] = (byte) (x >> 8);
rowb[j++] = (byte) (x);
}
@@ -253,7 +253,7 @@ public class PngWriter {
}
}
- private void filterRow(int rown) {
+ private void filterRow(final int rown) {
// warning: filters operation rely on: "previos row" (rowbprev) is
// initialized to 0 the first time
if (filterStrat.shouldTestAll(rown)) {
@@ -268,7 +268,7 @@ public class PngWriter {
filterRowPaeth();
reportResultsForFilter(rown, FilterType.FILTER_PAETH, true);
}
- FilterType filterType = filterStrat.gimmeFilterType(rown, true);
+ final FilterType filterType = filterStrat.gimmeFilterType(rown, true);
rowbfilter[0] = (byte) filterType.val;
switch (filterType) {
case FILTER_NONE:
@@ -292,23 +292,23 @@ public class PngWriter {
reportResultsForFilter(rown, filterType, false);
}
- private void prepareEncodeRow(int rown) {
+ private void prepareEncodeRow(final int rown) {
if (datStream == null)
init();
rowNum++;
if (rown >= 0 && rowNum != rown)
throw new PngjOutputException("rows must be written in order: expected:" + rowNum + " passed:" + rown);
// swap
- byte[] tmp = rowb;
+ final byte[] tmp = rowb;
rowb = rowbprev;
rowbprev = tmp;
}
- private void filterAndSend(int rown) {
+ private void filterAndSend(final int rown) {
filterRow(rown);
try {
datStreamDeflated.write(rowbfilter, 0, imgInfo.bytesPerRow + 1);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
@@ -323,7 +323,7 @@ public class PngWriter {
protected void filterRowNone() {
for (int i = 1; i <= imgInfo.bytesPerRow; i++) {
- rowbfilter[i] = (byte) rowb[i];
+ rowbfilter[i] = rowb[i];
}
}
@@ -341,7 +341,7 @@ public class PngWriter {
protected void filterRowSub() {
int i, j;
for (i = 1; i <= imgInfo.bytesPixel; i++)
- rowbfilter[i] = (byte) rowb[i];
+ rowbfilter[i] = rowb[i];
for (j = 1, i = imgInfo.bytesPixel + 1; i <= imgInfo.bytesPerRow; i++, j++) {
// !!! rowbfilter[i] = (byte) (rowb[i] - rowb[j]);
rowbfilter[i] = (byte) PngHelperInternal.filterRowSub(rowb[i], rowb[j]);
@@ -359,9 +359,9 @@ public class PngWriter {
int s = 0;
for (int i = 1; i <= imgInfo.bytesPerRow; i++)
if (rowbfilter[i] < 0)
- s -= (int) rowbfilter[i];
+ s -= rowbfilter[i];
else
- s += (int) rowbfilter[i];
+ s += rowbfilter[i];
return s;
}
@@ -372,12 +372,12 @@ public class PngWriter {
*
* TODO: this should be more customizable
*/
- private void copyChunks(PngReader reader, int copy_mask, boolean onlyAfterIdat) {
- boolean idatDone = currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT;
+ private void copyChunks(final PngReader reader, final int copy_mask, final boolean onlyAfterIdat) {
+ final boolean idatDone = currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT;
if (onlyAfterIdat && reader.getCurrentChunkGroup() < ChunksList.CHUNK_GROUP_6_END)
throw new PngjExceptionInternal("tried to copy last chunks but reader has not ended");
- for (PngChunk chunk : reader.getChunksList().getChunks()) {
- int group = chunk.getChunkGroup();
+ for (final PngChunk chunk : reader.getChunksList().getChunks()) {
+ final int group = chunk.getChunkGroup();
if (group < ChunksList.CHUNK_GROUP_4_IDAT && idatDone)
continue;
boolean copy = false;
@@ -389,8 +389,8 @@ public class PngWriter {
copy = true;
}
} else { // ancillary
- boolean text = (chunk instanceof PngChunkTextVar);
- boolean safe = chunk.safe;
+ final boolean text = (chunk instanceof PngChunkTextVar);
+ final boolean safe = chunk.safe;
// notice that these if are not exclusive
if (ChunkHelper.maskMatch(copy_mask, ChunkCopyBehaviour.COPY_ALL))
copy = true;
@@ -429,7 +429,7 @@ public class PngWriter {
* : Mask bit (OR), see ChunksToWrite.COPY_XXX
* constants
*/
- public void copyChunksFirst(PngReader reader, int copy_mask) {
+ public void copyChunksFirst(final PngReader reader, final int copy_mask) {
copyChunks(reader, copy_mask, false);
}
@@ -446,7 +446,7 @@ public class PngWriter {
* : Mask bit (OR), see ChunksToWrite.COPY_XXX
* constants
*/
- public void copyChunksLast(PngReader reader, int copy_mask) {
+ public void copyChunksLast(final PngReader reader, final int copy_mask) {
copyChunks(reader, copy_mask, true);
}
@@ -461,8 +461,8 @@ public class PngWriter {
public double computeCompressionRatio() {
if (currentChunkGroup < ChunksList.CHUNK_GROUP_6_END)
throw new PngjOutputException("must be called after end()");
- double compressed = (double) datStream.getCountFlushed();
- double raw = (imgInfo.bytesPerRow + 1) * imgInfo.rows;
+ final double compressed = datStream.getCountFlushed();
+ final double raw = (imgInfo.bytesPerRow + 1) * imgInfo.rows;
return compressed / raw;
}
@@ -480,7 +480,7 @@ public class PngWriter {
writeEndChunk();
if (shouldCloseStream)
os.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
@@ -516,7 +516,7 @@ public class PngWriter {
* @param compLevel
* between 0 and 9 (default:6 , recommended: 6 or more)
*/
- public void setCompLevel(int compLevel) {
+ public void setCompLevel(final int compLevel) {
if (compLevel < 0 || compLevel > 9)
throw new PngjOutputException("Compression level invalid (" + compLevel + ") Must be 0..9");
this.compLevel = compLevel;
@@ -534,7 +534,7 @@ public class PngWriter {
* PngFilterType
) Recommended values: DEFAULT
* (default) or AGGRESIVE
*/
- public void setFilterType(FilterType filterType) {
+ public void setFilterType(final FilterType filterType) {
filterStrat = new FilterWriteStrategy(imgInfo, filterType);
}
@@ -546,7 +546,7 @@ public class PngWriter {
* @param idatMaxSize
* default=0 : use defaultSize (32K)
*/
- public void setIdatMaxSize(int idatMaxSize) {
+ public void setIdatMaxSize(final int idatMaxSize) {
this.idatMaxSize = idatMaxSize;
}
@@ -555,7 +555,7 @@ public class PngWriter {
*
* default=true
*/
- public void setShouldCloseStream(boolean shouldCloseStream) {
+ public void setShouldCloseStream(final boolean shouldCloseStream) {
this.shouldCloseStream = shouldCloseStream;
}
@@ -565,7 +565,7 @@ public class PngWriter {
*
* Default: Deflater.FILTERED . This should be changed very rarely.
*/
- public void setDeflaterStrategy(int deflaterStrategy) {
+ public void setDeflaterStrategy(final int deflaterStrategy) {
this.deflaterStrategy = deflaterStrategy;
}
@@ -575,7 +575,7 @@ public class PngWriter {
*
* @deprecated Better use writeRow(ImageLine imgline, int rownumber)
*/
- public void writeRow(ImageLine imgline) {
+ public void writeRow(final ImageLine imgline) {
writeRow(imgline.scanline, imgline.getRown());
}
@@ -586,7 +586,7 @@ public class PngWriter {
*
* @see #writeRowInt(int[], int)
*/
- public void writeRow(ImageLine imgline, int rownumber) {
+ public void writeRow(final ImageLine imgline, final int rownumber) {
unpackedMode = imgline.samplesUnpacked;
if (imgline.sampleType == SampleType.INT)
writeRowInt(imgline.scanline, rownumber);
@@ -599,7 +599,7 @@ public class PngWriter {
*
* @param newrow
*/
- public void writeRow(int[] newrow) {
+ public void writeRow(final int[] newrow) {
writeRow(newrow, -1);
}
@@ -608,7 +608,7 @@ public class PngWriter {
*
* @see #writeRowInt(int[], int)
*/
- public void writeRow(int[] newrow, int rown) {
+ public void writeRow(final int[] newrow, final int rown) {
writeRowInt(newrow, rown);
}
@@ -632,7 +632,7 @@ public class PngWriter {
* Row number, from 0 (top) to rows-1 (bottom). This is just used
* as a check. Pass -1 if you want to autocompute it
*/
- public void writeRowInt(int[] newrow, int rown) {
+ public void writeRowInt(final int[] newrow, final int rown) {
prepareEncodeRow(rown);
encodeRowFromInt(newrow);
filterAndSend(rown);
@@ -645,7 +645,7 @@ public class PngWriter {
*
* @see PngWriter#writeRowInt(int[], int)
*/
- public void writeRowByte(byte[] newrow, int rown) {
+ public void writeRowByte(final byte[] newrow, final int rown) {
prepareEncodeRow(rown);
encodeRowFromByte(newrow);
filterAndSend(rown);
@@ -654,7 +654,7 @@ public class PngWriter {
/**
* Writes all the pixels, calling writeRowInt() for each image row
*/
- public void writeRowsInt(int[][] image) {
+ public void writeRowsInt(final int[][] image) {
for (int i = 0; i < imgInfo.rows; i++)
writeRowInt(image[i], i);
}
@@ -662,7 +662,7 @@ public class PngWriter {
/**
* Writes all the pixels, calling writeRowByte() for each image row
*/
- public void writeRowsByte(byte[][] image) {
+ public void writeRowsByte(final byte[][] image) {
for (int i = 0; i < imgInfo.rows; i++)
writeRowByte(image[i], i);
}
@@ -682,7 +682,7 @@ public class PngWriter {
* packed flag of the ImageLine object overrides (and overwrites!)
* this field.
*/
- public void setUseUnPackedMode(boolean useUnpackedMode) {
+ public void setUseUnPackedMode(final boolean useUnpackedMode) {
this.unpackedMode = useUnpackedMode;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
index 3b74f862f..032b2ed3a 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjBadCrcException extends PngjInputException {
private static final long serialVersionUID = 1L;
- public PngjBadCrcException(String message, Throwable cause) {
+ public PngjBadCrcException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjBadCrcException(String message) {
+ public PngjBadCrcException(final String message) {
super(message);
}
- public PngjBadCrcException(Throwable cause) {
+ public PngjBadCrcException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
index 97e24fc73..3d05589b1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
@@ -9,15 +9,15 @@ package jogamp.opengl.util.pngj;
public class PngjException extends RuntimeException {
private static final long serialVersionUID = 1L;
- public PngjException(String message, Throwable cause) {
+ public PngjException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjException(String message) {
+ public PngjException(final String message) {
super(message);
}
- public PngjException(Throwable cause) {
+ public PngjException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
index 5da70de7b..9484abf5e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
@@ -10,15 +10,15 @@ package jogamp.opengl.util.pngj;
public class PngjExceptionInternal extends RuntimeException {
private static final long serialVersionUID = 1L;
- public PngjExceptionInternal(String message, Throwable cause) {
+ public PngjExceptionInternal(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjExceptionInternal(String message) {
+ public PngjExceptionInternal(final String message) {
super(message);
}
- public PngjExceptionInternal(Throwable cause) {
+ public PngjExceptionInternal(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
index 5cc36b99a..c92d80b2c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjInputException extends PngjException {
private static final long serialVersionUID = 1L;
- public PngjInputException(String message, Throwable cause) {
+ public PngjInputException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjInputException(String message) {
+ public PngjInputException(final String message) {
super(message);
}
- public PngjInputException(Throwable cause) {
+ public PngjInputException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
index c8cd36acb..4e9cdc950 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjOutputException extends PngjException {
private static final long serialVersionUID = 1L;
- public PngjOutputException(String message, Throwable cause) {
+ public PngjOutputException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjOutputException(String message) {
+ public PngjOutputException(final String message) {
super(message);
}
- public PngjOutputException(Throwable cause) {
+ public PngjOutputException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
index f68458d19..e68b153ac 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
@@ -11,15 +11,15 @@ public class PngjUnsupportedException extends RuntimeException {
super();
}
- public PngjUnsupportedException(String message, Throwable cause) {
+ public PngjUnsupportedException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjUnsupportedException(String message) {
+ public PngjUnsupportedException(final String message) {
super(message);
}
- public PngjUnsupportedException(Throwable cause) {
+ public PngjUnsupportedException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java b/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
index 4516a0886..248472298 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
@@ -11,7 +11,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
private final int size;
private long countFlushed = 0;
- public ProgressiveOutputStream(int size) {
+ public ProgressiveOutputStream(final int size) {
this.size = size;
}
@@ -28,19 +28,19 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
}
@Override
- public final void write(byte[] b, int off, int len) {
+ public final void write(final byte[] b, final int off, final int len) {
super.write(b, off, len);
checkFlushBuffer(false);
}
@Override
- public final void write(byte[] b) throws IOException {
+ public final void write(final byte[] b) throws IOException {
super.write(b);
checkFlushBuffer(false);
}
@Override
- public final void write(int arg0) {
+ public final void write(final int arg0) {
super.write(arg0);
checkFlushBuffer(false);
}
@@ -54,7 +54,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
* if it's time to flush data (or if forced==true) calls abstract method
* flushBuffer() and cleans those bytes from own buffer
*/
- private final void checkFlushBuffer(boolean forced) {
+ private final void checkFlushBuffer(final boolean forced) {
while (forced || count >= size) {
int nb = size;
if (nb > count)
@@ -63,7 +63,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
return;
flushBuffer(buf, nb);
countFlushed += nb;
- int bytesleft = count - nb;
+ final int bytesleft = count - nb;
count = bytesleft;
if (bytesleft > 0)
System.arraycopy(buf, nb, buf, 0, bytesleft);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
index 4e8bf5635..b8cfd8691 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
@@ -68,63 +68,63 @@ public class ChunkHelper {
/**
* Converts to bytes using Latin1 (ISO-8859-1)
*/
- public static byte[] toBytes(String x) {
+ public static byte[] toBytes(final String x) {
return x.getBytes(PngHelperInternal.charsetLatin1);
}
/**
* Converts to String using Latin1 (ISO-8859-1)
*/
- public static String toString(byte[] x) {
+ public static String toString(final byte[] x) {
return new String(x, PngHelperInternal.charsetLatin1);
}
/**
* Converts to String using Latin1 (ISO-8859-1)
*/
- public static String toString(byte[] x, int offset, int len) {
+ public static String toString(final byte[] x, final int offset, final int len) {
return new String(x, offset, len, PngHelperInternal.charsetLatin1);
}
/**
* Converts to bytes using UTF-8
*/
- public static byte[] toBytesUTF8(String x) {
+ public static byte[] toBytesUTF8(final String x) {
return x.getBytes(PngHelperInternal.charsetUTF8);
}
/**
* Converts to string using UTF-8
*/
- public static String toStringUTF8(byte[] x) {
+ public static String toStringUTF8(final byte[] x) {
return new String(x, PngHelperInternal.charsetUTF8);
}
/**
* Converts to string using UTF-8
*/
- public static String toStringUTF8(byte[] x, int offset, int len) {
+ public static String toStringUTF8(final byte[] x, final int offset, final int len) {
return new String(x, offset, len, PngHelperInternal.charsetUTF8);
}
/**
* critical chunk : first letter is uppercase
*/
- public static boolean isCritical(String id) {
+ public static boolean isCritical(final String id) {
return (Character.isUpperCase(id.charAt(0)));
}
/**
* public chunk: second letter is uppercase
*/
- public static boolean isPublic(String id) { //
+ public static boolean isPublic(final String id) { //
return (Character.isUpperCase(id.charAt(1)));
}
/**
* Safe to copy chunk: fourth letter is lower case
*/
- public static boolean isSafeToCopy(String id) {
+ public static boolean isSafeToCopy(final String id) {
return (!Character.isUpperCase(id.charAt(3)));
}
@@ -132,7 +132,7 @@ public class ChunkHelper {
* "Unknown" just means that our chunk factory (even when it has been
* augmented by client code) did not recognize its id
*/
- public static boolean isUnknown(PngChunk c) {
+ public static boolean isUnknown(final PngChunk c) {
return c instanceof PngChunkUNKNOWN;
}
@@ -142,7 +142,7 @@ public class ChunkHelper {
* @param b
* @return -1 if not found
*/
- public static int posNullByte(byte[] b) {
+ public static int posNullByte(final byte[] b) {
for (int i = 0; i < b.length; i++)
if (b[i] == 0)
return i;
@@ -156,10 +156,10 @@ public class ChunkHelper {
* @param behav
* @return true/false
*/
- public static boolean shouldLoad(String id, ChunkLoadBehaviour behav) {
+ public static boolean shouldLoad(final String id, final ChunkLoadBehaviour behav) {
if (isCritical(id))
return true;
- boolean kwown = PngChunk.isKnown(id);
+ final boolean kwown = PngChunk.isKnown(id);
switch (behav) {
case LOAD_CHUNK_ALWAYS:
return true;
@@ -173,21 +173,21 @@ public class ChunkHelper {
return false; // should not reach here
}
- public final static byte[] compressBytes(byte[] ori, boolean compress) {
+ public final static byte[] compressBytes(final byte[] ori, final boolean compress) {
return compressBytes(ori, 0, ori.length, compress);
}
- public static byte[] compressBytes(byte[] ori, int offset, int len, boolean compress) {
+ public static byte[] compressBytes(final byte[] ori, final int offset, final int len, final boolean compress) {
try {
- ByteArrayInputStream inb = new ByteArrayInputStream(ori, offset, len);
- InputStream in = compress ? inb : new InflaterInputStream(inb, getInflater());
- ByteArrayOutputStream outb = new ByteArrayOutputStream();
- OutputStream out = compress ? new DeflaterOutputStream(outb) : outb;
+ final ByteArrayInputStream inb = new ByteArrayInputStream(ori, offset, len);
+ final InputStream in = compress ? inb : new InflaterInputStream(inb, getInflater());
+ final ByteArrayOutputStream outb = new ByteArrayOutputStream();
+ final OutputStream out = compress ? new DeflaterOutputStream(outb) : outb;
shovelInToOut(in, out);
in.close();
out.close();
return outb.toByteArray();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new PngjException(e);
}
}
@@ -195,7 +195,7 @@ public class ChunkHelper {
/**
* Shovels all data from an input stream to an output stream.
*/
- private static void shovelInToOut(InputStream in, OutputStream out) throws IOException {
+ private static void shovelInToOut(final InputStream in, final OutputStream out) throws IOException {
synchronized (tmpbuffer) {
int len;
while ((len = in.read(tmpbuffer)) > 0) {
@@ -204,7 +204,7 @@ public class ChunkHelper {
}
}
- public static boolean maskMatch(int v, int mask) {
+ public static boolean maskMatch(final int v, final int mask) {
return (v & mask) != 0;
}
@@ -213,9 +213,9 @@ public class ChunkHelper {
*
* See also trimList()
*/
- public static List filterList(List target, ChunkPredicate predicateKeep) {
- List result = new ArrayList();
- for (PngChunk element : target) {
+ public static List filterList(final List target, final ChunkPredicate predicateKeep) {
+ final List result = new ArrayList();
+ for (final PngChunk element : target) {
if (predicateKeep.match(element)) {
result.add(element);
}
@@ -228,11 +228,11 @@ public class ChunkHelper {
*
* See also filterList
*/
- public static int trimList(List target, ChunkPredicate predicateRemove) {
- Iterator it = target.iterator();
+ public static int trimList(final List target, final ChunkPredicate predicateRemove) {
+ final Iterator it = target.iterator();
int cont = 0;
while (it.hasNext()) {
- PngChunk c = it.next();
+ final PngChunk c = it.next();
if (predicateRemove.match(c)) {
it.remove();
cont++;
@@ -252,7 +252,7 @@ public class ChunkHelper {
*
* @return true if "equivalent"
*/
- public static final boolean equivalent(PngChunk c1, PngChunk c2) {
+ public static final boolean equivalent(final PngChunk c1, final PngChunk c2) {
if (c1 == c2)
return true;
if (c1 == null || c2 == null || !c1.id.equals(c2.id))
@@ -272,7 +272,7 @@ public class ChunkHelper {
return false;
}
- public static boolean isText(PngChunk c) {
+ public static boolean isText(final PngChunk c) {
return c instanceof PngChunkTextVar;
}
@@ -281,7 +281,7 @@ public class ChunkHelper {
* individual chunks compression
*/
public static Inflater getInflater() {
- Inflater inflater = inflaterProvider.get();
+ final Inflater inflater = inflaterProvider.get();
inflater.reset();
return inflater;
}
@@ -291,7 +291,7 @@ public class ChunkHelper {
* individual chunks decompression
*/
public static Deflater getDeflater() {
- Deflater deflater = deflaterProvider.get();
+ final Deflater deflater = deflaterProvider.get();
deflater.reset();
return deflater;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
index dcb1958df..0ac2dc6a0 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
@@ -50,7 +50,7 @@ public class ChunkRaw {
* @param alloc
* : it true, the data array will be allocced
*/
- public ChunkRaw(int len, byte[] idbytes, boolean alloc) {
+ public ChunkRaw(final int len, final byte[] idbytes, final boolean alloc) {
this.len = len;
System.arraycopy(idbytes, 0, this.idbytes, 0, 4);
if (alloc)
@@ -66,7 +66,7 @@ public class ChunkRaw {
* this is called after setting data, before writing to os
*/
private int computeCrc() {
- CRC32 crcengine = PngHelperInternal.getCRC();
+ final CRC32 crcengine = PngHelperInternal.getCRC();
crcengine.reset();
crcengine.update(idbytes, 0, 4);
if (len > 0)
@@ -78,7 +78,7 @@ public class ChunkRaw {
* Computes the CRC and writes to the stream. If error, a
* PngjOutputException is thrown
*/
- public void writeChunk(OutputStream os) {
+ public void writeChunk(final OutputStream os) {
if (idbytes.length != 4)
throw new PngjOutputException("bad chunkid [" + ChunkHelper.toString(idbytes) + "]");
crcval = computeCrc();
@@ -93,11 +93,11 @@ public class ChunkRaw {
* position before: just after chunk id. positon after: after crc Data
* should be already allocated. Checks CRC Return number of byte read.
*/
- public int readChunkData(InputStream is, boolean checkCrc) {
+ public int readChunkData(final InputStream is, final boolean checkCrc) {
PngHelperInternal.readBytes(is, data, 0, len);
crcval = PngHelperInternal.readInt4(is);
if (checkCrc) {
- int crc = computeCrc();
+ final int crc = computeCrc();
if (crc != crcval)
throw new PngjBadCrcException("chunk: " + this + " crc calc=" + crc + " read=" + crcval);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
index 75107d761..f5a920e73 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
@@ -31,7 +31,7 @@ public class ChunksList {
final ImageInfo imageInfo; // only required for writing
- public ChunksList(ImageInfo imfinfo) {
+ public ChunksList(final ImageInfo imfinfo) {
this.imageInfo = imfinfo;
}
@@ -41,8 +41,8 @@ public class ChunksList {
* @return key:chunk id, val: number of occurrences
*/
public HashMap getChunksKeys() {
- HashMap ck = new HashMap();
- for (PngChunk c : chunks) {
+ final HashMap ck = new HashMap();
+ for (final PngChunk c : chunks) {
ck.put(c.id, ck.containsKey(c.id) ? ck.get(c.id) + 1 : 1);
}
return ck;
@@ -60,14 +60,14 @@ public class ChunksList {
if (innerid == null)
return ChunkHelper.filterList(list, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
return c.id.equals(id);
}
});
else
return ChunkHelper.filterList(list, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
if (!c.id.equals(id))
return false;
if (c instanceof PngChunkTextVar && !((PngChunkTextVar) c).getKey().equals(innerid))
@@ -82,7 +82,7 @@ public class ChunksList {
/**
* Adds chunk in next position. This is used onyl by the pngReader
*/
- public void appendReadChunk(PngChunk chunk, int chunkGroup) {
+ public void appendReadChunk(final PngChunk chunk, final int chunkGroup) {
chunk.setChunkGroup(chunkGroup);
chunks.add(chunk);
}
@@ -138,7 +138,7 @@ public class ChunksList {
* one is returned (failifMultiple=false)
**/
public PngChunk getById1(final String id, final String innerid, final boolean failIfMultiple) {
- List extends PngChunk> list = getById(id, innerid);
+ final List extends PngChunk> list = getById(id, innerid);
if (list.isEmpty())
return null;
if (list.size() > 1 && (failIfMultiple || !list.get(0).allowsMultiple()))
@@ -155,7 +155,7 @@ public class ChunksList {
public List getEquivalent(final PngChunk c2) {
return ChunkHelper.filterList(chunks, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
return ChunkHelper.equivalent(c, c2);
}
});
@@ -170,9 +170,9 @@ public class ChunksList {
* for debugging
*/
public String toStringFull() {
- StringBuilder sb = new StringBuilder(toString());
+ final StringBuilder sb = new StringBuilder(toString());
sb.append("\n Read:\n");
- for (PngChunk chunk : chunks) {
+ for (final PngChunk chunk : chunks) {
sb.append(chunk).append(" G=" + chunk.getChunkGroup() + "\n");
}
return sb.toString();
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
index c502e9071..6ad61f8e2 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
@@ -19,9 +19,9 @@ public class ChunksListForWrite extends ChunksList {
private final List queuedChunks = new ArrayList();
// redundant, just for eficciency
- private HashMap alreadyWrittenKeys = new HashMap();
+ private final HashMap alreadyWrittenKeys = new HashMap();
- public ChunksListForWrite(ImageInfo imfinfo) {
+ public ChunksListForWrite(final ImageInfo imfinfo) {
super(imfinfo);
}
@@ -43,7 +43,7 @@ public class ChunksListForWrite extends ChunksList {
* Same as getById1(), but looking in the queued chunks
**/
public PngChunk getQueuedById1(final String id, final String innerid, final boolean failIfMultiple) {
- List extends PngChunk> list = getQueuedById(id, innerid);
+ final List extends PngChunk> list = getQueuedById(id, innerid);
if (list.isEmpty())
return null;
if (list.size() > 1 && (failIfMultiple || !list.get(0).allowsMultiple()))
@@ -72,7 +72,7 @@ public class ChunksListForWrite extends ChunksList {
* straightforward for SingleChunks. For MultipleChunks, it will normally
* check for reference equality!
*/
- public boolean removeChunk(PngChunk c) {
+ public boolean removeChunk(final PngChunk c) {
return queuedChunks.remove(c);
}
@@ -83,7 +83,7 @@ public class ChunksListForWrite extends ChunksList {
*
* @param c
*/
- public boolean queue(PngChunk c) {
+ public boolean queue(final PngChunk c) {
queuedChunks.add(c);
return true;
}
@@ -92,7 +92,7 @@ public class ChunksListForWrite extends ChunksList {
* this should be called only for ancillary chunks and PLTE (groups 1 - 3 -
* 5)
**/
- private static boolean shouldWrite(PngChunk c, int currentGroup) {
+ private static boolean shouldWrite(final PngChunk c, final int currentGroup) {
if (currentGroup == CHUNK_GROUP_2_PLTE)
return c.id.equals(ChunkHelper.PLTE);
if (currentGroup % 2 == 0)
@@ -121,11 +121,11 @@ public class ChunksListForWrite extends ChunksList {
return false;
}
- public int writeChunks(OutputStream os, int currentGroup) {
+ public int writeChunks(final OutputStream os, final int currentGroup) {
int cont = 0;
- Iterator it = queuedChunks.iterator();
+ final Iterator it = queuedChunks.iterator();
while (it.hasNext()) {
- PngChunk c = it.next();
+ final PngChunk c = it.next();
if (!shouldWrite(c, currentGroup))
continue;
if (ChunkHelper.isCritical(c.id) && !c.id.equals(ChunkHelper.PLTE))
@@ -159,14 +159,14 @@ public class ChunksListForWrite extends ChunksList {
*/
@Override
public String toStringFull() {
- StringBuilder sb = new StringBuilder(toString());
+ final StringBuilder sb = new StringBuilder(toString());
sb.append("\n Written:\n");
- for (PngChunk chunk : chunks) {
+ for (final PngChunk chunk : chunks) {
sb.append(chunk).append(" G=" + chunk.getChunkGroup() + "\n");
}
if (!queuedChunks.isEmpty()) {
sb.append(" Queued:\n");
- for (PngChunk chunk : queuedChunks) {
+ for (final PngChunk chunk : queuedChunks) {
sb.append(chunk).append("\n");
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
index 6cd86eb98..eba218fe3 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
@@ -122,7 +122,7 @@ public abstract class PngChunk {
* (not implmemented in this library) to the factory, so that the PngReader
* knows about it.
*/
- public static void factoryRegister(String chunkId, Class extends PngChunk> chunkClass) {
+ public static void factoryRegister(final String chunkId, final Class extends PngChunk> chunkClass) {
factoryMap.put(chunkId, chunkClass);
}
@@ -137,11 +137,11 @@ public abstract class PngChunk {
*
* Unknown chunks will be parsed as instances of {@link PngChunkUNKNOWN}
*/
- public static boolean isKnown(String id) {
+ public static boolean isKnown(final String id) {
return factoryMap.containsKey(id);
}
- protected PngChunk(String id, ImageInfo imgInfo) {
+ protected PngChunk(final String id, final ImageInfo imgInfo) {
this.id = id;
this.imgInfo = imgInfo;
this.crit = ChunkHelper.isCritical(id);
@@ -153,8 +153,8 @@ public abstract class PngChunk {
* This factory creates the corresponding chunk and parses the raw chunk.
* This is used when reading.
*/
- public static PngChunk factory(ChunkRaw chunk, ImageInfo info) {
- PngChunk c = factoryFromId(ChunkHelper.toString(chunk.idbytes), info);
+ public static PngChunk factory(final ChunkRaw chunk, final ImageInfo info) {
+ final PngChunk c = factoryFromId(ChunkHelper.toString(chunk.idbytes), info);
c.length = chunk.len;
c.parseFromRaw(chunk);
return c;
@@ -164,15 +164,15 @@ public abstract class PngChunk {
* Creates one new blank chunk of the corresponding type, according to
* factoryMap (PngChunkUNKNOWN if not known)
*/
- public static PngChunk factoryFromId(String cid, ImageInfo info) {
+ public static PngChunk factoryFromId(final String cid, final ImageInfo info) {
PngChunk chunk = null;
try {
- Class extends PngChunk> cla = factoryMap.get(cid);
+ final Class extends PngChunk> cla = factoryMap.get(cid);
if (cla != null) {
- Constructor extends PngChunk> constr = cla.getConstructor(ImageInfo.class);
+ final Constructor extends PngChunk> constr = cla.getConstructor(ImageInfo.class);
chunk = constr.newInstance(info);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
// this can happen for unkown chunks
}
if (chunk == null)
@@ -180,8 +180,8 @@ public abstract class PngChunk {
return chunk;
}
- protected final ChunkRaw createEmptyChunk(int len, boolean alloc) {
- ChunkRaw c = new ChunkRaw(len, ChunkHelper.toBytes(id), alloc);
+ protected final ChunkRaw createEmptyChunk(final int len, final boolean alloc) {
+ final ChunkRaw c = new ChunkRaw(len, ChunkHelper.toBytes(id), alloc);
return c;
}
@@ -189,8 +189,8 @@ public abstract class PngChunk {
* Makes a clone (deep copy) calling {@link #cloneDataFromRead(PngChunk)}
*/
@SuppressWarnings("unchecked")
- public static T cloneChunk(T chunk, ImageInfo info) {
- PngChunk cn = factoryFromId(chunk.id, info);
+ public static T cloneChunk(final T chunk, final ImageInfo info) {
+ final PngChunk cn = factoryFromId(chunk.id, info);
if (cn.getClass() != chunk.getClass())
throw new PngjExceptionInternal("bad class cloning chunk: " + cn.getClass() + " " + chunk.getClass());
cn.cloneDataFromRead(chunk);
@@ -210,7 +210,7 @@ public abstract class PngChunk {
/**
* @see #getChunkGroup()
*/
- final public void setChunkGroup(int chunkGroup) {
+ final public void setChunkGroup(final int chunkGroup) {
this.chunkGroup = chunkGroup;
}
@@ -218,12 +218,12 @@ public abstract class PngChunk {
return priority;
}
- public void setPriority(boolean priority) {
+ public void setPriority(final boolean priority) {
this.priority = priority;
}
- final void write(OutputStream os) {
- ChunkRaw c = createRawChunk();
+ final void write(final OutputStream os) {
+ final ChunkRaw c = createRawChunk();
if (c == null)
throw new PngjExceptionInternal("null chunk ! creation failed for " + this);
c.writeChunk(os);
@@ -241,7 +241,7 @@ public abstract class PngChunk {
return offset;
}
- public void setOffset(long offset) {
+ public void setOffset(final long offset) {
this.offset = offset;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
index ea6235432..191278dbc 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
@@ -18,7 +18,7 @@ public class PngChunkBKGD extends PngChunkSingle {
private int red, green, blue;
private int paletteIndex;
- public PngChunkBKGD(ImageInfo info) {
+ public PngChunkBKGD(final ImageInfo info) {
super(ChunkHelper.bKGD, info);
}
@@ -46,11 +46,11 @@ public class PngChunkBKGD extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (imgInfo.greyscale) {
gray = PngHelperInternal.readInt2fromBytes(c.data, 0);
} else if (imgInfo.indexed) {
- paletteIndex = (int) (c.data[0] & 0xff);
+ paletteIndex = c.data[0] & 0xff;
} else {
red = PngHelperInternal.readInt2fromBytes(c.data, 0);
green = PngHelperInternal.readInt2fromBytes(c.data, 2);
@@ -59,8 +59,8 @@ public class PngChunkBKGD extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkBKGD otherx = (PngChunkBKGD) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkBKGD otherx = (PngChunkBKGD) other;
gray = otherx.gray;
red = otherx.red;
green = otherx.red;
@@ -73,7 +73,7 @@ public class PngChunkBKGD extends PngChunkSingle {
*
* @param gray
*/
- public void setGray(int gray) {
+ public void setGray(final int gray) {
if (!imgInfo.greyscale)
throw new PngjException("only gray images support this");
this.gray = gray;
@@ -89,7 +89,7 @@ public class PngChunkBKGD extends PngChunkSingle {
* Set pallette index
*
*/
- public void setPaletteIndex(int i) {
+ public void setPaletteIndex(final int i) {
if (!imgInfo.indexed)
throw new PngjException("only indexed (pallete) images support this");
this.paletteIndex = i;
@@ -105,7 +105,7 @@ public class PngChunkBKGD extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
red = r;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
index 25a4bf2d6..8bdd7b4c0 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
@@ -18,7 +18,7 @@ public class PngChunkCHRM extends PngChunkSingle {
private double greenx, greeny;
private double bluex, bluey;
- public PngChunkCHRM(ImageInfo info) {
+ public PngChunkCHRM(final ImageInfo info) {
super(ID, info);
}
@@ -43,7 +43,7 @@ public class PngChunkCHRM extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 32)
throw new PngjException("bad chunk " + c);
whitex = PngHelperInternal.intToDouble100000(PngHelperInternal.readInt4fromBytes(c.data, 0));
@@ -57,8 +57,8 @@ public class PngChunkCHRM extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkCHRM otherx = (PngChunkCHRM) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkCHRM otherx = (PngChunkCHRM) other;
whitex = otherx.whitex;
whitey = otherx.whitex;
redx = otherx.redx;
@@ -69,8 +69,8 @@ public class PngChunkCHRM extends PngChunkSingle {
bluey = otherx.bluey;
}
- public void setChromaticities(double whitex, double whitey, double redx, double redy, double greenx, double greeny,
- double bluex, double bluey) {
+ public void setChromaticities(final double whitex, final double whitey, final double redx, final double redy, final double greenx, final double greeny,
+ final double bluex, final double bluey) {
this.whitex = whitex;
this.redx = redx;
this.greenx = greenx;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
index 74640746e..6b627326c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
@@ -15,7 +15,7 @@ public class PngChunkGAMA extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11gAMA
private double gamma;
- public PngChunkGAMA(ImageInfo info) {
+ public PngChunkGAMA(final ImageInfo info) {
super(ID, info);
}
@@ -26,22 +26,22 @@ public class PngChunkGAMA extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(4, true);
- int g = (int) (gamma * 100000 + 0.5);
+ final ChunkRaw c = createEmptyChunk(4, true);
+ final int g = (int) (gamma * 100000 + 0.5);
PngHelperInternal.writeInt4tobytes(g, c.data, 0);
return c;
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 4)
throw new PngjException("bad chunk " + chunk);
- int g = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
- gamma = ((double) g) / 100000.0;
+ final int g = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
+ gamma = (g) / 100000.0;
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
gamma = ((PngChunkGAMA) other).gamma;
}
@@ -49,7 +49,7 @@ public class PngChunkGAMA extends PngChunkSingle {
return gamma;
}
- public void setGamma(double gamma) {
+ public void setGamma(final double gamma) {
this.gamma = gamma;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
index 6dc3fd9ec..4a4832d3b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
@@ -15,7 +15,7 @@ public class PngChunkHIST extends PngChunkSingle {
private int[] hist = new int[0]; // should have same lenght as palette
- public PngChunkHIST(ImageInfo info) {
+ public PngChunkHIST(final ImageInfo info) {
super(ID, info);
}
@@ -25,10 +25,10 @@ public class PngChunkHIST extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images accept a HIST chunk");
- int nentries = c.data.length / 2;
+ final int nentries = c.data.length / 2;
hist = new int[nentries];
for (int i = 0; i < hist.length; i++) {
hist[i] = PngHelperInternal.readInt2fromBytes(c.data, i * 2);
@@ -48,8 +48,8 @@ public class PngChunkHIST extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkHIST otherx = (PngChunkHIST) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkHIST otherx = (PngChunkHIST) other;
hist = new int[otherx.hist.length];
System.arraycopy(otherx.hist, 0, hist, 0, otherx.hist.length);
}
@@ -58,7 +58,7 @@ public class PngChunkHIST extends PngChunkSingle {
return hist;
}
- public void setHist(int[] hist) {
+ public void setHist(final int[] hist) {
this.hist = hist;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
index 399577d72..17f69861c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
@@ -16,7 +16,7 @@ public class PngChunkICCP extends PngChunkSingle {
private String profileName;
private byte[] compressedProfile; // copmression/decopmresion is done in getter/setter
- public PngChunkICCP(ImageInfo info) {
+ public PngChunkICCP(final ImageInfo info) {
super(ID, info);
}
@@ -27,7 +27,7 @@ public class PngChunkICCP extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(profileName.length() + compressedProfile.length + 2, true);
+ final ChunkRaw c = createEmptyChunk(profileName.length() + compressedProfile.length + 2, true);
System.arraycopy(ChunkHelper.toBytes(profileName), 0, c.data, 0, profileName.length());
c.data[profileName.length()] = 0;
c.data[profileName.length() + 1] = 0;
@@ -36,20 +36,20 @@ public class PngChunkICCP extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
- int pos0 = ChunkHelper.posNullByte(chunk.data);
+ public void parseFromRaw(final ChunkRaw chunk) {
+ final int pos0 = ChunkHelper.posNullByte(chunk.data);
profileName = new String(chunk.data, 0, pos0, PngHelperInternal.charsetLatin1);
- int comp = (chunk.data[pos0 + 1] & 0xff);
+ final int comp = (chunk.data[pos0 + 1] & 0xff);
if (comp != 0)
throw new PngjException("bad compression for ChunkTypeICCP");
- int compdatasize = chunk.data.length - (pos0 + 2);
+ final int compdatasize = chunk.data.length - (pos0 + 2);
compressedProfile = new byte[compdatasize];
System.arraycopy(chunk.data, pos0 + 2, compressedProfile, 0, compdatasize);
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkICCP otherx = (PngChunkICCP) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkICCP otherx = (PngChunkICCP) other;
profileName = otherx.profileName;
compressedProfile = new byte[otherx.compressedProfile.length];
System.arraycopy(otherx.compressedProfile, 0, compressedProfile, 0, otherx.compressedProfile.length); // deep
@@ -59,12 +59,12 @@ public class PngChunkICCP extends PngChunkSingle {
/**
* The profile should be uncompressed bytes
*/
- public void setProfileNameAndContent(String name, byte[] profile) {
+ public void setProfileNameAndContent(final String name, final byte[] profile) {
profileName = name;
compressedProfile = ChunkHelper.compressBytes(profile, true);
}
- public void setProfileNameAndContent(String name, String profile) {
+ public void setProfileNameAndContent(final String name, final String profile) {
setProfileNameAndContent(name, profile.getBytes(PngHelperInternal.charsetLatin1));
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
index 911513c0d..f7bee4b11 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
@@ -14,7 +14,7 @@ public class PngChunkIDAT extends PngChunkMultiple {
public final static String ID = ChunkHelper.IDAT;
// http://www.w3.org/TR/PNG/#11IDAT
- public PngChunkIDAT(ImageInfo i, int len, long offset) {
+ public PngChunkIDAT(final ImageInfo i, final int len, final long offset) {
super(ID, i);
this.length = len;
this.offset = offset;
@@ -31,10 +31,10 @@ public class PngChunkIDAT extends PngChunkMultiple {
}
@Override
- public void parseFromRaw(ChunkRaw c) { // does nothing
+ public void parseFromRaw(final ChunkRaw c) { // does nothing
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
index fbec564d8..3f6e47b09 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
@@ -12,7 +12,7 @@ public class PngChunkIEND extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11IEND
// this is a dummy placeholder
- public PngChunkIEND(ImageInfo info) {
+ public PngChunkIEND(final ImageInfo info) {
super(ID, info);
}
@@ -23,16 +23,16 @@ public class PngChunkIEND extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false);
+ final ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false);
return c;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
// this is not used
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
index 94bfedd38..71e0ec90e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
@@ -27,7 +27,7 @@ public class PngChunkIHDR extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11IHDR
//
- public PngChunkIHDR(ImageInfo info) {
+ public PngChunkIHDR(final ImageInfo info) {
super(ID, info);
}
@@ -38,7 +38,7 @@ public class PngChunkIHDR extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true);
+ final ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true);
int offset = 0;
PngHelperInternal.writeInt4tobytes(cols, c.data, offset);
offset += 4;
@@ -53,10 +53,10 @@ public class PngChunkIHDR extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 13)
throw new PngjException("Bad IDHR len " + c.len);
- ByteArrayInputStream st = c.getAsByteStream();
+ final ByteArrayInputStream st = c.getAsByteStream();
cols = PngHelperInternal.readInt4(st);
rows = PngHelperInternal.readInt4(st);
// bit depth: number of bits per channel
@@ -68,8 +68,8 @@ public class PngChunkIHDR extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkIHDR otherx = (PngChunkIHDR) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkIHDR otherx = (PngChunkIHDR) other;
cols = otherx.cols;
rows = otherx.rows;
bitspc = otherx.bitspc;
@@ -83,7 +83,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return cols;
}
- public void setCols(int cols) {
+ public void setCols(final int cols) {
this.cols = cols;
}
@@ -91,7 +91,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return rows;
}
- public void setRows(int rows) {
+ public void setRows(final int rows) {
this.rows = rows;
}
@@ -99,7 +99,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return bitspc;
}
- public void setBitspc(int bitspc) {
+ public void setBitspc(final int bitspc) {
this.bitspc = bitspc;
}
@@ -107,7 +107,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return colormodel;
}
- public void setColormodel(int colormodel) {
+ public void setColormodel(final int colormodel) {
this.colormodel = colormodel;
}
@@ -115,7 +115,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return compmeth;
}
- public void setCompmeth(int compmeth) {
+ public void setCompmeth(final int compmeth) {
this.compmeth = compmeth;
}
@@ -123,7 +123,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return filmeth;
}
- public void setFilmeth(int filmeth) {
+ public void setFilmeth(final int filmeth) {
this.filmeth = filmeth;
}
@@ -131,7 +131,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return interlaced;
}
- public void setInterlaced(int interlaced) {
+ public void setInterlaced(final int interlaced) {
this.interlaced = interlaced;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
index ab52d7c90..738f92471 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
@@ -21,7 +21,7 @@ public class PngChunkITXT extends PngChunkTextVar {
private String translatedTag = "";
// http://www.w3.org/TR/PNG/#11iTXt
- public PngChunkITXT(ImageInfo info) {
+ public PngChunkITXT(final ImageInfo info) {
super(ID, info);
}
@@ -30,7 +30,7 @@ public class PngChunkITXT extends PngChunkTextVar {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(ChunkHelper.toBytes(key));
ba.write(0); // separator
ba.write(compressed ? 1 : 0);
@@ -44,19 +44,19 @@ public class PngChunkITXT extends PngChunkTextVar {
textbytes = ChunkHelper.compressBytes(textbytes, true);
}
ba.write(textbytes);
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int nullsFound = 0;
- int[] nullsIdx = new int[3];
+ final int[] nullsIdx = new int[3];
for (int i = 0; i < c.data.length; i++) {
if (c.data[i] != 0)
continue;
@@ -80,7 +80,7 @@ public class PngChunkITXT extends PngChunkTextVar {
PngHelperInternal.charsetUTF8);
i = nullsIdx[2] + 1;
if (compressed) {
- byte[] bytes = ChunkHelper.compressBytes(c.data, i, c.data.length - i, false);
+ final byte[] bytes = ChunkHelper.compressBytes(c.data, i, c.data.length - i, false);
val = ChunkHelper.toStringUTF8(bytes);
} else {
val = ChunkHelper.toStringUTF8(c.data, i, c.data.length - i);
@@ -88,8 +88,8 @@ public class PngChunkITXT extends PngChunkTextVar {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkITXT otherx = (PngChunkITXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkITXT otherx = (PngChunkITXT) other;
key = otherx.key;
val = otherx.val;
compressed = otherx.compressed;
@@ -101,7 +101,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return compressed;
}
- public void setCompressed(boolean compressed) {
+ public void setCompressed(final boolean compressed) {
this.compressed = compressed;
}
@@ -109,7 +109,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return langTag;
}
- public void setLangtag(String langtag) {
+ public void setLangtag(final String langtag) {
this.langTag = langtag;
}
@@ -117,7 +117,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return translatedTag;
}
- public void setTranslatedTag(String translatedTag) {
+ public void setTranslatedTag(final String translatedTag) {
this.translatedTag = translatedTag;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
index 057f6c25e..5a7bee98c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
@@ -7,7 +7,7 @@ import jogamp.opengl.util.pngj.ImageInfo;
*/
public abstract class PngChunkMultiple extends PngChunk {
- protected PngChunkMultiple(String id, ImageInfo imgInfo) {
+ protected PngChunkMultiple(final String id, final ImageInfo imgInfo) {
super(id, imgInfo);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
index a3bab4995..2217a59b4 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
@@ -17,7 +17,7 @@ public class PngChunkOFFS extends PngChunkSingle {
private long posY;
private int units; // 0: pixel 1:micrometer
- public PngChunkOFFS(ImageInfo info) {
+ public PngChunkOFFS(final ImageInfo info) {
super(ID, info);
}
@@ -28,7 +28,7 @@ public class PngChunkOFFS extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(9, true);
+ final ChunkRaw c = createEmptyChunk(9, true);
PngHelperInternal.writeInt4tobytes((int) posX, c.data, 0);
PngHelperInternal.writeInt4tobytes((int) posY, c.data, 4);
c.data[8] = (byte) units;
@@ -36,7 +36,7 @@ public class PngChunkOFFS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 9)
throw new PngjException("bad chunk length " + chunk);
posX = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
@@ -49,8 +49,8 @@ public class PngChunkOFFS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkOFFS otherx = (PngChunkOFFS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkOFFS otherx = (PngChunkOFFS) other;
this.posX = otherx.posX;
this.posY = otherx.posY;
this.units = otherx.units;
@@ -66,7 +66,7 @@ public class PngChunkOFFS extends PngChunkSingle {
/**
* 0: pixel, 1:micrometer
*/
- public void setUnits(int units) {
+ public void setUnits(final int units) {
this.units = units;
}
@@ -74,7 +74,7 @@ public class PngChunkOFFS extends PngChunkSingle {
return posX;
}
- public void setPosX(long posX) {
+ public void setPosX(final long posX) {
this.posX = posX;
}
@@ -82,7 +82,7 @@ public class PngChunkOFFS extends PngChunkSingle {
return posY;
}
- public void setPosY(long posY) {
+ public void setPosY(final long posY) {
this.posY = posY;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
index b0a1bb898..fc647273e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
@@ -16,7 +16,7 @@ public class PngChunkPHYS extends PngChunkSingle {
private long pixelsxUnitY;
private int units; // 0: unknown 1:metre
- public PngChunkPHYS(ImageInfo info) {
+ public PngChunkPHYS(final ImageInfo info) {
super(ID, info);
}
@@ -27,7 +27,7 @@ public class PngChunkPHYS extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(9, true);
+ final ChunkRaw c = createEmptyChunk(9, true);
PngHelperInternal.writeInt4tobytes((int) pixelsxUnitX, c.data, 0);
PngHelperInternal.writeInt4tobytes((int) pixelsxUnitY, c.data, 4);
c.data[8] = (byte) units;
@@ -35,7 +35,7 @@ public class PngChunkPHYS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 9)
throw new PngjException("bad chunk length " + chunk);
pixelsxUnitX = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
@@ -48,8 +48,8 @@ public class PngChunkPHYS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkPHYS otherx = (PngChunkPHYS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkPHYS otherx = (PngChunkPHYS) other;
this.pixelsxUnitX = otherx.pixelsxUnitX;
this.pixelsxUnitY = otherx.pixelsxUnitY;
this.units = otherx.units;
@@ -59,7 +59,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return pixelsxUnitX;
}
- public void setPixelsxUnitX(long pixelsxUnitX) {
+ public void setPixelsxUnitX(final long pixelsxUnitX) {
this.pixelsxUnitX = pixelsxUnitX;
}
@@ -67,7 +67,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return pixelsxUnitY;
}
- public void setPixelsxUnitY(long pixelsxUnitY) {
+ public void setPixelsxUnitY(final long pixelsxUnitY) {
this.pixelsxUnitY = pixelsxUnitY;
}
@@ -75,7 +75,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return units;
}
- public void setUnits(int units) {
+ public void setUnits(final int units) {
this.units = units;
}
@@ -87,7 +87,7 @@ public class PngChunkPHYS extends PngChunkSingle {
public double getAsDpi() {
if (units != 1 || pixelsxUnitX != pixelsxUnitY)
return -1;
- return ((double) pixelsxUnitX) * 0.0254;
+ return (pixelsxUnitX) * 0.0254;
}
/**
@@ -96,16 +96,16 @@ public class PngChunkPHYS extends PngChunkSingle {
public double[] getAsDpi2() {
if (units != 1)
return new double[] { -1, -1 };
- return new double[] { ((double) pixelsxUnitX) * 0.0254, ((double) pixelsxUnitY) * 0.0254 };
+ return new double[] { (pixelsxUnitX) * 0.0254, (pixelsxUnitY) * 0.0254 };
}
- public void setAsDpi(double dpi) {
+ public void setAsDpi(final double dpi) {
units = 1;
pixelsxUnitX = (long) (dpi / 0.0254 + 0.5);
pixelsxUnitY = pixelsxUnitX;
}
- public void setAsDpi2(double dpix, double dpiy) {
+ public void setAsDpi2(final double dpix, final double dpiy) {
units = 1;
pixelsxUnitX = (long) (dpix / 0.0254 + 0.5);
pixelsxUnitY = (long) (dpiy / 0.0254 + 0.5);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
index dbf5e53c0..0f135d1ed 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
@@ -20,7 +20,7 @@ public class PngChunkPLTE extends PngChunkSingle {
*/
private int[] entries;
- public PngChunkPLTE(ImageInfo info) {
+ public PngChunkPLTE(final ImageInfo info) {
super(ID, info);
}
@@ -31,9 +31,9 @@ public class PngChunkPLTE extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- int len = 3 * nentries;
- int[] rgb = new int[3];
- ChunkRaw c = createEmptyChunk(len, true);
+ final int len = 3 * nentries;
+ final int[] rgb = new int[3];
+ final ChunkRaw c = createEmptyChunk(len, true);
for (int n = 0, i = 0; n < nentries; n++) {
getEntryRgb(n, rgb);
c.data[i++] = (byte) rgb[0];
@@ -44,21 +44,21 @@ public class PngChunkPLTE extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
setNentries(chunk.len / 3);
for (int n = 0, i = 0; n < nentries; n++) {
- setEntry(n, (int) (chunk.data[i++] & 0xff), (int) (chunk.data[i++] & 0xff), (int) (chunk.data[i++] & 0xff));
+ setEntry(n, chunk.data[i++] & 0xff, chunk.data[i++] & 0xff, chunk.data[i++] & 0xff);
}
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkPLTE otherx = (PngChunkPLTE) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkPLTE otherx = (PngChunkPLTE) other;
this.setNentries(otherx.getNentries());
System.arraycopy(otherx.entries, 0, entries, 0, nentries);
}
- public void setNentries(int n) {
+ public void setNentries(final int n) {
nentries = n;
if (nentries < 1 || nentries > 256)
throw new PngjException("invalid pallette - nentries=" + nentries);
@@ -71,20 +71,20 @@ public class PngChunkPLTE extends PngChunkSingle {
return nentries;
}
- public void setEntry(int n, int r, int g, int b) {
+ public void setEntry(final int n, final int r, final int g, final int b) {
entries[n] = ((r << 16) | (g << 8) | b);
}
- public int getEntry(int n) {
+ public int getEntry(final int n) {
return entries[n];
}
- public void getEntryRgb(int n, int[] rgb) {
+ public void getEntryRgb(final int n, final int[] rgb) {
getEntryRgb(n, rgb, 0);
}
- public void getEntryRgb(int n, int[] rgb, int offset) {
- int v = entries[n];
+ public void getEntryRgb(final int n, final int[] rgb, final int offset) {
+ final int v = entries[n];
rgb[offset + 0] = ((v & 0xff0000) >> 16);
rgb[offset + 1] = ((v & 0xff00) >> 8);
rgb[offset + 2] = (v & 0xff);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
index 3a490654a..53858da83 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
@@ -19,7 +19,7 @@ public class PngChunkSBIT extends PngChunkSingle {
private int graysb, alphasb;
private int redsb, greensb, bluesb;
- public PngChunkSBIT(ImageInfo info) {
+ public PngChunkSBIT(final ImageInfo info) {
super(ID, info);
}
@@ -36,7 +36,7 @@ public class PngChunkSBIT extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != getLen())
throw new PngjException("bad chunk length " + c);
if (imgInfo.greyscale) {
@@ -71,8 +71,8 @@ public class PngChunkSBIT extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSBIT otherx = (PngChunkSBIT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSBIT otherx = (PngChunkSBIT) other;
graysb = otherx.graysb;
redsb = otherx.redsb;
greensb = otherx.greensb;
@@ -80,7 +80,7 @@ public class PngChunkSBIT extends PngChunkSingle {
alphasb = otherx.alphasb;
}
- public void setGraysb(int gray) {
+ public void setGraysb(final int gray) {
if (!imgInfo.greyscale)
throw new PngjException("only greyscale images support this");
graysb = gray;
@@ -92,7 +92,7 @@ public class PngChunkSBIT extends PngChunkSingle {
return graysb;
}
- public void setAlphasb(int a) {
+ public void setAlphasb(final int a) {
if (!imgInfo.alpha)
throw new PngjException("only images with alpha support this");
alphasb = a;
@@ -108,7 +108,7 @@ public class PngChunkSBIT extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
redsb = r;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
index 2ff65834d..44ff249ac 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
@@ -21,7 +21,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
private int sampledepth; // 8/16
private int[] palette; // 5 elements per entry
- public PngChunkSPLT(ImageInfo info) {
+ public PngChunkSPLT(final ImageInfo info) {
super(ID, info);
}
@@ -33,11 +33,11 @@ public class PngChunkSPLT extends PngChunkMultiple {
@Override
public ChunkRaw createRawChunk() {
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(palName.getBytes(PngHelperInternal.charsetLatin1));
ba.write(0); // separator
ba.write((byte) sampledepth);
- int nentries = getNentries();
+ final int nentries = getNentries();
for (int n = 0; n < nentries; n++) {
for (int i = 0; i < 4; i++) {
if (sampledepth == 8)
@@ -47,17 +47,17 @@ public class PngChunkSPLT extends PngChunkMultiple {
}
PngHelperInternal.writeInt2(ba, palette[n * 5 + 4]);
}
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int t = -1;
for (int i = 0; i < c.data.length; i++) { // look for first zero
if (c.data[i] == 0) {
@@ -70,7 +70,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
palName = new String(c.data, 0, t, PngHelperInternal.charsetLatin1);
sampledepth = PngHelperInternal.readInt1fromByte(c.data, t + 1);
t += 2;
- int nentries = (c.data.length - t) / (sampledepth == 8 ? 6 : 10);
+ final int nentries = (c.data.length - t) / (sampledepth == 8 ? 6 : 10);
palette = new int[nentries * 5];
int r, g, b, a, f, ne;
ne = 0;
@@ -101,8 +101,8 @@ public class PngChunkSPLT extends PngChunkMultiple {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSPLT otherx = (PngChunkSPLT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSPLT otherx = (PngChunkSPLT) other;
palName = otherx.palName;
sampledepth = otherx.sampledepth;
palette = new int[otherx.palette.length];
@@ -117,7 +117,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return palName;
}
- public void setPalName(String palName) {
+ public void setPalName(final String palName) {
this.palName = palName;
}
@@ -125,7 +125,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return sampledepth;
}
- public void setSampledepth(int sampledepth) {
+ public void setSampledepth(final int sampledepth) {
this.sampledepth = sampledepth;
}
@@ -133,7 +133,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return palette;
}
- public void setPalette(int[] palette) {
+ public void setPalette(final int[] palette) {
this.palette = palette;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
index e4d77d40a..19504b917 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
@@ -21,7 +21,7 @@ public class PngChunkSRGB extends PngChunkSingle {
private int intent;
- public PngChunkSRGB(ImageInfo info) {
+ public PngChunkSRGB(final ImageInfo info) {
super(ID, info);
}
@@ -31,7 +31,7 @@ public class PngChunkSRGB extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 1)
throw new PngjException("bad chunk length " + c);
intent = PngHelperInternal.readInt1fromByte(c.data, 0);
@@ -46,8 +46,8 @@ public class PngChunkSRGB extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSRGB otherx = (PngChunkSRGB) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSRGB otherx = (PngChunkSRGB) other;
intent = otherx.intent;
}
@@ -55,7 +55,7 @@ public class PngChunkSRGB extends PngChunkSingle {
return intent;
}
- public void setIntent(int intent) {
+ public void setIntent(final int intent) {
this.intent = intent;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
index 4dc5edec5..52037b396 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
@@ -14,7 +14,7 @@ public class PngChunkSTER extends PngChunkSingle {
// http://www.libpng.org/pub/png/spec/register/pngext-1.3.0-pdg.html#C.sTER
private byte mode; // 0: cross-fuse layout 1: diverging-fuse layout
- public PngChunkSTER(ImageInfo info) {
+ public PngChunkSTER(final ImageInfo info) {
super(ID, info);
}
@@ -25,21 +25,21 @@ public class PngChunkSTER extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(1, true);
- c.data[0] = (byte) mode;
+ final ChunkRaw c = createEmptyChunk(1, true);
+ c.data[0] = mode;
return c;
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 1)
throw new PngjException("bad chunk length " + chunk);
mode = chunk.data[0];
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSTER otherx = (PngChunkSTER) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSTER otherx = (PngChunkSTER) other;
this.mode = otherx.mode;
}
@@ -53,7 +53,7 @@ public class PngChunkSTER extends PngChunkSingle {
/**
* 0: cross-fuse layout 1: diverging-fuse layout
*/
- public void setMode(byte mode) {
+ public void setMode(final byte mode) {
this.mode = mode;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
index 7df5ba021..c5e9407b1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
@@ -8,7 +8,7 @@ import jogamp.opengl.util.pngj.ImageInfo;
*/
public abstract class PngChunkSingle extends PngChunk {
- protected PngChunkSingle(String id, ImageInfo imgInfo) {
+ protected PngChunkSingle(final String id, final ImageInfo imgInfo) {
super(id, imgInfo);
}
@@ -26,14 +26,14 @@ public abstract class PngChunkSingle extends PngChunk {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- PngChunkSingle other = (PngChunkSingle) obj;
+ final PngChunkSingle other = (PngChunkSingle) obj;
if (id == null) {
if (other.id != null)
return false;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
index f4c77b4e1..02a18816b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
@@ -8,7 +8,7 @@ import jogamp.opengl.util.pngj.PngjException;
*/
public class PngChunkSkipped extends PngChunk {
- public PngChunkSkipped(String id, ImageInfo info, int clen) {
+ public PngChunkSkipped(final String id, final ImageInfo info, final int clen) {
super(id, info);
this.length = clen;
}
@@ -24,12 +24,12 @@ public class PngChunkSkipped extends PngChunk {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
throw new PngjException("Non supported for a skipped chunk");
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
throw new PngjException("Non supported for a skipped chunk");
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
index d97cd63c5..634d0cd12 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
@@ -12,7 +12,7 @@ import jogamp.opengl.util.pngj.PngjException;
public class PngChunkTEXT extends PngChunkTextVar {
public final static String ID = ChunkHelper.tEXt;
- public PngChunkTEXT(ImageInfo info) {
+ public PngChunkTEXT(final ImageInfo info) {
super(ID, info);
}
@@ -20,14 +20,14 @@ public class PngChunkTEXT extends PngChunkTextVar {
public ChunkRaw createRawChunk() {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
- byte[] b = (key + "\0" + val).getBytes(PngHelperInternal.charsetLatin1);
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = (key + "\0" + val).getBytes(PngHelperInternal.charsetLatin1);
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int i;
for (i = 0; i < c.data.length; i++)
if (c.data[i] == 0)
@@ -38,8 +38,8 @@ public class PngChunkTEXT extends PngChunkTextVar {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTEXT otherx = (PngChunkTEXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTEXT otherx = (PngChunkTEXT) other;
key = otherx.key;
val = otherx.val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
index 8f34c78fe..850fb649f 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
@@ -17,7 +17,7 @@ public class PngChunkTIME extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11tIME
private int year, mon, day, hour, min, sec;
- public PngChunkTIME(ImageInfo info) {
+ public PngChunkTIME(final ImageInfo info) {
super(ID, info);
}
@@ -28,7 +28,7 @@ public class PngChunkTIME extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(7, true);
+ final ChunkRaw c = createEmptyChunk(7, true);
PngHelperInternal.writeInt2tobytes(year, c.data, 0);
c.data[2] = (byte) mon;
c.data[3] = (byte) day;
@@ -39,7 +39,7 @@ public class PngChunkTIME extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 7)
throw new PngjException("bad chunk " + chunk);
year = PngHelperInternal.readInt2fromBytes(chunk.data, 0);
@@ -51,8 +51,8 @@ public class PngChunkTIME extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTIME x = (PngChunkTIME) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTIME x = (PngChunkTIME) other;
year = x.year;
mon = x.mon;
day = x.day;
@@ -61,8 +61,8 @@ public class PngChunkTIME extends PngChunkSingle {
sec = x.sec;
}
- public void setNow(int secsAgo) {
- Calendar d = Calendar.getInstance();
+ public void setNow(final int secsAgo) {
+ final Calendar d = Calendar.getInstance();
d.setTimeInMillis(System.currentTimeMillis() - 1000 * (long) secsAgo);
year = d.get(Calendar.YEAR);
mon = d.get(Calendar.MONTH) + 1;
@@ -72,7 +72,7 @@ public class PngChunkTIME extends PngChunkSingle {
sec = d.get(Calendar.SECOND);
}
- public void setYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx) {
+ public void setYMDHMS(final int yearx, final int monx, final int dayx, final int hourx, final int minx, final int secx) {
year = yearx;
mon = monx;
day = dayx;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
index 867e34861..5e10c041b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
@@ -21,7 +21,7 @@ public class PngChunkTRNS extends PngChunkSingle {
private int red, green, blue;
private int[] paletteAlpha = new int[] {};
- public PngChunkTRNS(ImageInfo info) {
+ public PngChunkTRNS(final ImageInfo info) {
super(ID, info);
}
@@ -51,14 +51,14 @@ public class PngChunkTRNS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (imgInfo.greyscale) {
gray = PngHelperInternal.readInt2fromBytes(c.data, 0);
} else if (imgInfo.indexed) {
- int nentries = c.data.length;
+ final int nentries = c.data.length;
paletteAlpha = new int[nentries];
for (int n = 0; n < nentries; n++) {
- paletteAlpha[n] = (int) (c.data[n] & 0xff);
+ paletteAlpha[n] = c.data[n] & 0xff;
}
} else {
red = PngHelperInternal.readInt2fromBytes(c.data, 0);
@@ -68,8 +68,8 @@ public class PngChunkTRNS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTRNS otherx = (PngChunkTRNS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTRNS otherx = (PngChunkTRNS) other;
gray = otherx.gray;
red = otherx.red;
green = otherx.green;
@@ -84,7 +84,7 @@ public class PngChunkTRNS extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
red = r;
@@ -98,7 +98,7 @@ public class PngChunkTRNS extends PngChunkSingle {
return new int[] { red, green, blue };
}
- public void setGray(int g) {
+ public void setGray(final int g) {
if (!imgInfo.greyscale)
throw new PngjException("only grayscale images support this");
gray = g;
@@ -113,7 +113,7 @@ public class PngChunkTRNS extends PngChunkSingle {
/**
* WARNING: non deep copy
*/
- public void setPalletteAlpha(int[] palAlpha) {
+ public void setPalletteAlpha(final int[] palAlpha) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images support this");
paletteAlpha = palAlpha;
@@ -122,7 +122,7 @@ public class PngChunkTRNS extends PngChunkSingle {
/**
* to use when only one pallete index is set as totally transparent
*/
- public void setIndexEntryAsTransparent(int palAlphaIndex) {
+ public void setIndexEntryAsTransparent(final int palAlphaIndex) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images support this");
paletteAlpha = new int[] { palAlphaIndex + 1 };
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
index ba3ffc30c..d00c29971 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
@@ -21,7 +21,7 @@ public abstract class PngChunkTextVar extends PngChunkMultiple {
public final static String KEY_Source = "Source"; // Device used to create the image
public final static String KEY_Comment = "Comment"; // Miscellaneous comment
- protected PngChunkTextVar(String id, ImageInfo info) {
+ protected PngChunkTextVar(final String id, final ImageInfo info) {
super(id, info);
}
@@ -51,7 +51,7 @@ public abstract class PngChunkTextVar extends PngChunkMultiple {
return val;
}
- public void setKeyVal(String key, String val) {
+ public void setKeyVal(final String key, final String val) {
this.key = key;
this.val = val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
index 3803428e6..693729e9b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
@@ -11,11 +11,11 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
private byte[] data;
- public PngChunkUNKNOWN(String id, ImageInfo info) {
+ public PngChunkUNKNOWN(final String id, final ImageInfo info) {
super(id, info);
}
- private PngChunkUNKNOWN(PngChunkUNKNOWN c, ImageInfo info) {
+ private PngChunkUNKNOWN(final PngChunkUNKNOWN c, final ImageInfo info) {
super(c.id, info);
System.arraycopy(c.data, 0, data, 0, c.data.length);
}
@@ -27,13 +27,13 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw p = createEmptyChunk(data.length, false);
+ final ChunkRaw p = createEmptyChunk(data.length, false);
p.data = this.data;
return p;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
data = c.data;
}
@@ -43,14 +43,14 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
}
/* does not copy! */
- public void setData(byte[] data) {
+ public void setData(final byte[] data) {
this.data = data;
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
// THIS SHOULD NOT BE CALLED IF ALREADY CLONED WITH COPY CONSTRUCTOR
- PngChunkUNKNOWN c = (PngChunkUNKNOWN) other;
+ final PngChunkUNKNOWN c = (PngChunkUNKNOWN) other;
data = c.data; // not deep copy
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
index 64593eae4..c1dfdeb33 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
@@ -16,7 +16,7 @@ public class PngChunkZTXT extends PngChunkTextVar {
public final static String ID = ChunkHelper.zTXt;
// http://www.w3.org/TR/PNG/#11zTXt
- public PngChunkZTXT(ImageInfo info) {
+ public PngChunkZTXT(final ImageInfo info) {
super(ID, info);
}
@@ -25,23 +25,23 @@ public class PngChunkZTXT extends PngChunkTextVar {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(key.getBytes(PngHelperInternal.charsetLatin1));
ba.write(0); // separator
ba.write(0); // compression method: 0
- byte[] textbytes = ChunkHelper.compressBytes(val.getBytes(PngHelperInternal.charsetLatin1), true);
+ final byte[] textbytes = ChunkHelper.compressBytes(val.getBytes(PngHelperInternal.charsetLatin1), true);
ba.write(textbytes);
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int nullsep = -1;
for (int i = 0; i < c.data.length; i++) { // look for first zero
if (c.data[i] != 0)
@@ -52,16 +52,16 @@ public class PngChunkZTXT extends PngChunkTextVar {
if (nullsep < 0 || nullsep > c.data.length - 2)
throw new PngjException("bad zTXt chunk: no separator found");
key = new String(c.data, 0, nullsep, PngHelperInternal.charsetLatin1);
- int compmet = (int) c.data[nullsep + 1];
+ final int compmet = c.data[nullsep + 1];
if (compmet != 0)
throw new PngjException("bad zTXt chunk: unknown compression method");
- byte[] uncomp = ChunkHelper.compressBytes(c.data, nullsep + 2, c.data.length - nullsep - 2, false); // uncompress
+ final byte[] uncomp = ChunkHelper.compressBytes(c.data, nullsep + 2, c.data.length - nullsep - 2, false); // uncompress
val = new String(uncomp, PngHelperInternal.charsetLatin1);
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkZTXT otherx = (PngChunkZTXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkZTXT otherx = (PngChunkZTXT) other;
key = otherx.key;
val = otherx.val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
index 139603448..bba2b3e7c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
@@ -19,7 +19,7 @@ public class PngMetadata {
private final ChunksList chunkList;
private final boolean readonly;
- public PngMetadata(ChunksList chunks) {
+ public PngMetadata(final ChunksList chunks) {
this.chunkList = chunks;
if (chunks instanceof ChunksListForWrite) {
this.readonly = false;
@@ -35,14 +35,14 @@ public class PngMetadata {
* and if so, overwrites it. However if that not check for already written
* chunks.
*/
- public void queueChunk(final PngChunk c, boolean lazyOverwrite) {
- ChunksListForWrite cl = getChunkListW();
+ public void queueChunk(final PngChunk c, final boolean lazyOverwrite) {
+ final ChunksListForWrite cl = getChunkListW();
if (readonly)
throw new PngjException("cannot set chunk : readonly metadata");
if (lazyOverwrite) {
ChunkHelper.trimList(cl.getQueuedChunks(), new ChunkPredicate() {
@Override
- public boolean match(PngChunk c2) {
+ public boolean match(final PngChunk c2) {
return ChunkHelper.equivalent(c, c2);
}
});
@@ -66,19 +66,19 @@ public class PngMetadata {
* returns -1 if not found or dimension unknown
*/
public double[] getDpi() {
- PngChunk c = chunkList.getById1(ChunkHelper.pHYs, true);
+ final PngChunk c = chunkList.getById1(ChunkHelper.pHYs, true);
if (c == null)
return new double[] { -1, -1 };
else
return ((PngChunkPHYS) c).getAsDpi2();
}
- public void setDpi(double x) {
+ public void setDpi(final double x) {
setDpi(x, x);
}
- public void setDpi(double x, double y) {
- PngChunkPHYS c = new PngChunkPHYS(chunkList.imageInfo);
+ public void setDpi(final double x, final double y) {
+ final PngChunkPHYS c = new PngChunkPHYS(chunkList.imageInfo);
c.setAsDpi2(x, y);
queueChunk(c);
}
@@ -92,8 +92,8 @@ public class PngMetadata {
* @return Returns the created-queued chunk, just in case you want to
* examine or modify it
*/
- public PngChunkTIME setTimeNow(int secsAgo) {
- PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
+ public PngChunkTIME setTimeNow(final int secsAgo) {
+ final PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
c.setNow(secsAgo);
queueChunk(c);
return c;
@@ -110,8 +110,8 @@ public class PngMetadata {
* @return Returns the created-queued chunk, just in case you want to
* examine or modify it
*/
- public PngChunkTIME setTimeYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx) {
- PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
+ public PngChunkTIME setTimeYMDHMS(final int yearx, final int monx, final int dayx, final int hourx, final int minx, final int secx) {
+ final PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
c.setYMDHMS(yearx, monx, dayx, hourx, minx, secx);
queueChunk(c, true);
return c;
@@ -125,7 +125,7 @@ public class PngMetadata {
}
public String getTimeAsString() {
- PngChunkTIME c = getTime();
+ final PngChunkTIME c = getTime();
return c == null ? "" : c.getAsString();
}
@@ -144,7 +144,7 @@ public class PngMetadata {
* @return Returns the created-queued chunks, just in case you want to
* examine, touch it
*/
- public PngChunkTextVar setText(String k, String val, boolean useLatin1, boolean compress) {
+ public PngChunkTextVar setText(final String k, final String val, final boolean useLatin1, final boolean compress) {
if (compress && !useLatin1)
throw new PngjException("cannot compress non latin text");
PngChunkTextVar c;
@@ -163,7 +163,7 @@ public class PngMetadata {
return c;
}
- public PngChunkTextVar setText(String k, String val) {
+ public PngChunkTextVar setText(final String k, final String val) {
return setText(k, val, false, false);
}
@@ -175,8 +175,9 @@ public class PngMetadata {
* Warning: this does not check the "lang" key of iTxt
*/
@SuppressWarnings("unchecked")
- public List extends PngChunkTextVar> getTxtsForKey(String k) {
+ public List extends PngChunkTextVar> getTxtsForKey(final String k) {
@SuppressWarnings("rawtypes")
+ final
List c = new ArrayList();
c.addAll(chunkList.getById(ChunkHelper.tEXt, k));
c.addAll(chunkList.getById(ChunkHelper.zTXt, k));
@@ -190,12 +191,12 @@ public class PngMetadata {
*
* Use getTxtsForKey() if you don't want this behaviour
*/
- public String getTxtForKey(String k) {
- List extends PngChunkTextVar> li = getTxtsForKey(k);
+ public String getTxtForKey(final String k) {
+ final List extends PngChunkTextVar> li = getTxtsForKey(k);
if (li.isEmpty())
return "";
- StringBuilder t = new StringBuilder();
- for (PngChunkTextVar c : li)
+ final StringBuilder t = new StringBuilder();
+ for (final PngChunkTextVar c : li)
t.append(c.getVal()).append("\n");
return t.toString().trim();
}
@@ -214,7 +215,7 @@ public class PngMetadata {
* the caller, who should fill its entries
*/
public PngChunkPLTE createPLTEChunk() {
- PngChunkPLTE plte = new PngChunkPLTE(chunkList.imageInfo);
+ final PngChunkPLTE plte = new PngChunkPLTE(chunkList.imageInfo);
queueChunk(plte);
return plte;
}
@@ -233,7 +234,7 @@ public class PngMetadata {
* caller, who should fill its entries
*/
public PngChunkTRNS createTRNSChunk() {
- PngChunkTRNS trns = new PngChunkTRNS(chunkList.imageInfo);
+ final PngChunkTRNS trns = new PngChunkTRNS(chunkList.imageInfo);
queueChunk(trns);
return trns;
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
index feacdb951..25b73a2a6 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
@@ -44,7 +44,7 @@ public class WGLGLCapabilities extends GLCapabilities {
final private int pfdID;
private int arb_pixelformat; // -1 PFD, 0 NOP, 1 ARB
- public WGLGLCapabilities(PIXELFORMATDESCRIPTOR pfd, int pfdID, GLProfile glp) {
+ public WGLGLCapabilities(final PIXELFORMATDESCRIPTOR pfd, final int pfdID, final GLProfile glp) {
super(glp);
this.pfd = pfd;
this.pfdID = pfdID;
@@ -78,9 +78,9 @@ public class WGLGLCapabilities extends GLCapabilities {
return true;
}
- public static final String PFD2String(PIXELFORMATDESCRIPTOR pfd, int pfdID) {
+ public static final String PFD2String(final PIXELFORMATDESCRIPTOR pfd, final int pfdID) {
final int dwFlags = pfd.getDwFlags();
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
boolean sep = false;
if( 0 != (GDI.PFD_DRAW_TO_WINDOW & dwFlags ) ) {
@@ -224,7 +224,7 @@ public class WGLGLCapabilities extends GLCapabilities {
public Object clone() {
try {
return super.clone();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new GLException(e);
}
}
@@ -237,7 +237,7 @@ public class WGLGLCapabilities extends GLCapabilities {
final public boolean isSet() { return 0 != arb_pixelformat; }
@Override
- final public int getVisualID(VIDType type) throws NativeWindowException {
+ final public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case NATIVE:
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
index 6454a34b5..08ff0e05b 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
@@ -27,6 +27,8 @@
*/
package jogamp.opengl.windows.wgl;
+import com.jogamp.common.util.PropertyAccess;
+
import jogamp.nativewindow.windows.GDI;
import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR;
import jogamp.opengl.Debug;
@@ -52,41 +54,41 @@ public class WGLUtil {
static {
Debug.initSingleton();
- USE_WGLVersion_Of_5WGLGDIFuncSet = Debug.isPropertyDefined("jogl.windows.useWGLVersionOf5WGLGDIFuncSet", true);
+ USE_WGLVersion_Of_5WGLGDIFuncSet = PropertyAccess.isPropertyDefined("jogl.windows.useWGLVersionOf5WGLGDIFuncSet", true);
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
System.err.println("Use WGL version of 5 WGL/GDI functions.");
}
}
- public static int ChoosePixelFormat(long hdc, PIXELFORMATDESCRIPTOR pfd) {
+ public static int ChoosePixelFormat(final long hdc, final PIXELFORMATDESCRIPTOR pfd) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglChoosePixelFormat(hdc, pfd);
} else {
return GDI.ChoosePixelFormat(hdc, pfd);
}
}
- public static int DescribePixelFormat(long hdc, int pfdid, int pfdSize, PIXELFORMATDESCRIPTOR pfd) {
+ public static int DescribePixelFormat(final long hdc, final int pfdid, final int pfdSize, final PIXELFORMATDESCRIPTOR pfd) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglDescribePixelFormat(hdc, pfdid, pfdSize, pfd);
} else {
return GDI.DescribePixelFormat(hdc, pfdid, pfdSize, pfd);
}
}
- public static int GetPixelFormat(long hdc) {
+ public static int GetPixelFormat(final long hdc) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglGetPixelFormat(hdc);
} else {
return GDI.GetPixelFormat(hdc);
}
}
- public static boolean SetPixelFormat(long hdc, int pfdid, PIXELFORMATDESCRIPTOR pfd) {
+ public static boolean SetPixelFormat(final long hdc, final int pfdid, final PIXELFORMATDESCRIPTOR pfd) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglSetPixelFormat(hdc, pfdid, pfd);
} else {
return GDI.SetPixelFormat(hdc, pfdid, pfd);
}
}
- public static boolean SwapBuffers(long hdc) {
+ public static boolean SwapBuffers(final long hdc) {
if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
return WGL.wglSwapBuffers(hdc);
} else {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
index 1ad3fed8d..0878f186c 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
@@ -60,11 +60,11 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
private long origbitmap;
private long hbitmap;
- private WindowsBitmapWGLDrawable(GLDrawableFactory factory, NativeSurface comp) {
+ private WindowsBitmapWGLDrawable(final GLDrawableFactory factory, final NativeSurface comp) {
super(factory, comp, false);
}
- protected static WindowsBitmapWGLDrawable create(GLDrawableFactory factory, NativeSurface comp) {
+ protected static WindowsBitmapWGLDrawable create(final GLDrawableFactory factory, final NativeSurface comp) {
final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)comp.getGraphicsConfiguration();
final AbstractGraphicsDevice aDevice = config.getScreen().getDevice();
if( !GLProfile.isAvailable(aDevice, GLProfile.GL2) ) {
@@ -94,7 +94,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new WindowsWGLContext(this, shareWith);
}
@@ -146,7 +146,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
hbitmap = GDI.CreateDIBSection(0, info, GDI.DIB_RGB_COLORS, pb, 0, 0);
werr = GDI.GetLastError();
if(DEBUG) {
- long p = ( pb.capacity() > 0 ) ? pb.get(0) : 0;
+ final long p = ( pb.capacity() > 0 ) ? pb.get(0) : 0;
System.err.println("WindowsBitmapWGLDrawable: pb sz/ptr "+pb.capacity() + ", "+toHexString(p));
System.err.println("WindowsBitmapWGLDrawable: " + width+"x"+height +
", bpp " + bitsPerPixelIn + " -> " + bitsPerPixel +
@@ -187,7 +187,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
}
protected void destroyBitmap() {
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
if (ns.getSurfaceHandle() != 0) {
// Must destroy bitmap and device context
GDI.SelectObject(ns.getSurfaceHandle(), origbitmap);
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
index 2047a91b5..4cebc6357 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
@@ -56,7 +56,7 @@ import jogamp.opengl.GLContextShareSet;
public class WindowsExternalWGLContext extends WindowsWGLContext {
- private WindowsExternalWGLContext(Drawable drawable, long ctx, WindowsWGLGraphicsConfiguration cfg) {
+ private WindowsExternalWGLContext(final Drawable drawable, final long ctx, final WindowsWGLGraphicsConfiguration cfg) {
super(drawable, null);
this.contextHandle = ctx;
if (DEBUG) {
@@ -69,7 +69,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
}
- protected static WindowsExternalWGLContext create(GLDrawableFactory factory, GLProfile glp) {
+ protected static WindowsExternalWGLContext create(final GLDrawableFactory factory, final GLProfile glp) {
if(DEBUG) {
System.err.println("WindowsExternalWGLContext 0: werr: " + GDI.GetLastError());
}
@@ -83,7 +83,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
if (0 == hdc) {
throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError());
}
- AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
+ final AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
WindowsWGLGraphicsConfiguration cfg;
final int pfdID = WGLUtil.GetPixelFormat(hdc);
if (0 == pfdID) {
@@ -119,12 +119,12 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
// Need to provide the display connection to extension querying APIs
static class Drawable extends WindowsWGLDrawable {
- Drawable(GLDrawableFactory factory, NativeSurface comp) {
+ Drawable(final GLDrawableFactory factory, final NativeSurface comp) {
super(factory, comp, true);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
throw new GLException("Should not call this");
}
@@ -138,7 +138,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
throw new GLException("Should not call this");
}
- public void setSize(int width, int height) {
+ public void setSize(final int width, final int height) {
throw new GLException("Should not call this");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
index 11e0202fd..1378bcf3e 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
@@ -55,16 +55,16 @@ import jogamp.nativewindow.windows.GDI;
public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
- private WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+ private WindowsExternalWGLDrawable(final GLDrawableFactory factory, final NativeSurface component) {
super(factory, component, true);
}
- protected static WindowsExternalWGLDrawable create(GLDrawableFactory factory, GLProfile glp) {
- long hdc = WGL.wglGetCurrentDC();
+ protected static WindowsExternalWGLDrawable create(final GLDrawableFactory factory, final GLProfile glp) {
+ final long hdc = WGL.wglGetCurrentDC();
if (0==hdc) {
throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError());
}
- int pfdID = WGLUtil.GetPixelFormat(hdc);
+ final int pfdID = WGLUtil.GetPixelFormat(hdc);
if (pfdID == 0) {
throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat, werr " + GDI.GetLastError());
}
@@ -76,11 +76,11 @@ public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new WindowsWGLContext(this, shareWith);
}
- public void setSize(int newWidth, int newHeight) {
+ public void setSize(final int newWidth, final int newHeight) {
throw new GLException("Should not call this");
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
index 61fb787c6..0d0681df9 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
@@ -45,12 +45,12 @@ import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawableFactory;
public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable {
- protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+ protected WindowsOnscreenWGLDrawable(final GLDrawableFactory factory, final NativeSurface component) {
super(factory, component, false);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new WindowsWGLContext(this, shareWith);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
index e0bf1f50b..597f51178 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -65,7 +65,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
// needed to destroy pbuffer
private long buffer; // pbuffer handle
- protected WindowsPbufferWGLDrawable(GLDrawableFactory factory, NativeSurface target) {
+ protected WindowsPbufferWGLDrawable(final GLDrawableFactory factory, final NativeSurface target) {
super(factory, target, false);
}
@@ -79,14 +79,14 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new WindowsWGLContext(this, shareWith);
}
protected void destroyPbuffer() {
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
if(0!=buffer) {
- WGLExt wglExt = cachedWGLExt;
+ final WGLExt wglExt = cachedWGLExt;
if (ns.getSurfaceHandle() != 0) {
// Must release DC and pbuffer
// NOTE that since the context is not current, glGetError() can
@@ -112,15 +112,15 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
}
private void createPbuffer() {
- WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration();
- SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
- NativeSurface sharedSurface = sharedResource.getDrawable().getNativeSurface();
+ final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration();
+ final SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
+ final NativeSurface sharedSurface = sharedResource.getDrawable().getNativeSurface();
if (NativeSurface.LOCK_SURFACE_NOT_READY >= sharedSurface.lockSurface()) {
throw new NativeWindowException("Could not lock (sharedSurface): "+this);
}
try {
- long sharedHdc = sharedSurface.getSurfaceHandle();
- WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
+ final long sharedHdc = sharedSurface.getSurfaceHandle();
+ final WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
if (DEBUG) {
System.out.println(getThreadName()+": Pbuffer config: " + config);
@@ -130,7 +130,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
final IntBuffer iattributes = Buffers.newDirectIntBuffer(2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS);
final FloatBuffer fattributes = Buffers.newDirectFloatBuffer(1);
- int[] floatModeTmp = new int[1];
+ final int[] floatModeTmp = new int[1];
int niattribs = 0;
final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
@@ -162,7 +162,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
if (DEBUG) {
System.err.println("" + nformats + " suitable pixel formats found");
for (int i = 0; i < nformats; i++) {
- WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
+ final WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
sharedHdc, pformats.get(i), winattrPbuffer);
System.err.println("pixel format " + pformats.get(i) + " (index " + i + "): " + dbgCaps);
}
@@ -174,7 +174,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
int whichFormat;
// Loop is a workaround for bugs in NVidia's recent drivers
for (whichFormat = 0; whichFormat < nformats; whichFormat++) {
- int format = pformats.get(whichFormat);
+ final int format = pformats.get(whichFormat);
// Create the p-buffer.
niattribs = 0;
@@ -196,12 +196,12 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
}
// Get the device context.
- long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
+ final long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
if (tmpHdc == 0) {
throw new GLException("pbuffer creation error: wglGetPbufferDC() failed");
}
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
// Set up instance variables
buffer = tmpBuffer;
((MutableSurface)ns).setSurfaceHandle(tmpHdc);
@@ -209,7 +209,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
// Re-query chosen pixel format
{
- WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
+ final WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
sharedHdc, pfdid, winattrPbuffer);
if(null == newCaps) {
throw new GLException("pbuffer creation error: unable to re-query chosen PFD ID: " + pfdid + ", hdc " + GLDrawableImpl.toHexString(tmpHdc));
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
index 0df986f77..9c5a5b272 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -87,13 +87,13 @@ public class WindowsWGLContext extends GLContextImpl {
}
// FIXME: figure out how to hook back in the Java 2D / JOGL bridge
- WindowsWGLContext(GLDrawableImpl drawable,
- GLContext shareWith) {
+ WindowsWGLContext(final GLDrawableImpl drawable,
+ final GLContext shareWith) {
super(drawable, shareWith);
}
@Override
- protected void resetStates(boolean isInit) {
+ protected void resetStates(final boolean isInit) {
wglGetExtensionsStringEXTInitialized=false;
wglGetExtensionsStringEXTAvailable=false;
wglGLReadDrawableAvailableSet=false;
@@ -123,9 +123,9 @@ public class WindowsWGLContext extends GLContextImpl {
@Override
public final boolean isGLReadDrawableAvailable() {
if(!wglGLReadDrawableAvailableSet && null != getWGLExtProcAddressTable()) {
- WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
- AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
- AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
+ final AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
switch( factory.isReadDrawableAvailable(device) ) {
case 1:
wglGLReadDrawableAvailable = true;
@@ -140,7 +140,7 @@ public class WindowsWGLContext extends GLContextImpl {
return wglGLReadDrawableAvailable;
}
- private final boolean wglMakeContextCurrent(long hDrawDC, long hReadDC, long ctx) {
+ private final boolean wglMakeContextCurrent(final long hDrawDC, final long hReadDC, final long ctx) {
boolean ok = false;
if(wglGLReadDrawableAvailable) {
// needs initilized WGL ProcAddress table
@@ -151,9 +151,9 @@ public class WindowsWGLContext extends GLContextImpl {
// should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl
throw new InternalError("Given readDrawable but no driver support");
}
- int werr = ( !ok ) ? GDI.GetLastError() : GDI.ERROR_SUCCESS;
+ final int werr = ( !ok ) ? GDI.GetLastError() : GDI.ERROR_SUCCESS;
if(DEBUG && !ok) {
- Throwable t = new Throwable ("Info: wglMakeContextCurrent draw "+
+ final Throwable t = new Throwable ("Info: wglMakeContextCurrent draw "+
GLContext.toHexString(hDrawDC) + ", read " + GLContext.toHexString(hReadDC) +
", ctx " + GLContext.toHexString(ctx) + ", werr " + werr);
t.printStackTrace();
@@ -182,26 +182,26 @@ public class WindowsWGLContext extends GLContextImpl {
protected Map getExtensionNameMap() { return extensionNameMap; }
@Override
- protected void destroyContextARBImpl(long context) {
+ protected void destroyContextARBImpl(final long context) {
WGL.wglMakeCurrent(0, 0);
WGL.wglDeleteContext(context);
}
@Override
- protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+ protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
if( null == getWGLExtProcAddressTable()) {
updateGLXProcAddressTable();
}
- WGLExt _wglExt = getWGLExt();
+ final WGLExt _wglExt = getWGLExt();
if(DEBUG) {
System.err.println(getThreadName()+" - WindowWGLContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") +
", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+
", wglCreateContextAttribsARB: "+toHexString(wglExtProcAddressTable._addressof_wglCreateContextAttribsARB));
}
- boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
- boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
- boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
+ final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+ final boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
+ final boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
long ctx=0;
@@ -210,7 +210,7 @@ public class WindowsWGLContext extends GLContextImpl {
/* WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, */
- int attribs[] = {
+ final int attribs[] = {
/* 0 */ WGLExt.WGL_CONTEXT_MAJOR_VERSION_ARB, major,
/* 2 */ WGLExt.WGL_CONTEXT_MINOR_VERSION_ARB, minor,
/* 4 */ WGLExt.WGL_CONTEXT_FLAGS_ARB, 0,
@@ -239,9 +239,9 @@ public class WindowsWGLContext extends GLContextImpl {
try {
final IntBuffer attribsNIO = Buffers.newDirectIntBuffer(attribs);
ctx = _wglExt.wglCreateContextAttribsARB(drawable.getHandle(), share, attribsNIO);
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
if(DEBUG) {
- Throwable t = new Throwable("Info: WindowWGLContext.createContextARBImpl wglCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
+ final Throwable t = new Throwable("Info: WindowWGLContext.createContextARBImpl wglCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
t.printStackTrace();
}
}
@@ -422,7 +422,7 @@ public class WindowsWGLContext extends GLContextImpl {
}
@Override
- protected void copyImpl(GLContext source, int mask) throws GLException {
+ protected void copyImpl(final GLContext source, final int mask) throws GLException {
if (!WGL.wglCopyContext(source.getHandle(), getHandle(), mask)) {
throw new GLException("wglCopyContext failed");
}
@@ -464,7 +464,7 @@ public class WindowsWGLContext extends GLContextImpl {
@Override
protected final StringBuilder getPlatformExtensionsStringImpl() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
if (!wglGetExtensionsStringEXTInitialized) {
wglGetExtensionsStringEXTAvailable = (WGL.wglGetProcAddress("wglGetExtensionsStringEXT") != 0);
@@ -477,26 +477,26 @@ public class WindowsWGLContext extends GLContextImpl {
}
@Override
- protected boolean setSwapIntervalImpl(int interval) {
- WGLExt wglExt = getWGLExt();
+ protected boolean setSwapIntervalImpl(final int interval) {
+ final WGLExt wglExt = getWGLExt();
if(0==hasSwapIntervalSGI) {
try {
hasSwapIntervalSGI = wglExt.isExtensionAvailable("WGL_EXT_swap_control")?1:-1;
- } catch (Throwable t) { hasSwapIntervalSGI=1; }
+ } catch (final Throwable t) { hasSwapIntervalSGI=1; }
}
if (hasSwapIntervalSGI>0) {
try {
return wglExt.wglSwapIntervalEXT(interval);
- } catch (Throwable t) { hasSwapIntervalSGI=-1; }
+ } catch (final Throwable t) { hasSwapIntervalSGI=-1; }
}
return false;
}
- private final int initSwapGroupImpl(WGLExt wglExt) {
+ private final int initSwapGroupImpl(final WGLExt wglExt) {
if(0==hasSwapGroupNV) {
try {
hasSwapGroupNV = wglExt.isExtensionAvailable("WGL_NV_swap_group")?1:-1;
- } catch (Throwable t) { hasSwapGroupNV=1; }
+ } catch (final Throwable t) { hasSwapGroupNV=1; }
if(DEBUG) {
System.err.println("initSwapGroupImpl: hasSwapGroupNV: "+hasSwapGroupNV);
}
@@ -505,10 +505,10 @@ public class WindowsWGLContext extends GLContextImpl {
}
@Override
- protected final boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset,
- int[] maxBarriers, int maxBarriers_offset) {
+ protected final boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset,
+ final int[] maxBarriers, final int maxBarriers_offset) {
boolean res = false;
- WGLExt wglExt = getWGLExt();
+ final WGLExt wglExt = getWGLExt();
if (initSwapGroupImpl(wglExt)>0) {
final NativeSurface ns = drawable.getNativeSurface();
try {
@@ -520,47 +520,47 @@ public class WindowsWGLContext extends GLContextImpl {
maxBarriersNIO.get(maxGroups, maxGroups_offset, maxBarriersNIO.remaining());
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- protected final boolean joinSwapGroupImpl(int group) {
+ protected final boolean joinSwapGroupImpl(final int group) {
boolean res = false;
- WGLExt wglExt = getWGLExt();
+ final WGLExt wglExt = getWGLExt();
if (initSwapGroupImpl(wglExt)>0) {
try {
if( wglExt.wglJoinSwapGroupNV(drawable.getHandle(), group) ) {
currentSwapGroup = group;
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- protected final boolean bindSwapBarrierImpl(int group, int barrier) {
+ protected final boolean bindSwapBarrierImpl(final int group, final int barrier) {
boolean res = false;
- WGLExt wglExt = getWGLExt();
+ final WGLExt wglExt = getWGLExt();
if (initSwapGroupImpl(wglExt)>0) {
try {
if( wglExt.wglBindSwapBarrierNV(group, barrier) ) {
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+ public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
return getWGLExt().wglAllocateMemoryNV(size, readFrequency, writeFrequency, priority);
}
@Override
- public final void glFreeMemoryNV(ByteBuffer pointer) {
+ public final void glFreeMemoryNV(final ByteBuffer pointer) {
getWGLExt().wglFreeMemoryNV(pointer);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
index 66071cbe1..00b048e38 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
@@ -44,6 +44,8 @@ import javax.media.nativewindow.NativeSurface;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLException;
+import com.jogamp.common.util.PropertyAccess;
+
import jogamp.nativewindow.windows.GDI;
import jogamp.opengl.Debug;
import jogamp.opengl.GLDrawableImpl;
@@ -55,22 +57,22 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
static {
Debug.initSingleton();
- PROFILING = Debug.isPropertyDefined("jogl.debug.GLDrawable.profiling", true);
+ PROFILING = PropertyAccess.isPropertyDefined("jogl.debug.GLDrawable.profiling", true);
}
private static final int PROFILING_TICKS = 200;
private int profilingSwapBuffersTicks;
private long profilingSwapBuffersTime;
- public WindowsWGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+ public WindowsWGLDrawable(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
super(factory, comp, realized);
}
@Override
protected void setRealizedImpl() {
if(realized) {
- NativeSurface ns = getNativeSurface();
- WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration();
+ final NativeSurface ns = getNativeSurface();
+ final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration();
config.updateGraphicsConfiguration(getFactory(), ns, null);
if (DEBUG) {
System.err.println(getThreadName()+": WindowsWGLDrawable.setRealized(true): "+config);
@@ -79,7 +81,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
}
@Override
- protected final void swapBuffersImpl(boolean doubleBuffered) {
+ protected final void swapBuffersImpl(final boolean doubleBuffered) {
if(doubleBuffered) {
final long t0;
if (PROFILING) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 7fa8775cf..4d8c85137 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -99,7 +99,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
if(null!=tmp && tmp.isLibComplete()) {
WGL.getWGLProcAddressTable().reset(tmp);
}
- } catch (Exception ex) {
+ } catch (final Exception ex) {
tmp = null;
if(DEBUG) {
ex.printStackTrace();
@@ -121,7 +121,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
try {
ReflectionUtil.callStaticMethod("jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory",
"registerFactory", null, null, getClass().getClassLoader());
- } catch (Exception jre) { /* n/a .. */ }
+ } catch (final Exception jre) { /* n/a .. */ }
}
sharedMap = new HashMap();
@@ -164,7 +164,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+ public GLDynamicLookupHelper getGLDynamicLookupHelper(final int profile) {
return windowsWGLDynamicLookupHelper;
}
@@ -180,7 +180,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
protected void enterThreadCriticalZone() {
synchronized (sysMask) {
if( 0 == processAffinityChanges) {
- long pid = GDI.GetCurrentProcess();
+ final long pid = GDI.GetCurrentProcess();
if ( GDI.GetProcessAffinityMask(pid, procMask, sysMask) ) {
if(DEBUG) {
System.err.println("WindowsWGLDrawableFactory.enterThreadCriticalZone() - 0x" + Long.toHexString(pid) + " - " + getThreadName());
@@ -197,7 +197,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
protected void leaveThreadCriticalZone() {
synchronized (sysMask) {
if( 0 != processAffinityChanges) {
- long pid = GDI.GetCurrentProcess();
+ final long pid = GDI.GetCurrentProcess();
if( pid != processAffinityChanges) {
throw new GLException("PID doesn't match: set PID 0x" + Long.toHexString(processAffinityChanges) +
" this PID 0x" + Long.toHexString(pid) );
@@ -220,8 +220,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
private GLDrawableImpl drawable;
private GLContextImpl context;
- SharedResource(WindowsGraphicsDevice dev, AbstractGraphicsScreen scrn, GLDrawableImpl draw, GLContextImpl ctx,
- boolean arbPixelFormat, boolean arbMultisample, boolean arbPBuffer, boolean arbReadDrawable) {
+ SharedResource(final WindowsGraphicsDevice dev, final AbstractGraphicsScreen scrn, final GLDrawableImpl draw, final GLContextImpl ctx,
+ final boolean arbPixelFormat, final boolean arbMultisample, final boolean arbPBuffer, final boolean arbReadDrawable) {
device = dev;
screen = scrn;
drawable = draw;
@@ -261,11 +261,11 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
sharedMap.clear();
}
@Override
- public SharedResourceRunner.Resource mapPut(String connection, SharedResourceRunner.Resource resource) {
+ public SharedResourceRunner.Resource mapPut(final String connection, final SharedResourceRunner.Resource resource) {
return sharedMap.put(connection, resource);
}
@Override
- public SharedResourceRunner.Resource mapGet(String connection) {
+ public SharedResourceRunner.Resource mapGet(final String connection) {
return sharedMap.get(connection);
}
@Override
@@ -276,12 +276,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public boolean isDeviceSupported(String connection) {
+ public boolean isDeviceSupported(final String connection) {
return true;
}
@Override
- public SharedResourceRunner.Resource createSharedResource(String connection) {
+ public SharedResourceRunner.Resource createSharedResource(final String connection) {
final WindowsGraphicsDevice sharedDevice = new WindowsGraphicsDevice(connection, AbstractGraphicsDevice.DEFAULT_UNIT);
sharedDevice.lock();
try {
@@ -324,7 +324,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
return new SharedResource(sharedDevice, absScreen, sharedDrawable, sharedContext,
hasARBPixelFormat, hasARBMultisample,
hasARBPBuffer, hasARBReadDrawableAvailable);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources for "+connection, t);
} finally {
sharedDevice.unlock();
@@ -332,8 +332,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public void releaseSharedResource(SharedResourceRunner.Resource shared) {
- SharedResource sr = (SharedResource) shared;
+ public void releaseSharedResource(final SharedResourceRunner.Resource shared) {
+ final SharedResource sr = (SharedResource) shared;
if (DEBUG) {
System.err.println("Shutdown Shared:");
System.err.println("Device : " + sr.device);
@@ -369,7 +369,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+ public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
if(null!=windowsWGLDynamicLookupHelper && device instanceof WindowsGraphicsDevice) {
return true;
}
@@ -389,12 +389,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice device) {
+ protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice device) {
return (SharedResource) sharedResourceRunner.getOrCreateShared(device);
}
- protected final WindowsWGLDrawable getOrCreateSharedDrawable(AbstractGraphicsDevice device) {
- SharedResourceRunner.Resource sr = getOrCreateSharedResourceImpl(device);
+ protected final WindowsWGLDrawable getOrCreateSharedDrawable(final AbstractGraphicsDevice device) {
+ final SharedResourceRunner.Resource sr = getOrCreateSharedResourceImpl(device);
if(null!=sr) {
return (WindowsWGLDrawable) sr.getDrawable();
}
@@ -402,12 +402,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected List getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+ protected List getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
return WindowsWGLGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
}
@Override
- protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+ protected final GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -419,8 +419,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
- AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
- GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+ final AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
+ final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
if(!chosenCaps.isPBuffer()) {
return WindowsBitmapWGLDrawable.create(this, target);
}
@@ -435,7 +435,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
*/
final SharedResource sr = getOrCreateSharedResourceImpl(device);
if(null!=sr) {
- GLContext lastContext = GLContext.getCurrent();
+ final GLContext lastContext = GLContext.getCurrent();
if (lastContext != null) {
lastContext.release();
}
@@ -458,8 +458,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
* @return 1 if read drawable extension is available, 0 if not
* and -1 if undefined yet, ie no shared device exist at this point.
*/
- public final int isReadDrawableAvailable(AbstractGraphicsDevice device) {
- SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
+ public final int isReadDrawableAvailable(final AbstractGraphicsDevice device) {
+ final SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
if(null!=sr) {
return sr.hasReadDrawable() ? 1 : 0 ;
}
@@ -467,8 +467,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
- SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
+ public final boolean canCreateGLPbuffer(final AbstractGraphicsDevice device, final GLProfile glp) {
+ final SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
if(null!=sr) {
return sr.hasARBPBuffer();
}
@@ -476,9 +476,9 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+ protected final ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
final WindowsGraphicsDevice device;
if(createNewDevice || !(deviceReq instanceof WindowsGraphicsDevice)) {
device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
@@ -494,8 +494,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+ public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
final WindowsGraphicsDevice device;
if( createNewDevice || !(deviceReq instanceof WindowsGraphicsDevice) ) {
device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
@@ -512,7 +512,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+ protected final ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
final WindowsGraphicsDevice device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, screenIdx);
final WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen);
@@ -525,7 +525,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+ public final boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
return true;
}
@@ -535,7 +535,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
static String wglGetLastError() {
- long err = GDI.GetLastError();
+ final long err = GDI.GetLastError();
String detail = null;
switch ((int) err) {
case GDI.ERROR_SUCCESS: detail = "ERROR_SUCCESS"; break;
@@ -561,26 +561,26 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final boolean setGammaRamp(float[] ramp) {
- short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
+ protected final boolean setGammaRamp(final float[] ramp) {
+ final short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
for (int i = 0; i < GAMMA_RAMP_LENGTH; i++) {
- short scaledValue = (short) (ramp[i] * 65535);
+ final short scaledValue = (short) (ramp[i] * 65535);
rampData[i] = scaledValue;
rampData[i + GAMMA_RAMP_LENGTH] = scaledValue;
rampData[i + 2 * GAMMA_RAMP_LENGTH] = scaledValue;
}
- long screenDC = GDI.GetDC(0);
- boolean res = GDI.SetDeviceGammaRamp(screenDC, ShortBuffer.wrap(rampData));
+ final long screenDC = GDI.GetDC(0);
+ final boolean res = GDI.SetDeviceGammaRamp(screenDC, ShortBuffer.wrap(rampData));
GDI.ReleaseDC(0, screenDC);
return res;
}
@Override
protected final Buffer getGammaRamp() {
- ShortBuffer rampData = ShortBuffer.wrap(new short[3 * GAMMA_RAMP_LENGTH]);
- long screenDC = GDI.GetDC(0);
- boolean res = GDI.GetDeviceGammaRamp(screenDC, rampData);
+ final ShortBuffer rampData = ShortBuffer.wrap(new short[3 * GAMMA_RAMP_LENGTH]);
+ final long screenDC = GDI.GetDC(0);
+ final boolean res = GDI.GetDeviceGammaRamp(screenDC, rampData);
GDI.ReleaseDC(0, screenDC);
if (!res) {
return null;
@@ -589,12 +589,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final void resetGammaRamp(Buffer originalGammaRamp) {
+ protected final void resetGammaRamp(final Buffer originalGammaRamp) {
if (originalGammaRamp == null) {
// getGammaRamp failed earlier
return;
}
- long screenDC = GDI.GetDC(0);
+ final long screenDC = GDI.GetDC(0);
GDI.SetDeviceGammaRamp(screenDC, originalGammaRamp);
GDI.ReleaseDC(0, screenDC);
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
index 6098cde7f..2285ae996 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
@@ -47,13 +47,13 @@ public final class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLi
@Override
public final List getToolGetProcAddressFuncNameList() {
- List res = new ArrayList();
+ final List res = new ArrayList();
res.add("wglGetProcAddress");
return res;
}
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return WGL.wglGetProcAddress(toolGetProcAddressHandle, funcName);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index 5dd9f88b2..465b5f560 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -66,24 +66,24 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
private boolean isDetermined = false;
private boolean isExternal = false;
- WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen,
- GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser) {
+ WindowsWGLGraphicsConfiguration(final AbstractGraphicsScreen screen,
+ final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser) {
super(screen, capsChosen, capsRequested);
this.chooser=chooser;
this.isDetermined = false;
}
- WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen,
- WGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested) {
+ WindowsWGLGraphicsConfiguration(final AbstractGraphicsScreen screen,
+ final WGLGLCapabilities capsChosen, final GLCapabilitiesImmutable capsRequested) {
super(screen, capsChosen, capsRequested);
setCapsPFD(capsChosen);
this.chooser=null;
}
- static WindowsWGLGraphicsConfiguration createFromExternal(GLDrawableFactory _factory, long hdc, int pfdID,
- GLProfile glp, AbstractGraphicsScreen screen, boolean onscreen)
+ static WindowsWGLGraphicsConfiguration createFromExternal(final GLDrawableFactory _factory, final long hdc, final int pfdID,
+ GLProfile glp, final AbstractGraphicsScreen screen, final boolean onscreen)
{
if(_factory==null) {
throw new GLException("Null factory");
@@ -97,10 +97,10 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
if(null==glp) {
glp = GLProfile.getDefault(screen.getDevice());
}
- WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
- AbstractGraphicsDevice device = screen.getDevice();
- WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
- boolean hasARB = null != sharedResource && sharedResource.hasARBPixelFormat();
+ final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
+ final AbstractGraphicsDevice device = screen.getDevice();
+ final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
+ final boolean hasARB = null != sharedResource && sharedResource.hasARBPixelFormat();
WGLGLCapabilities caps = null;
@@ -114,7 +114,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
", pfdID "+pfdID+", onscreen "+onscreen+", hasARB "+hasARB);
}
- WindowsWGLGraphicsConfiguration cfg = new WindowsWGLGraphicsConfiguration(screen, caps, caps);
+ final WindowsWGLGraphicsConfiguration cfg = new WindowsWGLGraphicsConfiguration(screen, caps, caps);
cfg.markExternal();
return cfg;
}
@@ -136,7 +136,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
* @see #isDetermined()
* @see #isExternal()
*/
- public final void updateGraphicsConfiguration(GLDrawableFactory factory, NativeSurface ns, int[] pfIDs) {
+ public final void updateGraphicsConfiguration(final GLDrawableFactory factory, final NativeSurface ns, final int[] pfIDs) {
WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(chooser, factory, ns, pfIDs);
}
@@ -150,15 +150,15 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
*
* @see #isDetermined()
*/
- public final void preselectGraphicsConfiguration(GLDrawableFactory factory, int[] pfdIDs) {
- AbstractGraphicsDevice device = getScreen().getDevice();
+ public final void preselectGraphicsConfiguration(final GLDrawableFactory factory, final int[] pfdIDs) {
+ final AbstractGraphicsDevice device = getScreen().getDevice();
WindowsWGLGraphicsConfigurationFactory.preselectGraphicsConfiguration(chooser, factory, device, this, pfdIDs);
}
/**
* Sets the hdc's PixelFormat, this configuration's capabilities and marks it as determined.
*/
- final void setPixelFormat(long hdc, WGLGLCapabilities caps) {
+ final void setPixelFormat(final long hdc, final WGLGLCapabilities caps) {
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
@@ -170,12 +170,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
}
if( !caps.isBackgroundOpaque() ) {
final long hwnd = GDI.WindowFromDC(hdc);
- DWM_BLURBEHIND bb = DWM_BLURBEHIND.create();
+ final DWM_BLURBEHIND bb = DWM_BLURBEHIND.create();
bb.setDwFlags(GDI.DWM_BB_ENABLE| GDI.DWM_BB_TRANSITIONONMAXIMIZED);
bb.setFEnable( 1 );
boolean ok = GDI.DwmEnableBlurBehindWindow(hwnd, bb);
if( ok ) {
- MARGINS m = MARGINS.create();
+ final MARGINS m = MARGINS.create();
m.setCxLeftWidth(-1);
m.setCxRightWidth(-1);
m.setCyBottomHeight(-1);
@@ -198,7 +198,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
* Only sets this configuration's capabilities and marks it as determined,
* the actual pixelformat is not set.
*/
- final void setCapsPFD(WGLGLCapabilities caps) {
+ final void setCapsPFD(final WGLGLCapabilities caps) {
setChosenCapabilities(caps);
this.isDetermined = true;
if (DEBUG) {
@@ -228,7 +228,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
public final int getPixelFormatID() { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).getPFDID() : 0; }
public final boolean isChoosenByARB() { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).isSetByARB() : false; }
- static int fillAttribsForGeneralWGLARBQuery(WindowsWGLDrawableFactory.SharedResource sharedResource, IntBuffer iattributes) {
+ static int fillAttribsForGeneralWGLARBQuery(final WindowsWGLDrawableFactory.SharedResource sharedResource, final IntBuffer iattributes) {
int niattribs = 0;
iattributes.put(niattribs++, WGLExt.WGL_DRAW_TO_WINDOW_ARB);
if(sharedResource.hasARBPBuffer()) {
@@ -257,7 +257,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return niattribs;
}
- static boolean wglARBPFIDValid(WindowsWGLContext sharedCtx, long hdc, int pfdID) {
+ static boolean wglARBPFIDValid(final WindowsWGLContext sharedCtx, final long hdc, final int pfdID) {
final IntBuffer out = Buffers.newDirectIntBuffer(1);
final IntBuffer in = Buffers.newDirectIntBuffer(1);
in.put(0, WGLExt.WGL_COLOR_BITS_ARB);
@@ -268,12 +268,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return true;
}
- static int wglARBPFDIDCount(WindowsWGLContext sharedCtx, long hdc) {
+ static int wglARBPFDIDCount(final WindowsWGLContext sharedCtx, final long hdc) {
final IntBuffer iresults = Buffers.newDirectIntBuffer(1);
final IntBuffer iattributes = Buffers.newDirectIntBuffer(1);
iattributes.put(0, WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB);
- WGLExt wglExt = sharedCtx.getWGLExt();
+ final WGLExt wglExt = sharedCtx.getWGLExt();
// pfdID shall be ignored here (spec), however, pass a valid pdf index '1' below (possible driver bug)
if (!wglExt.wglGetPixelFormatAttribivARB(hdc, 1 /* pfdID */, 0, 1, iattributes, iresults)) {
if(DEBUG) {
@@ -295,17 +295,17 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return pfdIDCount;
}
- static int[] wglAllARBPFDIDs(int pfdIDCount) {
- int[] pfdIDs = new int[pfdIDCount];
+ static int[] wglAllARBPFDIDs(final int pfdIDCount) {
+ final int[] pfdIDs = new int[pfdIDCount];
for (int i = 0; i < pfdIDCount; i++) {
pfdIDs[i] = 1 + i;
}
return pfdIDs;
}
- static WGLGLCapabilities wglARBPFID2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
- AbstractGraphicsDevice device, GLProfile glp,
- long hdc, int pfdID, int winattrbits) {
+ static WGLGLCapabilities wglARBPFID2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource,
+ final AbstractGraphicsDevice device, final GLProfile glp,
+ final long hdc, final int pfdID, final int winattrbits) {
if (!sharedResource.hasARBPixelFormat()) {
return null;
}
@@ -321,9 +321,9 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return AttribList2GLCapabilities(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
}
- static int[] wglChoosePixelFormatARB(WindowsWGLDrawableFactory.SharedResource sharedResource, AbstractGraphicsDevice device,
- GLCapabilitiesImmutable capabilities,
- long hdc, IntBuffer iattributes, int accelerationMode, FloatBuffer fattributes)
+ static int[] wglChoosePixelFormatARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device,
+ final GLCapabilitiesImmutable capabilities,
+ final long hdc, final IntBuffer iattributes, final int accelerationMode, final FloatBuffer fattributes)
{
if ( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities,
@@ -361,7 +361,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
System.err.println("wglChoosePixelFormatARB: NumFormats (wglChoosePixelFormatARB) accelMode 0x"
+ Integer.toHexString(accelerationMode) + ": " + numFormats);
for (int i = 0; i < numFormats; i++) {
- WGLGLCapabilities dbgCaps0 = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(
+ final WGLGLCapabilities dbgCaps0 = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(
sharedResource, device, capabilities.getGLProfile(), hdc, pformats[i], GLGraphicsConfigurationUtil.ALL_BITS);
System.err.println("pixel format " + pformats[i] + " (index " + i + "): " + dbgCaps0);
}
@@ -369,8 +369,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return pformats;
}
- static List wglARBPFIDs2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
- AbstractGraphicsDevice device, GLProfile glp, long hdc, int[] pfdIDs, int winattrbits, boolean onlyFirstValid) {
+ static List wglARBPFIDs2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource,
+ final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int[] pfdIDs, final int winattrbits, final boolean onlyFirstValid) {
if (!sharedResource.hasARBPixelFormat()) {
return null;
}
@@ -380,7 +380,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
final IntBuffer iresults = Buffers.newDirectIntBuffer(2*MAX_ATTRIBS);
final int niattribs = fillAttribsForGeneralWGLARBQuery(sharedResource, iattributes);
- ArrayList bucket = new ArrayList();
+ final ArrayList bucket = new ArrayList();
for(int i = 0; i= 1 &&
@@ -396,7 +396,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
break;
}
} else if(DEBUG) {
- GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
+ final GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
System.err.println("wglARBPFIDs2GLCapabilities: bucket["+i+" -> skip]: pfdID "+pfdIDs[i]+", "+skipped+", winattr "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString());
}
} else if (DEBUG) {
@@ -411,11 +411,11 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return bucket;
}
- static boolean GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
- IntBuffer iattributes,
- WindowsWGLDrawableFactory.SharedResource sharedResource,
- int accelerationValue,
- int[] floatMode) throws GLException {
+ static boolean GLCapabilities2AttribList(final GLCapabilitiesImmutable caps,
+ final IntBuffer iattributes,
+ final WindowsWGLDrawableFactory.SharedResource sharedResource,
+ final int accelerationValue,
+ final int[] floatMode) throws GLException {
if (!sharedResource.hasARBPixelFormat()) {
return false;
}
@@ -539,14 +539,14 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
static WGLGLCapabilities AttribList2GLCapabilities(final AbstractGraphicsDevice device,
final GLProfile glp, final long hdc, final int pfdID,
- final IntBuffer iattribs, final int niattribs, IntBuffer iresults, final int winattrmask) {
+ final IntBuffer iattribs, final int niattribs, final IntBuffer iresults, final int winattrmask) {
final int allDrawableTypeBits = AttribList2DrawableTypeBits(iattribs, niattribs, iresults);
int drawableTypeBits = winattrmask & allDrawableTypeBits;
if( 0 == drawableTypeBits ) {
return null;
}
- PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
+ final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
if (WGLUtil.DescribePixelFormat(hdc, pfdID, PIXELFORMATDESCRIPTOR.size(), pfd) == 0) {
// remove displayable bits, since pfdID is non displayable
@@ -565,23 +565,23 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
// GDI PIXELFORMAT
//
- static int[] wglAllGDIPFIDs(long hdc) {
- int numFormats = WGLUtil.DescribePixelFormat(hdc, 1, 0, null);
+ static int[] wglAllGDIPFIDs(final long hdc) {
+ final int numFormats = WGLUtil.DescribePixelFormat(hdc, 1, 0, null);
if (numFormats == 0) {
throw new GLException("DescribePixelFormat: No formats - HDC 0x" + Long.toHexString(hdc) +
", LastError: " + GDI.GetLastError());
}
- int[] pfdIDs = new int[numFormats];
+ final int[] pfdIDs = new int[numFormats];
for (int i = 0; i < numFormats; i++) {
pfdIDs[i] = 1 + i;
}
return pfdIDs;
}
- static int PFD2DrawableTypeBits(PIXELFORMATDESCRIPTOR pfd) {
+ static int PFD2DrawableTypeBits(final PIXELFORMATDESCRIPTOR pfd) {
int val = 0;
- int dwFlags = pfd.getDwFlags();
+ final int dwFlags = pfd.getDwFlags();
if( 0 != (GDI.PFD_DRAW_TO_WINDOW & dwFlags ) ) {
val |= GLGraphicsConfigurationUtil.WINDOW_BIT |
@@ -593,8 +593,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return val;
}
- static WGLGLCapabilities PFD2GLCapabilities(AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) {
- PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
+ static WGLGLCapabilities PFD2GLCapabilities(final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) {
+ final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
if(null == pfd) {
return null;
}
@@ -626,12 +626,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
}
- static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID) {
- PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
+ static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID) {
+ final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
return PFD2GLCapabilitiesNoCheck(device, glp, pfd, pfdID);
}
- static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(AbstractGraphicsDevice device, GLProfile glp, PIXELFORMATDESCRIPTOR pfd, int pfdID) {
+ static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(final AbstractGraphicsDevice device, final GLProfile glp, final PIXELFORMATDESCRIPTOR pfd, final int pfdID) {
if(null == pfd) {
return null;
}
@@ -641,8 +641,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, PFD2DrawableTypeBits(pfd), res);
}
- static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(GLCapabilitiesImmutable caps, PIXELFORMATDESCRIPTOR pfd) {
- int colorDepth = (caps.getRedBits() +
+ static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(final GLCapabilitiesImmutable caps, final PIXELFORMATDESCRIPTOR pfd) {
+ final int colorDepth = (caps.getRedBits() +
caps.getGreenBits() +
caps.getBlueBits());
if (colorDepth < 15) {
@@ -680,7 +680,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
pfd.setCGreenBits((byte) caps.getGreenBits());
pfd.setCBlueBits ((byte) caps.getBlueBits());
pfd.setCAlphaBits((byte) caps.getAlphaBits());
- int accumDepth = (caps.getAccumRedBits() +
+ final int accumDepth = (caps.getAccumRedBits() +
caps.getAccumGreenBits() +
caps.getAccumBlueBits());
pfd.setCAccumBits ((byte) accumDepth);
@@ -699,8 +699,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
return pfd;
}
- static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor(long hdc, int pfdID) {
- PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
+ static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor(final long hdc, final int pfdID) {
+ final PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
pfd.setNSize((short) PIXELFORMATDESCRIPTOR.size());
pfd.setNVersion((short) 1);
if(0 != hdc && 1 <= pfdID) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 969e45ed8..ea92b38fd 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -81,7 +81,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
@@ -98,14 +98,14 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, (GLCapabilitiesChooser)chooser, absScreen);
}
- static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(GLCapabilitiesImmutable caps,
- AbstractGraphicsScreen absScreen) {
+ static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(final GLCapabilitiesImmutable caps,
+ final AbstractGraphicsScreen absScreen) {
return chooseGraphicsConfigurationStatic(caps, caps, null, absScreen);
}
static WindowsWGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
- GLCapabilitiesChooser chooser,
+ final GLCapabilitiesImmutable capsReq,
+ final GLCapabilitiesChooser chooser,
AbstractGraphicsScreen absScreen) {
if(null==absScreen) {
absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
@@ -115,7 +115,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
return new WindowsWGLGraphicsConfiguration( absScreen, capsChosen, capsReq, chooser );
}
- protected static List getAvailableCapabilities(WindowsWGLDrawableFactory factory, AbstractGraphicsDevice device) {
+ protected static List getAvailableCapabilities(final WindowsWGLDrawableFactory factory, final AbstractGraphicsDevice device) {
final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
if(null == sharedResource) {
throw new GLException("Shared resource for device n/a: "+device);
@@ -136,7 +136,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
sharedDrawable.lockSurface();
}
try {
- long hdc = sharedDrawable.getHandle();
+ final long hdc = sharedDrawable.getHandle();
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
@@ -164,17 +164,17 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
return availableCaps;
}
- private static List getAvailableGLCapabilitiesARB(WindowsWGLDrawableFactory.SharedResource sharedResource, AbstractGraphicsDevice device, GLProfile glProfile, long hdc) {
+ private static List getAvailableGLCapabilitiesARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device, final GLProfile glProfile, final long hdc) {
final int pfdIDCount = WindowsWGLGraphicsConfiguration.wglARBPFDIDCount((WindowsWGLContext)sharedResource.getContext(), hdc);
final int[] pformats = WindowsWGLGraphicsConfiguration.wglAllARBPFDIDs(pfdIDCount);
return WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedResource, device, glProfile, hdc, pformats,
GLGraphicsConfigurationUtil.ALL_BITS & ~GLGraphicsConfigurationUtil.BITMAP_BIT, false); // w/o BITMAP
}
- private static List getAvailableGLCapabilitiesGDI(AbstractGraphicsDevice device, GLProfile glProfile, long hdc, boolean bitmapOnly) {
- int[] pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc);
- int numFormats = pformats.length;
- List bucket = new ArrayList(numFormats);
+ private static List getAvailableGLCapabilitiesGDI(final AbstractGraphicsDevice device, final GLProfile glProfile, final long hdc, final boolean bitmapOnly) {
+ final int[] pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc);
+ final int numFormats = pformats.length;
+ final List bucket = new ArrayList(numFormats);
for (int i = 0; i < numFormats; i++) {
final GLCapabilitiesImmutable caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, pformats[i],
bitmapOnly ? GLGraphicsConfigurationUtil.BITMAP_BIT : GLGraphicsConfigurationUtil.ALL_BITS );
@@ -192,8 +192,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
* @param ns
* @param pfIDs optional pool of preselected PixelFormat IDs, maybe null for unrestricted selection
*/
- static void updateGraphicsConfiguration(CapabilitiesChooser chooser,
- GLDrawableFactory factory, NativeSurface ns, int[] pfdIDs) {
+ static void updateGraphicsConfiguration(final CapabilitiesChooser chooser,
+ final GLDrawableFactory factory, final NativeSurface ns, final int[] pfdIDs) {
if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
}
@@ -208,11 +208,11 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
throw new GLException("Surface not ready (lockSurface)");
}
try {
- long hdc = ns.getSurfaceHandle();
+ final long hdc = ns.getSurfaceHandle();
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
- WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration();
+ final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration();
if( !config.isExternal() ) {
if( !config.isDetermined() ) {
@@ -239,9 +239,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
}
- static void preselectGraphicsConfiguration(CapabilitiesChooser chooser,
- GLDrawableFactory _factory, AbstractGraphicsDevice device,
- WindowsWGLGraphicsConfiguration config, int[] pfdIDs) {
+ static void preselectGraphicsConfiguration(final CapabilitiesChooser chooser,
+ final GLDrawableFactory _factory, final AbstractGraphicsDevice device,
+ final WindowsWGLGraphicsConfiguration config, final int[] pfdIDs) {
if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
}
@@ -254,8 +254,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
if ( !(_factory instanceof WindowsWGLDrawableFactory) ) {
throw new GLException("GLDrawableFactory is not a WindowsWGLDrawableFactory, but: "+_factory.getClass().getSimpleName());
}
- WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
- WindowsWGLDrawable sharedDrawable = factory.getOrCreateSharedDrawable(device);
+ final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
+ final WindowsWGLDrawable sharedDrawable = factory.getOrCreateSharedDrawable(device);
if(null == sharedDrawable) {
throw new IllegalArgumentException("Shared Drawable is null");
}
@@ -264,7 +264,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
throw new GLException("Shared Surface not ready (lockSurface): "+device+" -> "+sharedDrawable);
}
try {
- long hdc = sharedDrawable.getHandle();
+ final long hdc = sharedDrawable.getHandle();
if (0 == hdc) {
throw new GLException("Error: HDC is null");
}
@@ -274,8 +274,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
}
- private static void updateGraphicsConfiguration(WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser,
- GLDrawableFactory factory, long hdc, boolean extHDC, int[] pfdIDs) {
+ private static void updateGraphicsConfiguration(final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser,
+ final GLDrawableFactory factory, final long hdc, final boolean extHDC, final int[] pfdIDs) {
if (DEBUG) {
if(extHDC) {
System.err.println("updateGraphicsConfiguration(using shared): hdc "+toHexString(hdc));
@@ -284,8 +284,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
System.err.println("user chosen caps " + config.getChosenCapabilities());
}
- AbstractGraphicsDevice device = config.getScreen().getDevice();
- WindowsWGLDrawableFactory.SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(device);
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final WindowsWGLDrawableFactory.SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(device);
final GLContext sharedContext;
if ( factory.hasRendererQuirk(device, GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries) ) {
sharedContext = sharedResource.getContext();
@@ -311,8 +311,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
}
}
- private static boolean updateGraphicsConfigurationARB(WindowsWGLDrawableFactory factory, WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser,
- long hdc, boolean extHDC, int[] pformats) {
+ private static boolean updateGraphicsConfigurationARB(final WindowsWGLDrawableFactory factory, final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser,
+ final long hdc, final boolean extHDC, int[] pformats) {
final AbstractGraphicsDevice device = config.getScreen().getDevice();
final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
@@ -462,8 +462,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
return true;
}
- private static boolean updateGraphicsConfigurationGDI(WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser, long hdc,
- boolean extHDC, int[] pformats) {
+ private static boolean updateGraphicsConfigurationGDI(final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser, final long hdc,
+ final boolean extHDC, int[] pformats) {
final GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities();
if( !capsChosen.isOnscreen() && capsChosen.isPBuffer() ) {
if (DEBUG) {
@@ -557,7 +557,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
System.err.println("updateGraphicsConfigurationGDI: availableCaps["+i+" -> "+j+"]: "+caps);
}
} else if(DEBUG) {
- GLCapabilitiesImmutable skipped = WindowsWGLGraphicsConfiguration.PFD2GLCapabilitiesNoCheck(device, glProfile, hdc, pformats[i]);
+ final GLCapabilitiesImmutable skipped = WindowsWGLGraphicsConfiguration.PFD2GLCapabilitiesNoCheck(device, glProfile, hdc, pformats[i]);
System.err.println("updateGraphicsConfigurationGDI: availableCaps["+i+" -> skip]: pfdID "+pformats[i]+", "+skipped);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
index 96bd0bdd0..66d3018fc 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
@@ -70,8 +70,8 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
- CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+ final CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, final int nativeVisualID) {
GraphicsDevice device = null;
if (absScreen != null &&
!(absScreen instanceof AWTGraphicsScreen)) {
@@ -84,7 +84,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: creating default device: "+absScreen);
}
}
- AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+ final AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
@@ -104,10 +104,10 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: got "+absScreen);
}
- WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
- DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
- GraphicsConfigurationFactory configFactory = GraphicsConfigurationFactory.getFactory(winDevice, capsChosen);
- WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
+ final WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+ final DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
+ final GraphicsConfigurationFactory configFactory = GraphicsConfigurationFactory.getFactory(winDevice, capsChosen);
+ final WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
configFactory.chooseGraphicsConfiguration(capsChosen,
capsRequested,
chooser, winScreen, nativeVisualID);
@@ -115,7 +115,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
throw new GLException("Unable to choose a GraphicsConfiguration: "+capsChosen+",\n\t"+chooser+"\n\t"+winScreen);
}
- GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory(((GLCapabilitiesImmutable)capsChosen).getGLProfile());
+ final GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory(((GLCapabilitiesImmutable)capsChosen).getGLProfile());
GraphicsConfiguration chosenGC = null;
if ( drawableFactory instanceof WindowsWGLDrawableFactory ) {
@@ -133,7 +133,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: Found new AWT PFD ID "+winConfig.getPixelFormatID()+" -> "+winConfig);
}
}
- } catch (GLException gle0) {
+ } catch (final GLException gle0) {
if(DEBUG) {
gle0.printStackTrace();
}
@@ -150,11 +150,11 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
//
// collect all available PFD IDs
- GraphicsConfiguration[] configs = device.getConfigurations();
- int[] pfdIDs = new int[configs.length];
- ArrayHashSet pfdIDOSet = new ArrayHashSet();
+ final GraphicsConfiguration[] configs = device.getConfigurations();
+ final int[] pfdIDs = new int[configs.length];
+ final ArrayHashSet pfdIDOSet = new ArrayHashSet();
for (int i = 0; i < configs.length; i++) {
- GraphicsConfiguration gc = configs[i];
+ final GraphicsConfiguration gc = configs[i];
pfdIDs[i] = Win32SunJDKReflection.graphicsConfigurationGetPixelFormatID(gc);
pfdIDOSet.add(new Integer(pfdIDs[i]));
if(DEBUG) {
@@ -165,7 +165,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: PFD IDs: "+pfdIDs.length+", unique: "+pfdIDOSet.size());
}
winConfig.preselectGraphicsConfiguration(drawableFactory, pfdIDs);
- int gcIdx = pfdIDOSet.indexOf(new Integer(winConfig.getPixelFormatID()));
+ final int gcIdx = pfdIDOSet.indexOf(new Integer(winConfig.getPixelFormatID()));
if( 0 > gcIdx ) {
chosenGC = configs[gcIdx];
if(DEBUG) {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
index 12e3db3bd..e32177b3d 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
@@ -46,7 +46,7 @@ import com.jogamp.nativewindow.x11.X11GraphicsDevice;
public class GLXUtil {
public static final boolean DEBUG = Debug.debug("GLXUtil");
- public static synchronized boolean isGLXAvailableOnServer(X11GraphicsDevice x11Device) {
+ public static synchronized boolean isGLXAvailableOnServer(final X11GraphicsDevice x11Device) {
if(null == x11Device) {
throw new IllegalArgumentException("null X11GraphicsDevice");
}
@@ -57,14 +57,14 @@ public class GLXUtil {
x11Device.lock();
try {
glXAvailable = GLX.glXQueryExtension(x11Device.getHandle(), null, null);
- } catch (Throwable t) { /* n/a */
+ } catch (final Throwable t) { /* n/a */
} finally {
x11Device.unlock();
}
return glXAvailable;
}
- public static String getGLXClientString(X11GraphicsDevice x11Device, int name) {
+ public static String getGLXClientString(final X11GraphicsDevice x11Device, final int name) {
x11Device.lock();
try {
return GLX.glXGetClientString(x11Device.getHandle(), name);
@@ -72,7 +72,7 @@ public class GLXUtil {
x11Device.unlock();
}
}
- public static String queryGLXServerString(X11GraphicsDevice x11Device, int screen_idx, int name) {
+ public static String queryGLXServerString(final X11GraphicsDevice x11Device, final int screen_idx, final int name) {
x11Device.lock();
try {
return GLX.glXQueryServerString(x11Device.getHandle(), screen_idx, name);
@@ -80,7 +80,7 @@ public class GLXUtil {
x11Device.unlock();
}
}
- public static String queryGLXExtensionsString(X11GraphicsDevice x11Device, int screen_idx) {
+ public static String queryGLXExtensionsString(final X11GraphicsDevice x11Device, final int screen_idx) {
x11Device.lock();
try {
return GLX.glXQueryExtensionsString(x11Device.getHandle(), screen_idx);
@@ -89,7 +89,7 @@ public class GLXUtil {
}
}
- public static VersionNumber getGLXServerVersionNumber(X11GraphicsDevice x11Device) {
+ public static VersionNumber getGLXServerVersionNumber(final X11GraphicsDevice x11Device) {
final IntBuffer major = Buffers.newDirectIntBuffer(1);
final IntBuffer minor = Buffers.newDirectIntBuffer(1);
@@ -102,12 +102,12 @@ public class GLXUtil {
// Work around bugs in ATI's Linux drivers where they report they
// only implement GLX version 1.2 on the server side
if (major.get(0) == 1 && minor.get(0) == 2) {
- String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
+ final String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
try {
// e.g. "1.3"
major.put(0, Integer.valueOf(str.substring(0, 1)).intValue());
minor.put(0, Integer.valueOf(str.substring(2, 3)).intValue());
- } catch (Exception e) {
+ } catch (final Exception e) {
major.put(0, 1);
minor.put(0, 2);
}
@@ -118,18 +118,18 @@ public class GLXUtil {
return new VersionNumber(major.get(0), minor.get(0), 0);
}
- public static boolean isMultisampleAvailable(String extensions) {
+ public static boolean isMultisampleAvailable(final String extensions) {
if (extensions != null) {
return (extensions.indexOf("GLX_ARB_multisample") >= 0);
}
return false;
}
- public static boolean isVendorNVIDIA(String vendor) {
+ public static boolean isVendorNVIDIA(final String vendor) {
return vendor != null && vendor.startsWith("NVIDIA") ;
}
- public static boolean isVendorATI(String vendor) {
+ public static boolean isVendorATI(final String vendor) {
return vendor != null && vendor.startsWith("ATI") ;
}
@@ -143,7 +143,7 @@ public class GLXUtil {
return clientVersionNumber;
}
- public static synchronized void initGLXClientDataSingleton(X11GraphicsDevice x11Device) {
+ public static synchronized void initGLXClientDataSingleton(final X11GraphicsDevice x11Device) {
if(null != clientVendorName) {
return; // already initialized
}
@@ -156,14 +156,14 @@ public class GLXUtil {
clientMultisampleAvailable = isMultisampleAvailable(GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_EXTENSIONS));
clientVendorName = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VENDOR);
- int[] major = new int[1];
- int[] minor = new int[1];
+ final int[] major = new int[1];
+ final int[] minor = new int[1];
final String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
try {
// e.g. "1.3"
major[0] = Integer.valueOf(str.substring(0, 1)).intValue();
minor[0] = Integer.valueOf(str.substring(2, 3)).intValue();
- } catch (Exception e) {
+ } catch (final Exception e) {
major[0] = 1;
minor[0] = 2;
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
index 45c666230..7040621be 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
@@ -58,7 +58,7 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
public class X11ExternalGLXContext extends X11GLXContext {
- private X11ExternalGLXContext(Drawable drawable, long ctx) {
+ private X11ExternalGLXContext(final Drawable drawable, final long ctx) {
super(drawable, null);
this.contextHandle = ctx;
GLContextShareSet.contextCreated(this);
@@ -68,20 +68,20 @@ public class X11ExternalGLXContext extends X11GLXContext {
getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
}
- protected static X11ExternalGLXContext create(GLDrawableFactory factory, GLProfile glp) {
- long ctx = GLX.glXGetCurrentContext();
+ protected static X11ExternalGLXContext create(final GLDrawableFactory factory, final GLProfile glp) {
+ final long ctx = GLX.glXGetCurrentContext();
if (ctx == 0) {
throw new GLException("Error: current context null");
}
- long display = GLX.glXGetCurrentDisplay();
+ final long display = GLX.glXGetCurrentDisplay();
if (display == 0) {
throw new GLException("Error: current display null");
}
- long drawable = GLX.glXGetCurrentDrawable();
+ final long drawable = GLX.glXGetCurrentDrawable();
if (drawable == 0) {
throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
}
- IntBuffer val = Buffers.newDirectIntBuffer(1);
+ final IntBuffer val = Buffers.newDirectIntBuffer(1);
int w, h;
GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val);
@@ -90,7 +90,7 @@ public class X11ExternalGLXContext extends X11GLXContext {
h=val.get(0);
GLX.glXQueryContext(display, ctx, GLX.GLX_SCREEN, val);
- X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
+ final X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
GLX.glXQueryContext(display, ctx, GLX.GLX_FBCONFIG_ID, val);
X11GLXGraphicsConfiguration cfg = null;
@@ -99,7 +99,7 @@ public class X11ExternalGLXContext extends X11GLXContext {
// create and use a default config (this has been observed when running on CentOS 5.5 inside
// of VMWare Server 2.0 with the Mesa 6.5.1 drivers)
if( VisualIDHolder.VID_UNDEFINED == val.get(0) || !X11GLXGraphicsConfiguration.GLXFBConfigIDValid(display, x11Screen.getIndex(), val.get(0)) ) {
- GLCapabilities glcapsDefault = new GLCapabilities(GLProfile.getDefault());
+ final GLCapabilities glcapsDefault = new GLCapabilities(GLProfile.getDefault());
cfg = X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(glcapsDefault, glcapsDefault, null, x11Screen, VisualIDHolder.VID_UNDEFINED);
if(DEBUG) {
System.err.println("X11ExternalGLXContext invalid FBCONFIG_ID "+val.get(0)+", using default cfg: " + cfg);
@@ -131,12 +131,12 @@ public class X11ExternalGLXContext extends X11GLXContext {
// Need to provide the display connection to extension querying APIs
static class Drawable extends X11GLXDrawable {
- Drawable(GLDrawableFactory factory, NativeSurface comp) {
+ Drawable(final GLDrawableFactory factory, final NativeSurface comp) {
super(factory, comp, true);
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
throw new GLException("Should not call this");
}
@@ -150,7 +150,7 @@ public class X11ExternalGLXContext extends X11GLXContext {
throw new GLException("Should not call this");
}
- public void setSize(int width, int height) {
+ public void setSize(final int width, final int height) {
throw new GLException("Should not call this");
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
index 650fd31d3..2076ce454 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
@@ -55,30 +55,30 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
public class X11ExternalGLXDrawable extends X11GLXDrawable {
- private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeSurface surface) {
+ private X11ExternalGLXDrawable(final GLDrawableFactory factory, final NativeSurface surface) {
super(factory, surface, true);
}
- protected static X11ExternalGLXDrawable create(GLDrawableFactory factory, GLProfile glp) {
- long context = GLX.glXGetCurrentContext();
+ protected static X11ExternalGLXDrawable create(final GLDrawableFactory factory, final GLProfile glp) {
+ final long context = GLX.glXGetCurrentContext();
if (context == 0) {
throw new GLException("Error: current context null");
}
- long display = GLX.glXGetCurrentDisplay();
+ final long display = GLX.glXGetCurrentDisplay();
if (display == 0) {
throw new GLException("Error: current display null");
}
- long drawable = GLX.glXGetCurrentDrawable();
+ final long drawable = GLX.glXGetCurrentDrawable();
if (drawable == 0) {
throw new GLException("Error: attempted to make an external GLDrawable without a drawable current");
}
- IntBuffer val = Buffers.newDirectIntBuffer(1);
+ final IntBuffer val = Buffers.newDirectIntBuffer(1);
GLX.glXQueryContext(display, context, GLX.GLX_SCREEN, val);
- X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
+ final X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
GLX.glXQueryContext(display, context, GLX.GLX_FBCONFIG_ID, val);
- X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val.get(0));
+ final X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val.get(0));
int w, h;
GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val);
@@ -96,16 +96,16 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new Context(this, shareWith);
}
- public void setSize(int newWidth, int newHeight) {
+ public void setSize(final int newWidth, final int newHeight) {
throw new GLException("Should not call this");
}
class Context extends X11GLXContext {
- Context(X11GLXDrawable drawable, GLContext shareWith) {
+ Context(final X11GLXDrawable drawable, final GLContext shareWith) {
super(drawable, shareWith);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
index e0b69ffd4..36e791641 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
@@ -41,14 +41,14 @@ public class X11GLCapabilities extends GLCapabilities {
final private long fbcfg;
final private int fbcfgid;
- public X11GLCapabilities(XVisualInfo xVisualInfo, long fbcfg, int fbcfgid, GLProfile glp) {
+ public X11GLCapabilities(final XVisualInfo xVisualInfo, final long fbcfg, final int fbcfgid, final GLProfile glp) {
super(glp);
this.xVisualInfo = xVisualInfo;
this.fbcfg = fbcfg;
this.fbcfgid = fbcfgid;
}
- public X11GLCapabilities(XVisualInfo xVisualInfo, GLProfile glp) {
+ public X11GLCapabilities(final XVisualInfo xVisualInfo, final GLProfile glp) {
super(glp);
this.xVisualInfo = xVisualInfo;
this.fbcfg = 0;
@@ -64,7 +64,7 @@ public class X11GLCapabilities extends GLCapabilities {
public Object clone() {
try {
return super.clone();
- } catch (RuntimeException e) {
+ } catch (final RuntimeException e) {
throw new GLException(e);
}
}
@@ -78,7 +78,7 @@ public class X11GLCapabilities extends GLCapabilities {
final public boolean hasFBConfig() { return 0!=fbcfg && fbcfgid!=VisualIDHolder.VID_UNDEFINED; }
@Override
- final public int getVisualID(VIDType type) throws NativeWindowException {
+ final public int getVisualID(final VIDType type) throws NativeWindowException {
switch(type) {
case INTRINSIC:
case NATIVE:
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
index 57d39d533..d4c3abc49 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -94,13 +94,13 @@ public class X11GLXContext extends GLContextImpl {
extensionNameMap.put(GLExtensions.ARB_pixel_format, X11GLXDrawableFactory.GLX_SGIX_pbuffer); // good enough
}
- X11GLXContext(GLDrawableImpl drawable,
- GLContext shareWith) {
+ X11GLXContext(final GLDrawableImpl drawable,
+ final GLContext shareWith) {
super(drawable, shareWith);
}
@Override
- protected void resetStates(boolean isInit) {
+ protected void resetStates(final boolean isInit) {
// no inner state _glXExt=null;
glXExtProcAddressTable = null;
hasSwapInterval = 0;
@@ -159,7 +159,7 @@ public class X11GLXContext extends GLContextImpl {
return isGLXVersionGreaterEqualOneThree();
}
- private final boolean glXMakeContextCurrent(long dpy, long writeDrawable, long readDrawable, long ctx) {
+ private final boolean glXMakeContextCurrent(final long dpy, final long writeDrawable, final long readDrawable, final long ctx) {
boolean res = false;
try {
@@ -173,7 +173,7 @@ public class X11GLXContext extends GLContextImpl {
// should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl
throw new InternalError("Given readDrawable but no driver support");
}
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
if( DEBUG_TRACE_SWITCH ) {
System.err.println(getThreadName()+": Warning: X11GLXContext.glXMakeContextCurrent failed: "+re+", with "+
"dpy "+toHexString(dpy)+
@@ -187,7 +187,7 @@ public class X11GLXContext extends GLContextImpl {
}
@Override
- protected void destroyContextARBImpl(long ctx) {
+ protected void destroyContextARBImpl(final long ctx) {
final long display = drawable.getNativeSurface().getDisplayHandle();
glXMakeContextCurrent(display, 0, 0, 0);
@@ -207,22 +207,22 @@ public class X11GLXContext extends GLContextImpl {
};
@Override
- protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+ protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
updateGLXProcAddressTable();
- GLXExt _glXExt = getGLXExt();
+ final GLXExt _glXExt = getGLXExt();
if(DEBUG) {
System.err.println(getThreadName()+": X11GLXContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") +
", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+
", glXCreateContextAttribsARB: "+toHexString(glXExtProcAddressTable._addressof_glXCreateContextAttribsARB));
}
- boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
- boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
- boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
+ final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+ final boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
+ final boolean ctDebug = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
long ctx=0;
- IntBuffer attribs = Buffers.newDirectIntBuffer(ctx_arb_attribs_rom);
+ final IntBuffer attribs = Buffers.newDirectIntBuffer(ctx_arb_attribs_rom);
attribs.put(ctx_arb_attribs_idx_major + 1, major);
attribs.put(ctx_arb_attribs_idx_minor + 1, minor);
@@ -246,8 +246,8 @@ public class X11GLXContext extends GLContextImpl {
attribs.put(ctx_arb_attribs_idx_flags + 1, flags);
}
- X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
- AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
final long display = device.getHandle();
try {
@@ -256,9 +256,9 @@ public class X11GLXContext extends GLContextImpl {
X11Util.setX11ErrorHandler(true, DEBUG ? false : true); // make sure X11 error handler is set
X11Lib.XSync(display, false);
ctx = _glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs);
- } catch (RuntimeException re) {
+ } catch (final RuntimeException re) {
if(DEBUG) {
- Throwable t = new Throwable(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
+ final Throwable t = new Throwable(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
t.printStackTrace();
}
}
@@ -291,7 +291,7 @@ public class X11GLXContext extends GLContextImpl {
final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
final AbstractGraphicsDevice device = config.getScreen().getDevice();
final X11GLXContext sharedContext = (X11GLXContext) factory.getOrCreateSharedContext(device);
- long display = device.getHandle();
+ final long display = device.getHandle();
if ( 0 != shareWithHandle ) {
direct = GLX.glXIsDirect(display, shareWithHandle);
@@ -410,7 +410,7 @@ public class X11GLXContext extends GLContextImpl {
@Override
protected void makeCurrentImpl() throws GLException {
- long dpy = drawable.getNativeSurface().getDisplayHandle();
+ final long dpy = drawable.getNativeSurface().getDisplayHandle();
if (GLX.glXGetCurrentContext() != contextHandle) {
if (!glXMakeContextCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
@@ -426,7 +426,7 @@ public class X11GLXContext extends GLContextImpl {
@Override
protected void releaseImpl() throws GLException {
- long display = drawable.getNativeSurface().getDisplayHandle();
+ final long display = drawable.getNativeSurface().getDisplayHandle();
if (!glXMakeContextCurrent(display, 0, 0, 0)) {
throw new GLException(getThreadName()+": Error freeing OpenGL context");
}
@@ -438,10 +438,10 @@ public class X11GLXContext extends GLContextImpl {
}
@Override
- protected void copyImpl(GLContext source, int mask) throws GLException {
- long dst = getHandle();
- long src = source.getHandle();
- long display = drawable.getNativeSurface().getDisplayHandle();
+ protected void copyImpl(final GLContext source, final int mask) throws GLException {
+ final long dst = getHandle();
+ final long src = source.getHandle();
+ final long display = drawable.getNativeSurface().getDisplayHandle();
if (0 == display) {
throw new GLException(getThreadName()+": Connection to X display not yet set up");
}
@@ -482,7 +482,7 @@ public class X11GLXContext extends GLContextImpl {
protected final StringBuilder getPlatformExtensionsStringImpl() {
final NativeSurface ns = drawable.getNativeSurface();
final X11GraphicsDevice x11Device = (X11GraphicsDevice) ns.getGraphicsConfiguration().getScreen().getDevice();
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
x11Device.lock();
try{
if (DEBUG) {
@@ -519,7 +519,7 @@ public class X11GLXContext extends GLContextImpl {
}
@Override
- protected boolean setSwapIntervalImpl(int interval) {
+ protected boolean setSwapIntervalImpl(final int interval) {
if( !drawable.getChosenGLCapabilities().isOnscreen() ) { return false; }
final GLXExt glXExt = getGLXExt();
@@ -536,7 +536,7 @@ public class X11GLXContext extends GLContextImpl {
} else {
hasSwapInterval = -1;
}
- } catch (Throwable t) { hasSwapInterval=-1; }
+ } catch (final Throwable t) { hasSwapInterval=-1; }
}
/* try {
switch( hasSwapInterval ) {
@@ -549,16 +549,16 @@ public class X11GLXContext extends GLContextImpl {
if (2 == hasSwapInterval) {
try {
return 0 == glXExt.glXSwapIntervalSGI(interval);
- } catch (Throwable t) { hasSwapInterval=-1; }
+ } catch (final Throwable t) { hasSwapInterval=-1; }
}
return false;
}
- private final int initSwapGroupImpl(GLXExt glXExt) {
+ private final int initSwapGroupImpl(final GLXExt glXExt) {
if(0==hasSwapGroupNV) {
try {
hasSwapGroupNV = glXExt.isExtensionAvailable(GLXExtensions.GLX_NV_swap_group)?1:-1;
- } catch (Throwable t) { hasSwapGroupNV=1; }
+ } catch (final Throwable t) { hasSwapGroupNV=1; }
if(DEBUG) {
System.err.println("initSwapGroupImpl: "+GLXExtensions.GLX_NV_swap_group+": "+hasSwapGroupNV);
}
@@ -567,10 +567,10 @@ public class X11GLXContext extends GLContextImpl {
}
@Override
- protected final boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset,
- int[] maxBarriers, int maxBarriers_offset) {
+ protected final boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset,
+ final int[] maxBarriers, final int maxBarriers_offset) {
boolean res = false;
- GLXExt glXExt = getGLXExt();
+ final GLXExt glXExt = getGLXExt();
if (initSwapGroupImpl(glXExt)>0) {
final NativeSurface ns = drawable.getNativeSurface();
try {
@@ -583,53 +583,53 @@ public class X11GLXContext extends GLContextImpl {
maxBarriersNIO.get(maxGroups, maxGroups_offset, maxBarriersNIO.remaining());
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- protected final boolean joinSwapGroupImpl(int group) {
+ protected final boolean joinSwapGroupImpl(final int group) {
boolean res = false;
- GLXExt glXExt = getGLXExt();
+ final GLXExt glXExt = getGLXExt();
if (initSwapGroupImpl(glXExt)>0) {
try {
if( glXExt.glXJoinSwapGroupNV(drawable.getNativeSurface().getDisplayHandle(), drawable.getHandle(), group) ) {
currentSwapGroup = group;
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- protected final boolean bindSwapBarrierImpl(int group, int barrier) {
+ protected final boolean bindSwapBarrierImpl(final int group, final int barrier) {
boolean res = false;
- GLXExt glXExt = getGLXExt();
+ final GLXExt glXExt = getGLXExt();
if (initSwapGroupImpl(glXExt)>0) {
try {
if( glXExt.glXBindSwapBarrierNV(drawable.getNativeSurface().getDisplayHandle(), group, barrier) ) {
res = true;
}
- } catch (Throwable t) { hasSwapGroupNV=-1; }
+ } catch (final Throwable t) { hasSwapGroupNV=-1; }
}
return res;
}
@Override
- public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+ public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
return getGLXExt().glXAllocateMemoryNV(size, readFrequency, writeFrequency, priority);
}
@Override
- public final void glFreeMemoryNV(ByteBuffer pointer) {
+ public final void glFreeMemoryNV(final ByteBuffer pointer) {
getGLXExt().glXFreeMemoryNV(pointer);
}
@Override
public String toString() {
- StringBuilder sb = new StringBuilder();
+ final StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
super.append(sb);
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
index 155c00c4c..c29bc3bc3 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
@@ -47,7 +47,7 @@ import jogamp.opengl.GLDrawableImpl;
import jogamp.opengl.GLDynamicLookupHelper;
public abstract class X11GLXDrawable extends GLDrawableImpl {
- protected X11GLXDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+ protected X11GLXDrawable(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
super(factory, comp, realized);
}
@@ -59,7 +59,7 @@ public abstract class X11GLXDrawable extends GLDrawableImpl {
@Override
protected void setRealizedImpl() {
if(realized) {
- X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
+ final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
config.updateGraphicsConfiguration();
if (DEBUG) {
@@ -69,7 +69,7 @@ public abstract class X11GLXDrawable extends GLDrawableImpl {
}
@Override
- protected final void swapBuffersImpl(boolean doubleBuffered) {
+ protected final void swapBuffersImpl(final boolean doubleBuffered) {
if(doubleBuffered) {
GLX.glXSwapBuffers(getNativeSurface().getDisplayHandle(), getHandle());
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index f7938f463..fbab32963 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -103,7 +103,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
if(null!=tmp && tmp.isLibComplete()) {
GLX.getGLXProcAddressTable().reset(tmp);
}
- } catch (Exception ex) {
+ } catch (final Exception ex) {
tmp = null;
if(DEBUG) {
ex.printStackTrace();
@@ -159,7 +159,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+ public final GLDynamicLookupHelper getGLDynamicLookupHelper(final int profile) {
return x11GLXDynamicLookupHelper;
}
@@ -180,9 +180,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
GLDrawableImpl drawable;
GLContextImpl context;
- SharedResource(X11GraphicsDevice dev, X11GraphicsScreen scrn,
- GLDrawableImpl draw, GLContextImpl ctx,
- VersionNumber glXServerVer, String glXServerVendor, boolean glXServerMultisampleAvail) {
+ SharedResource(final X11GraphicsDevice dev, final X11GraphicsScreen scrn,
+ final GLDrawableImpl draw, final GLContextImpl ctx,
+ final VersionNumber glXServerVer, final String glXServerVendor, final boolean glXServerMultisampleAvail) {
device = dev;
screen = scrn;
drawable = draw;
@@ -227,11 +227,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
sharedMap.clear();
}
@Override
- public SharedResourceRunner.Resource mapPut(String connection, SharedResourceRunner.Resource resource) {
+ public SharedResourceRunner.Resource mapPut(final String connection, final SharedResourceRunner.Resource resource) {
return sharedMap.put(connection, resource);
}
@Override
- public SharedResourceRunner.Resource mapGet(String connection) {
+ public SharedResourceRunner.Resource mapGet(final String connection) {
return sharedMap.get(connection);
}
@Override
@@ -240,7 +240,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public boolean isDeviceSupported(String connection) {
+ public boolean isDeviceSupported(final String connection) {
final boolean res;
final X11GraphicsDevice x11Device = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
x11Device.lock();
@@ -257,7 +257,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public SharedResourceRunner.Resource createSharedResource(String connection) {
+ public SharedResourceRunner.Resource createSharedResource(final String connection) {
final X11GraphicsDevice sharedDevice = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
sharedDevice.lock();
try {
@@ -312,7 +312,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return new SharedResource(sharedDevice, sharedScreen, sharedDrawable, sharedContext,
glXServerVersion, glXServerVendorName,
glXServerMultisampleAvailable && GLXUtil.isClientMultisampleAvailable());
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new GLException("X11GLXDrawableFactory - Could not initialize shared resources for "+connection, t);
} finally {
sharedDevice.unlock();
@@ -320,8 +320,8 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public void releaseSharedResource(SharedResourceRunner.Resource shared) {
- SharedResource sr = (SharedResource) shared;
+ public void releaseSharedResource(final SharedResourceRunner.Resource shared) {
+ final SharedResource sr = (SharedResource) shared;
if (DEBUG) {
System.err.println("Shutdown Shared:");
System.err.println("Device : " + sr.device);
@@ -361,7 +361,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+ public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
if(null != x11GLXDynamicLookupHelper && device instanceof X11GraphicsDevice) {
return true;
}
@@ -374,11 +374,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice device) {
+ protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice device) {
return (SharedResource) sharedResourceRunner.getOrCreateShared(device);
}
- protected final long getOrCreateSharedDpy(AbstractGraphicsDevice device) {
+ protected final long getOrCreateSharedDpy(final AbstractGraphicsDevice device) {
final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
if(null!=sr) {
return sr.getDevice().getHandle();
@@ -387,12 +387,12 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected List getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+ protected List getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
return X11GLXGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
}
@Override
- protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+ protected final GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -400,19 +400,19 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+ protected final GLDrawableImpl createOffscreenDrawableImpl(final NativeSurface target) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
- AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
- GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+ final AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
+ final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
if(!caps.isPBuffer()) {
return new X11PixmapGLXDrawable(this, target);
}
// PBuffer GLDrawable Creation
GLDrawableImpl pbufferDrawable;
- AbstractGraphicsDevice device = config.getScreen().getDevice();
+ final AbstractGraphicsDevice device = config.getScreen().getDevice();
/**
* Due to the ATI Bug https://bugzilla.mozilla.org/show_bug.cgi?id=486277,
@@ -420,7 +420,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
* The dummy context shall also use the same Display,
* since switching Display in this regard is another ATI bug.
*/
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if( null!=sr && sr.isGLXVendorATI() && null == GLContext.getCurrent() ) {
sr.getContext().makeCurrent();
try {
@@ -434,9 +434,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return pbufferDrawable;
}
- public final boolean isGLXMultisampleAvailable(AbstractGraphicsDevice device) {
+ public final boolean isGLXMultisampleAvailable(final AbstractGraphicsDevice device) {
if(null != device) {
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if(null!=sr) {
return sr.isGLXMultisampleAvailable();
}
@@ -444,9 +444,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return false;
}
- public final VersionNumber getGLXVersionNumber(AbstractGraphicsDevice device) {
+ public final VersionNumber getGLXVersionNumber(final AbstractGraphicsDevice device) {
if(null != device) {
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if(null!=sr) {
return sr.getGLXVersion();
}
@@ -457,9 +457,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return null;
}
- public final boolean isGLXVersionGreaterEqualOneOne(AbstractGraphicsDevice device) {
+ public final boolean isGLXVersionGreaterEqualOneOne(final AbstractGraphicsDevice device) {
if(null != device) {
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if(null!=sr) {
return sr.isGLXVersionGreaterEqualOneOne();
}
@@ -471,9 +471,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return false;
}
- public final boolean isGLXVersionGreaterEqualOneThree(AbstractGraphicsDevice device) {
+ public final boolean isGLXVersionGreaterEqualOneThree(final AbstractGraphicsDevice device) {
if(null != device) {
- SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+ final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
if(null!=sr) {
return sr.isGLXVersionGreaterEqualOneThree();
}
@@ -486,9 +486,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
+ public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, final GLProfile glp) {
if(null == device) {
- SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(defaultDevice);
+ final SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(defaultDevice);
if(null!=sr) {
device = sr.getDevice();
}
@@ -497,10 +497,10 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsRequested,
- GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+ protected final ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ final GLCapabilitiesImmutable capsChosen,
+ final GLCapabilitiesImmutable capsRequested,
+ final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
final X11GraphicsDevice device;
if( createNewDevice || !(deviceReq instanceof X11GraphicsDevice) ) {
device = new X11GraphicsDevice(X11Util.openDisplay(deviceReq.getConnection()), deviceReq.getUnitID(), true /* owner */);
@@ -516,14 +516,14 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
- GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+ public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+ GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
chosenCaps = GLGraphicsConfigurationUtil.fixOnscreenGLCapabilities(chosenCaps);
return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new X11DummyUpstreamSurfaceHook(width, height));
}
@Override
- protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+ protected final ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
final X11GraphicsDevice device = new X11GraphicsDevice(X11Util.openDisplay(deviceReq.getConnection()), deviceReq.getUnitID(), true /* owner */);
final X11GraphicsScreen screen = new X11GraphicsScreen(device, screenIdx);
final int xvisualID = X11Lib.GetVisualIDFromWindow(device.getHandle(), windowHandle);
@@ -546,7 +546,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+ public final boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
return canCreateGLPbuffer(device, null /* GLProfile not used for query on X11 */);
}
@@ -567,13 +567,13 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return gammaRampLength;
}
- long display = getOrCreateSharedDpy(defaultDevice);
+ final long display = getOrCreateSharedDpy(defaultDevice);
if(0 == display) {
return 0;
}
- int[] size = new int[1];
- boolean res = X11Lib.XF86VidModeGetGammaRampSize(display,
+ final int[] size = new int[1];
+ final boolean res = X11Lib.XF86VidModeGetGammaRampSize(display,
X11Lib.DefaultScreen(display),
size, 0);
if (!res) {
@@ -585,19 +585,19 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final boolean setGammaRamp(float[] ramp) {
- long display = getOrCreateSharedDpy(defaultDevice);
+ protected final boolean setGammaRamp(final float[] ramp) {
+ final long display = getOrCreateSharedDpy(defaultDevice);
if(0 == display) {
return false;
}
- int len = ramp.length;
- short[] rampData = new short[len];
+ final int len = ramp.length;
+ final short[] rampData = new short[len];
for (int i = 0; i < len; i++) {
rampData[i] = (short) (ramp[i] * 65535);
}
- boolean res = X11Lib.XF86VidModeSetGammaRamp(display,
+ final boolean res = X11Lib.XF86VidModeSetGammaRamp(display,
X11Lib.DefaultScreen(display),
rampData.length,
rampData, 0,
@@ -608,24 +608,24 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
@Override
protected final Buffer getGammaRamp() {
- long display = getOrCreateSharedDpy(defaultDevice);
+ final long display = getOrCreateSharedDpy(defaultDevice);
if(0 == display) {
return null;
}
- int size = getGammaRampLength();
- ShortBuffer rampData = ShortBuffer.wrap(new short[3 * size]);
+ final int size = getGammaRampLength();
+ final ShortBuffer rampData = ShortBuffer.wrap(new short[3 * size]);
rampData.position(0);
rampData.limit(size);
- ShortBuffer redRampData = rampData.slice();
+ final ShortBuffer redRampData = rampData.slice();
rampData.position(size);
rampData.limit(2 * size);
- ShortBuffer greenRampData = rampData.slice();
+ final ShortBuffer greenRampData = rampData.slice();
rampData.position(2 * size);
rampData.limit(3 * size);
- ShortBuffer blueRampData = rampData.slice();
+ final ShortBuffer blueRampData = rampData.slice();
- boolean res = X11Lib.XF86VidModeGetGammaRamp(display,
+ final boolean res = X11Lib.XF86VidModeGetGammaRamp(display,
X11Lib.DefaultScreen(display),
size,
redRampData,
@@ -638,30 +638,30 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
@Override
- protected final void resetGammaRamp(Buffer originalGammaRamp) {
+ protected final void resetGammaRamp(final Buffer originalGammaRamp) {
if (originalGammaRamp == null) {
return; // getGammaRamp failed originally
}
- long display = getOrCreateSharedDpy(defaultDevice);
+ final long display = getOrCreateSharedDpy(defaultDevice);
if(0 == display) {
return;
}
- ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
- int capacity = rampData.capacity();
+ final ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
+ final int capacity = rampData.capacity();
if ((capacity % 3) != 0) {
throw new IllegalArgumentException("Must not be the original gamma ramp");
}
- int size = capacity / 3;
+ final int size = capacity / 3;
rampData.position(0);
rampData.limit(size);
- ShortBuffer redRampData = rampData.slice();
+ final ShortBuffer redRampData = rampData.slice();
rampData.position(size);
rampData.limit(2 * size);
- ShortBuffer greenRampData = rampData.slice();
+ final ShortBuffer greenRampData = rampData.slice();
rampData.position(2 * size);
rampData.limit(3 * size);
- ShortBuffer blueRampData = rampData.slice();
+ final ShortBuffer blueRampData = rampData.slice();
X11Lib.XF86VidModeSetGammaRamp(display,
X11Lib.DefaultScreen(display),
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
index 951174f71..0e91a6a65 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
@@ -62,14 +62,14 @@ public final class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibrar
@Override
public final List getToolGetProcAddressFuncNameList() {
- List res = new ArrayList();
+ final List res = new ArrayList();
res.add("glXGetProcAddressARB");
res.add("glXGetProcAddress");
return res;
}
@Override
- public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+ public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
return GLX.glXGetProcAddress(toolGetProcAddressHandle, funcName);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
index c0a3b46df..5f6a6b344 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -65,8 +65,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
public static final int MAX_ATTRIBS = 128;
private final GLCapabilitiesChooser chooser;
- X11GLXGraphicsConfiguration(X11GraphicsScreen screen,
- X11GLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+ X11GLXGraphicsConfiguration(final X11GraphicsScreen screen,
+ final X11GLCapabilities capsChosen, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
super(screen, capsChosen, capsRequested, capsChosen.getXVisualInfo());
this.chooser=chooser;
}
@@ -109,7 +109,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- static X11GLXGraphicsConfiguration create(GLProfile glp, X11GraphicsScreen x11Screen, int fbcfgID) {
+ static X11GLXGraphicsConfiguration create(GLProfile glp, final X11GraphicsScreen x11Screen, final int fbcfgID) {
final X11GraphicsDevice device = (X11GraphicsDevice) x11Screen.getDevice();
final long display = device.getHandle();
if(0==display) {
@@ -131,11 +131,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
}
- static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
- boolean forFBAttr, boolean isMultisampleAvailable,
- long display, int screen)
+ static IntBuffer GLCapabilities2AttribList(final GLCapabilitiesImmutable caps,
+ final boolean forFBAttr, final boolean isMultisampleAvailable,
+ final long display, final int screen)
{
- int colorDepth = (caps.getRedBits() +
+ final int colorDepth = (caps.getRedBits() +
caps.getGreenBits() +
caps.getBlueBits());
if (colorDepth < 15) {
@@ -237,12 +237,12 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
// FBConfig
- static boolean GLXFBConfigIDValid(long display, int screen, int fbcfgid) {
- long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbcfgid);
+ static boolean GLXFBConfigIDValid(final long display, final int screen, final int fbcfgid) {
+ final long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbcfgid);
return (0 != fbcfg) ? X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) : false ;
}
- static boolean GLXFBConfigValid(long display, long fbcfg) {
+ static boolean GLXFBConfigValid(final long display, final long fbcfg) {
final IntBuffer tmp = Buffers.newDirectIntBuffer(1);
if(GLX.GLX_BAD_ATTRIBUTE == GLX.glXGetFBConfigAttrib(display, fbcfg, GLX.GLX_RENDER_TYPE, tmp)) {
return false;
@@ -275,14 +275,14 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return val;
}
- static XRenderDirectFormat XVisual2XRenderMask(long dpy, long visual) {
- XRenderPictFormat renderPictFmt = X11Lib.XRenderFindVisualFormat(dpy, visual);
+ static XRenderDirectFormat XVisual2XRenderMask(final long dpy, final long visual) {
+ final XRenderPictFormat renderPictFmt = X11Lib.XRenderFindVisualFormat(dpy, visual);
if(null == renderPictFmt) {
return null;
}
return renderPictFmt.getDirect();
}
- static XRenderDirectFormat XVisual2XRenderMask(long dpy, long visual, XRenderPictFormat dest) {
+ static XRenderDirectFormat XVisual2XRenderMask(final long dpy, final long visual, final XRenderPictFormat dest) {
if( !X11Lib.XRenderFindVisualFormat(dpy, visual, dest) ) {
return null;
} else {
@@ -298,7 +298,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
static List GLXFBConfig2GLCapabilities(final X11GraphicsDevice device, final GLProfile glp, final PointerBuffer fbcfgsL,
- final int winattrmask, final boolean isMultisampleAvailable, boolean onlyFirstValid) {
+ final int winattrmask, final boolean isMultisampleAvailable, final boolean onlyFirstValid) {
final IntBuffer tmp = Buffers.newDirectIntBuffer(1);
final XRenderPictFormat xRenderPictFormat= XRenderPictFormat.create();
final List result = new ArrayList();
@@ -424,7 +424,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
}
- private static String glXGetFBConfigErrorCode(int err) {
+ private static String glXGetFBConfigErrorCode(final int err) {
switch (err) {
case GLX.GLX_NO_EXTENSION: return "GLX_NO_EXTENSION";
case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
@@ -432,7 +432,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- static boolean glXGetFBConfig(long display, long cfg, int attrib, IntBuffer tmp) {
+ static boolean glXGetFBConfig(final long display, final long cfg, final int attrib, final IntBuffer tmp) {
if (display == 0) {
throw new GLException("No display connection");
}
@@ -445,7 +445,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return res;
}
- static int glXFBConfig2FBConfigID(long display, long cfg) {
+ static int glXFBConfig2FBConfigID(final long display, final long cfg) {
final IntBuffer tmpID = Buffers.newDirectIntBuffer(1);
if( glXGetFBConfig(display, cfg, GLX.GLX_FBCONFIG_ID, tmpID) ) {
return tmpID.get(0);
@@ -454,11 +454,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- static long glXFBConfigID2FBConfig(long display, int screen, int id) {
+ static long glXFBConfigID2FBConfig(final long display, final int screen, final int id) {
final IntBuffer attribs = Buffers.newDirectIntBuffer(new int[] { GLX.GLX_FBCONFIG_ID, id, 0 });
final IntBuffer count = Buffers.newDirectIntBuffer(1);
count.put(0, -1);
- PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, count);
+ final PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, count);
if (fbcfgsL == null || fbcfgsL.limit()<1) {
return 0;
}
@@ -467,15 +467,15 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
// Visual Info
- static XVisualInfo XVisualID2XVisualInfo(long display, long visualID) {
- int[] count = new int[1];
- XVisualInfo template = XVisualInfo.create();
+ static XVisualInfo XVisualID2XVisualInfo(final long display, final long visualID) {
+ final int[] count = new int[1];
+ final XVisualInfo template = XVisualInfo.create();
template.setVisualid(visualID);
- XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
+ final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
if (infos == null || infos.length == 0) {
return null;
}
- XVisualInfo res = XVisualInfo.create(infos[0]);
+ final XVisualInfo res = XVisualInfo.create(infos[0]);
if (DEBUG) {
System.err.println("Fetched XVisualInfo for visual ID " + toHexString(visualID));
System.err.println("Resulting XVisualInfo: visualid = " + toHexString(res.getVisualid()));
@@ -483,8 +483,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return res;
}
- static X11GLCapabilities XVisualInfo2GLCapabilities(final X11GraphicsDevice device, GLProfile glp, XVisualInfo info,
- final int winattrmask, boolean isMultisampleEnabled) {
+ static X11GLCapabilities XVisualInfo2GLCapabilities(final X11GraphicsDevice device, final GLProfile glp, final XVisualInfo info,
+ final int winattrmask, final boolean isMultisampleEnabled) {
final int allDrawableTypeBits = GLGraphicsConfigurationUtil.WINDOW_BIT |
GLGraphicsConfigurationUtil.BITMAP_BIT |
GLGraphicsConfigurationUtil.FBO_BIT ;
@@ -512,7 +512,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return null;
}
- GLCapabilities res = new X11GLCapabilities(info, glp);
+ final GLCapabilities res = new X11GLCapabilities(info, glp);
res.setDoubleBuffered(glXGetConfig(display, info, GLX.GLX_DOUBLEBUFFER, tmp) != 0);
res.setStereo (glXGetConfig(display, info, GLX.GLX_STEREO, tmp) != 0);
@@ -551,7 +551,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
}
- private static String glXGetConfigErrorCode(int err) {
+ private static String glXGetConfigErrorCode(final int err) {
switch (err) {
case GLX.GLX_NO_EXTENSION: return "GLX_NO_EXTENSION";
case GLX.GLX_BAD_SCREEN: return "GLX_BAD_SCREEN";
@@ -561,11 +561,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
}
}
- static int glXGetConfig(long display, XVisualInfo info, int attrib, IntBuffer tmp) {
+ static int glXGetConfig(final long display, final XVisualInfo info, final int attrib, final IntBuffer tmp) {
if (display == 0) {
throw new GLException("No display connection");
}
- int res = GLX.glXGetConfig(display, info, attrib, tmp);
+ final int res = GLX.glXGetConfig(display, info, attrib, tmp);
if (res != 0) {
throw new GLException("glXGetConfig("+toHexString(attrib)+") failed: error code " + glXGetConfigErrorCode(res));
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
index 75771f884..44479acc0 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -94,7 +94,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
@Override
protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
- CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+ final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
if (!(absScreen instanceof X11GraphicsScreen)) {
throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here");
}
@@ -124,8 +124,8 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
(GLCapabilitiesChooser)chooser, (X11GraphicsScreen)absScreen, nativeVisualID);
}
- protected static List getAvailableCapabilities(X11GLXDrawableFactory factory, AbstractGraphicsDevice device) {
- X11GLXDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
+ protected static List getAvailableCapabilities(final X11GLXDrawableFactory factory, final AbstractGraphicsDevice device) {
+ final X11GLXDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
if(null == sharedResource) {
throw new GLException("Shared resource for device n/a: "+device);
}
@@ -153,7 +153,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
return availableCaps;
}
- static List getAvailableGLCapabilitiesFBConfig(X11GraphicsScreen x11Screen, GLProfile glProfile, boolean isMultisampleAvailable) {
+ static List getAvailableGLCapabilitiesFBConfig(final X11GraphicsScreen x11Screen, final GLProfile glProfile, final boolean isMultisampleAvailable) {
PointerBuffer fbcfgsL = null;
// Utilizing FBConfig
@@ -184,20 +184,20 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
return availableCaps;
}
- static List getAvailableGLCapabilitiesXVisual(X11GraphicsScreen x11Screen, GLProfile glProfile, boolean isMultisampleAvailable) {
+ static List getAvailableGLCapabilitiesXVisual(final X11GraphicsScreen x11Screen, final GLProfile glProfile, final boolean isMultisampleAvailable) {
final X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
final long display = absDevice.getHandle();
- int screen = x11Screen.getIndex();
+ final int screen = x11Screen.getIndex();
- int[] count = new int[1];
- XVisualInfo template = XVisualInfo.create();
+ final int[] count = new int[1];
+ final XVisualInfo template = XVisualInfo.create();
template.setScreen(screen);
- XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
+ final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
if (infos == null || infos.length<1) {
throw new GLException("Error while enumerating available XVisualInfos");
}
- ArrayList availableCaps = new ArrayList();
+ final ArrayList availableCaps = new ArrayList();
for (int i = 0; i < infos.length; i++) {
final GLCapabilitiesImmutable caps = X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(absDevice, glProfile, infos[i], GLGraphicsConfigurationUtil.ALL_BITS, isMultisampleAvailable);
if(null != caps) {
@@ -211,17 +211,17 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
- GLCapabilitiesChooser chooser,
- X11GraphicsScreen x11Screen, int xvisualID) {
+ final GLCapabilitiesImmutable capsReq,
+ final GLCapabilitiesChooser chooser,
+ final X11GraphicsScreen x11Screen, final int xvisualID) {
if (x11Screen == null) {
throw new IllegalArgumentException("AbstractGraphicsScreen is null");
}
if (capsChosen == null) {
capsChosen = new GLCapabilities(null);
}
- X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
- X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
+ final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
+ final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, factory, x11Device);
final boolean usePBuffer = !capsChosen.isOnscreen() && capsChosen.isPBuffer();
@@ -250,7 +250,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
return res;
}
- static X11GLXGraphicsConfiguration fetchGraphicsConfigurationFBConfig(X11GraphicsScreen x11Screen, int fbID, GLProfile glp) {
+ static X11GLXGraphicsConfiguration fetchGraphicsConfigurationFBConfig(final X11GraphicsScreen x11Screen, final int fbID, final GLProfile glp) {
final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
final long display = x11Device.getHandle();
final int screen = x11Screen.getIndex();
@@ -274,19 +274,19 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
}
- private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
- GLCapabilitiesChooser chooser,
- X11GraphicsScreen x11Screen, int xvisualID) {
+ private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(final GLCapabilitiesImmutable capsChosen,
+ final GLCapabilitiesImmutable capsReq,
+ final GLCapabilitiesChooser chooser,
+ final X11GraphicsScreen x11Screen, final int xvisualID) {
int recommendedIndex = -1;
PointerBuffer fbcfgsL = null;
- GLProfile glProfile = capsChosen.getGLProfile();
+ final GLProfile glProfile = capsChosen.getGLProfile();
// Utilizing FBConfig
//
- X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
- long display = x11Device.getHandle();
- int screen = x11Screen.getIndex();
+ final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
+ final long display = x11Device.getHandle();
+ final int screen = x11Screen.getIndex();
final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(x11Device);
@@ -379,27 +379,27 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
}
return null;
}
- X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
+ final X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
return new X11GLXGraphicsConfiguration(x11Screen, chosenCaps, capsReq, chooser);
}
- private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(GLCapabilitiesImmutable capsChosen,
- GLCapabilitiesImmutable capsReq,
+ private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(final GLCapabilitiesImmutable capsChosen,
+ final GLCapabilitiesImmutable capsReq,
GLCapabilitiesChooser chooser,
- X11GraphicsScreen x11Screen, int xvisualID) {
+ final X11GraphicsScreen x11Screen, final int xvisualID) {
if (chooser == null) {
chooser = new DefaultGLCapabilitiesChooser();
}
- GLProfile glProfile = capsChosen.getGLProfile();
+ final GLProfile glProfile = capsChosen.getGLProfile();
final int winattrmask = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(capsChosen.isOnscreen(), capsChosen.isFBO(), false /* pbuffer */, capsChosen.isBitmap());
- List availableCaps = new ArrayList();
+ final List availableCaps = new ArrayList();
int recommendedIndex = -1;
- X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
- long display = absDevice.getHandle();
- int screen = x11Screen.getIndex();
+ final X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
+ final long display = absDevice.getHandle();
+ final int screen = x11Screen.getIndex();
final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(absDevice);
@@ -421,10 +421,10 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
}
// 2nd choice: get all GLCapabilities available, preferred recommendedIndex might be available if 1st choice was successful
- int[] count = new int[1];
- XVisualInfo template = XVisualInfo.create();
+ final int[] count = new int[1];
+ final XVisualInfo template = XVisualInfo.create();
template.setScreen(screen);
- XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
+ final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
if (infos == null || infos.length<1) {
throw new GLException("Error while enumerating available XVisualInfos");
}
@@ -451,7 +451,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
if( VisualIDHolder.VID_UNDEFINED != xvisualID ) {
for(int i=0; i chosenIndex ) {
if (DEBUG) {
System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: failed, return null");
@@ -476,7 +476,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
}
return null;
}
- X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
+ final X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
return new X11GLXGraphicsConfiguration(x11Screen, chosenCaps, capsReq, chooser);
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
index 9da189290..866662950 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
@@ -51,7 +51,7 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
long glXWindow; // GLXWindow, a GLXDrawable representation
boolean useGLXWindow;
- protected X11OnscreenGLXDrawable(GLDrawableFactory factory, NativeSurface component, boolean realized) {
+ protected X11OnscreenGLXDrawable(final GLDrawableFactory factory, final NativeSurface component, final boolean realized) {
super(factory, component, realized);
glXWindow=0;
useGLXWindow=false;
@@ -84,10 +84,10 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
@Override
protected final void createHandle() {
if(USE_GLXWINDOW) {
- X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
+ final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
if(config.getFBConfig()>=0) {
useGLXWindow=true;
- long dpy = getNativeSurface().getDisplayHandle();
+ final long dpy = getNativeSurface().getDisplayHandle();
if(0!=glXWindow) {
GLX.glXDestroyWindow(dpy, glXWindow);
}
@@ -103,7 +103,7 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new X11GLXContext(this, shareWith);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
index ae2982269..21ad06020 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
@@ -53,7 +53,7 @@ import javax.media.opengl.GLException;
import com.jogamp.common.nio.Buffers;
public class X11PbufferGLXDrawable extends X11GLXDrawable {
- protected X11PbufferGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
+ protected X11PbufferGLXDrawable(final GLDrawableFactory factory, final NativeSurface target) {
/* GLCapabilities caps,
GLCapabilitiesChooser chooser,
int width, int height */
@@ -70,12 +70,12 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new X11GLXContext(this, shareWith);
}
protected void destroyPbuffer() {
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
if (ns.getSurfaceHandle() != 0) {
GLX.glXDestroyPbuffer(ns.getDisplayHandle(), ns.getSurfaceHandle());
}
@@ -102,7 +102,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
// Create the p-buffer.
int niattribs = 0;
- IntBuffer iattributes = Buffers.newDirectIntBuffer(7);
+ final IntBuffer iattributes = Buffers.newDirectIntBuffer(7);
iattributes.put(niattribs++, GLX.GLX_PBUFFER_WIDTH);
iattributes.put(niattribs++, ms.getSurfaceWidth());
@@ -112,7 +112,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
iattributes.put(niattribs++, 0);
iattributes.put(niattribs++, 0);
- long pbuffer = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes);
+ final long pbuffer = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes);
if (pbuffer == 0) {
// FIXME: query X error code for detail error message
throw new GLException("pbuffer creation error: glXCreatePbuffer() failed");
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
index 42d76097c..e217e1c2a 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
@@ -54,7 +54,7 @@ import jogamp.nativewindow.x11.XVisualInfo;
public class X11PixmapGLXDrawable extends X11GLXDrawable {
private long pixmap;
- protected X11PixmapGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
+ protected X11PixmapGLXDrawable(final GLDrawableFactory factory, final NativeSurface target) {
super(factory, target, false);
}
@@ -68,26 +68,26 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
}
@Override
- public GLContext createContext(GLContext shareWith) {
+ public GLContext createContext(final GLContext shareWith) {
return new X11GLXContext(this, shareWith);
}
private void createPixmap() {
- NativeSurface ns = getNativeSurface();
- X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration();
- XVisualInfo vis = config.getXVisualInfo();
- int bitsPerPixel = vis.getDepth();
- AbstractGraphicsScreen aScreen = config.getScreen();
- AbstractGraphicsDevice aDevice = aScreen.getDevice();
- long dpy = aDevice.getHandle();
- int screen = aScreen.getIndex();
+ final NativeSurface ns = getNativeSurface();
+ final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration();
+ final XVisualInfo vis = config.getXVisualInfo();
+ final int bitsPerPixel = vis.getDepth();
+ final AbstractGraphicsScreen aScreen = config.getScreen();
+ final AbstractGraphicsDevice aDevice = aScreen.getDevice();
+ final long dpy = aDevice.getHandle();
+ final int screen = aScreen.getIndex();
pixmap = X11Lib.XCreatePixmap(dpy, X11Lib.RootWindow(dpy, screen),
surface.getSurfaceWidth(), surface.getSurfaceHeight(), bitsPerPixel);
if (pixmap == 0) {
throw new GLException("XCreatePixmap failed");
}
- long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap);
+ final long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap);
if (drawable == 0) {
X11Lib.XFreePixmap(dpy, pixmap);
pixmap = 0;
@@ -104,7 +104,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
protected void destroyPixmap() {
if (pixmap == 0) return;
- NativeSurface ns = getNativeSurface();
+ final NativeSurface ns = getNativeSurface();
long display = ns.getDisplayHandle();
long drawable = ns.getSurfaceHandle();
@@ -117,7 +117,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
// Must destroy pixmap and GLXPixmap
if (DEBUG) {
- long cur = GLX.glXGetCurrentContext();
+ final long cur = GLX.glXGetCurrentContext();
if (cur != 0) {
System.err.println("WARNING: found context " + toHexString(cur) + " current during pixmap destruction");
}
--
cgit v1.2.3