Hi Neil,
(Getting back to some old email about drawImage.)
> I see a slow-down of 2 to 3 times in my applets, and I am producing a
> medical imaging application. I have no alpha components, and
> am using simple 8-bit IndexColorModel gray images. I have also tried
> 24-bit int[] RGB data with no alphas. There is the same problem.
> Double buffering helps a little, but not as much as in JDK1.1 . It takes
> a heck of a long time to draw that offscreen buffer, compared to what used
> to be a blit in Java1.1 .
The test case you sent us seems to be affected most by the following bugs:
4268438 - 8-bit source images slow to 15/16/24/32 bit destinations
(side note - if all the palette entries are gray then
there were lots of missing loops since those colormodels
didn't automatically use the non-gray 8-bit loops!)
4275538 - DirectColorModel.isCompatibleRaster is overly strict
(if the number of pixel_bits doesn't exactly match the
number of bits needed to store your masks, then DCM
would reject its own rasters as incompatible and we
would resort to using ARGB. It shouldn't even care
what the pixel_bits is as long as the sample masks
are the same.)
Both of these bugs will be fixed for Kestrel FCS. The second bug has
a workaround in that your test case could have specified "24" instead
of "32" for the pixel size and the faster code paths would be used.
There is no reason that the DCM should have been so strict in its
isCompatibleRaster method, but "24" was the "right answer" that it
was looking for. (Also it was silly for it to produce a raster that
it would turn around and reject on a triviality...)
If I run the drawImage call 20 times in a row in the repaint method, there
is still a slight difference in time, but it is no longer the 3x to 4x
difference that we had in 1.2.2.
> Perhaps Java2D-specific coding will help me some,
If your data changes frequently then using a BufferedImage will help
a lot compared to using a MemoryImageSource as the data doesn't have
to be recaptured via ImageConsumer/ImageProducer when it changes.
This will not have much affect on the blit speeds once the image has
been rebuilt via Producer/Consumer though.
...jim
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".