final void drawQuad(int x, int y, int width, int height, int color , int type) {
	if (x < ((SoftwareToolkit) this).widthOffset) {
	    width -= ((SoftwareToolkit) this).widthOffset - x;
	    x = ((SoftwareToolkit) this).widthOffset;
	}
	if (y < ((SoftwareToolkit) this).heightOffset) {
	    height -= ((SoftwareToolkit) this).heightOffset - y;
	    y = ((SoftwareToolkit) this).heightOffset;
	}
	if (x + width > ((SoftwareToolkit) this).width)
	    width = ((SoftwareToolkit) this).width - x;
	if (y + height > ((SoftwareToolkit) this).height)
	    height = ((SoftwareToolkit) this).height - y;
	if (width > 0 && height > 0 && x <= ((SoftwareToolkit) this).width && y <= ((SoftwareToolkit) this).height) {
	    int o = ((SoftwareToolkit) this).maxWidth - width;
	    int destOff = x + y * ((SoftwareToolkit) this).maxWidth;
	    int alpha = color  >>> 24;
	    if (type == 0 || type == 1 && alpha == 255) {
		int amountLoops = width >> 3;
		int remLoops = width & 0x7;
		width = destOff - 1;
		for (int curY = -height; curY < 0; curY++) {
		    if (amountLoops > 0) {
			x = amountLoops;
			do {
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			} while (--x > 0);
		    }
		    if (remLoops > 0) {
			x = remLoops;
			do
			    ((SoftwareToolkit) this).pixelBuffer[++width] = color ;
			while (--x > 0);
		    }
		    width += o;
		}
	    } else if (type == 1) {
		color = (((color  & 0xff00ff) * alpha >> 8 & 0xff00ff) + (((color  & ~0xff00ff) >>> 8) * alpha & ~0xff00ff));
		int i_345_ = 256 - alpha;
		for (int i_346_ = 0; i_346_ < height; i_346_++) {
		    for (int i_347_ = -width; i_347_ < 0; i_347_++) {
			int pixelColor = ((SoftwareToolkit) this).pixelBuffer[destOff];
			pixelColor = (((pixelColor & 0xff00ff) * i_345_ >> 8 & 0xff00ff) + (((pixelColor & ~0xff00ff) >>> 8) * i_345_ & ~0xff00ff));
			((SoftwareToolkit) this).pixelBuffer[destOff++] = color  + pixelColor;
		    }
		    destOff += o;
		}
	    } else if (type == 2) {
		for (int i_349_ = 0; i_349_ < height; i_349_++) {
		    for (int i_350_ = -width; i_350_ < 0; i_350_++) {
			int i_351_ = ((SoftwareToolkit) this).pixelBuffer[destOff];
			int i_352_ = color  + i_351_;
			int i_353_ = (color  & 0xff00ff) + (i_351_ & 0xff00ff);
			i_351_ = (i_353_ & 0x1000100) + (i_352_ - i_353_
							 & 0x10000);
			((SoftwareToolkit) this).pixelBuffer[destOff++] = i_352_ - i_351_ | i_351_ - (i_351_ >>> 8);
		    }
		    destOff += o;
		}
	    } else
		throw new IllegalArgumentException();
	}
    }