if (params.doBufferedImageForGrids && isLayerFromGrid) {
Rectangle clipBounds = graphics.getClipBounds();
BufferedImage bi = new BufferedImage(clipBounds.width,
clipBounds.height, BufferedImage.TYPE_INT_ARGB);
Graphics2D biG2D = (Graphics2D) bi.getGraphics();
renderer.render(biG2D, monitor);
graphics.drawImage(bi, null, 0, 0);
biG2D.dispose();
}else{
renderer.render(graphics, monitor);
}