what is sun.java.loops.MaskBlit.MaskBlit?

HI, I tried to runned my application with “-Xprof”, and I found roughly 15% of the time was spent on sun.java.loops.MaskBlit.MaskBlit. Can anyone breifly tell me what the
hell is sun.java.loops.MaskBlit.MaskBlit, and what it does? I couldn’t get any useful imformation from google.

Thanks

do you mean sun.java2d.loops.MaskBlit.MaskBlit ?

All it is, is an internal blitting routine for drawing images.

Cas :slight_smile:

Thanks. It seems drawing images is quite expensive. I only draw one image(64048032) at each frame, the image itself is created using MemoryImageSource.
Later I tried to construct MemoryImageSource using a different way:

source = new MemoryImageSource(640, 480, new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff), screen, 0, 640);
(now source will create image with 24 bits color instead of 32 bits)

The performance increased significantly, and the “sun.java2d.loops.Blit.Blit” now only occupies 7% of the cpu.

MemoryImageSource is not the optimal way of drawing images, it was made redundant by BufferedImage(and supporting classes) way back in java1.2