if (area == null)
return;
// long t0 = System.currentTimeMillis();
CachableRed cr;
WritableRaster syncRaster;
WritableRaster copyRaster;
// While we are synchronized pull all the relavent info out
// of member variables into local variables.
updateWorkingBuffers();
if ((rootCR == null) ||
(workingBaseRaster == null))
return;
cr = rootCR;
syncRaster = workingBaseRaster;
copyRaster = workingRaster;
Rectangle srcR = rootCR.getBounds();
Rectangle dstR = workingRaster.getBounds();
if ((dstR.x < srcR.x) ||
(dstR.y < srcR.y) ||
(dstR.x+dstR.width > srcR.x+srcR.width) ||
(dstR.y+dstR.height > srcR.y+srcR.height))
cr = new PadRed(cr, dstR, PadMode.ZERO_PAD, null);
// Ensure only one thread works on baseRaster at a time...
synchronized (syncRaster) {
cr.copyData(copyRaster);
}
if (!Thread.currentThread().isInterrupted()) {
// Swap the buffers if the rendering completed cleanly.
BufferedImage tmpBI = workingOffScreen;