void paintOpacityFlow(CPRect srcRect, CPRect dstRect, byte[] brush, int w, int opacity, int flow) {
			int[] opacityData = opacityBuffer.data;

			int by = srcRect.top;
			for (int j = dstRect.top; j < dstRect.bottom; j++, by++) {
				int srcOffset = srcRect.left + by * w;
				int dstOffset = dstRect.left + j * width;
				for (int i = dstRect.left; i < dstRect.right; i++, srcOffset++, dstOffset++) {
					int brushAlpha = (brush[srcOffset] & 0xff) * flow;
					if (brushAlpha != 0) {
						int opacityAlpha = opacityData[dstOffset];

						int newAlpha = Math.min(255 * 255, opacityAlpha + (opacity - opacityAlpha / 255) * brushAlpha
								/ 255);
						newAlpha = Math.min(opacity * (brush[srcOffset] & 0xff), newAlpha);
						if (newAlpha > opacityAlpha) {
							opacityData[dstOffset] = newAlpha;
						}
					}

				}
			}
		}