public void processDamagedCells(final StyledTextConsumer consumer) {
        final int startRow = 0;
        final int endRow = myHeight;
        final int startCol = 0;
        final int endCol = myWidth;
        myLock.lock();
        try {
            for (int row = startRow; row < endRow; row++) {

                TextStyle lastStyle = null;
                int beginRun = startCol;
                for (int col = startCol; col < endCol; col++) {
                    final int location = row * myWidth + col;
                    if (location < 0 || location > myStyleBuf.length) {
                        LOG.error("Requested out of bounds runs: pumpFromDamage");
                        continue;
                    }
                    final TextStyle cellStyle = myStyleBuf[location];
                    final boolean isDamaged = myDamage.get(location);
                    if (!isDamaged) {
                        if (lastStyle != null) { //flush previous run
                            flushStyledText(consumer, row, lastStyle, beginRun, col);
                        }
                        lastStyle = null;
                    } else {
                        if (lastStyle == null) {
                            //begin a new run
                            beginRun = col;
                            lastStyle = cellStyle;
                        } else if (!cellStyle.equals(lastStyle)) {
                            //flush prev run and start of a new one
                            flushStyledText(consumer, row, lastStyle, beginRun, col);
                            beginRun = col;
                            lastStyle = cellStyle;
                        }
                    }
                }
                //flush the last run
                if (lastStyle != null) {
                    flushStyledText(consumer, row, lastStyle, beginRun, endCol);
                }
            }
        } finally {
            myLock.unlock();
        }
    }