void mergeOpacityBuffer(int color, boolean clear) {
		if (!opacityArea.isEmpty()) {
			if (curBrush.paintMode != CPBrushInfo.M_ERASE || !lockAlpha) {
				paintingModes[curBrush.paintMode].mergeOpacityBuf(opacityArea, color);
			} else {
				// FIXME: it would be nice to be able to set the paper color
				paintingModes[CPBrushInfo.M_PAINT].mergeOpacityBuf(opacityArea, 0xffffff);
			}

			if (lockAlpha) {
				restoreAlpha(opacityArea);
			}

			if (clear) {
				opacityBuffer.clear(opacityArea, 0);
			}

			opacityArea.makeEmpty();
		}
	}