protected static final
    synchronized WritableRaster getCachedRaster
            (ColorModel cm, int w, int h) {
        if (cm == cachedModel) {
            if (cached != null) {
                WritableRaster ras = (WritableRaster) cached.get();
                if (ras != null &&
                        ras.getWidth() >= w &&
                        ras.getHeight() >= h) {
                    cached = null;
                    return ras;
                }
            }
        }
        // Don't create rediculously small rasters...
        if (w < 32) w = 32;
        if (h < 32) h = 32;
        return cm.createCompatibleWritableRaster(w, h);
    }