[EMAIL PROTECTED] wrote:
Hi, Dmitri
In both cases above you create a BufferedImage,
not a Volatile one. To create VolatileImage, you'd need to use
GC.createCompatibleVolatileImage(). (you'd need to
add some extra code to validate them before you use them though, but
for testing purposes, just validate them once when you create)
Correct me if i'm wrong, but shouldn't i be validating a cached volatile image
befoer every use?
Yes, VI should be validated before every use.
I'm just saying that for a quick test you don't
need to do that.
Nimbus L&F uses VIs for caching, and they saw
pretty good performance improvement from that with the d3d
pipeline enabled.
I don't believe that we have access to sources of 6u10 in general, and of Nimbus in particular.
I understand - I was just pointing out that it is
beneficial to use hw acceleration if available - we
have a "success story" to prove it =)
Caching makes sense if you don't change the
contents of the cache much. Does your code update the cached images
often?
Once the image gets into the cache, its contents are never touched.
Then in theory it should be fast once the cache is filled
since images can be cached in textures- but according to the
primitives log there's lots of unaccelerated rendering going on -
may be the benchmark basically only catches the "cache fill"
phase?
One good thing about VolatileImages is that they don't
increase the footprint of the application (if they reside
in vram).
One perf.-related suggestion: make sure you don't
clear the background (fillRect) with antialiasing enabled (a
common mistake). So if your components need to clear the
bg first, unset the AA, clear, then set it back.
I will look at the code to make sure that i don't do that.
Thanks for the tips.
Kirill
[Message sent by forum member 'kirillcool' (kirillcool)]
http://forums.java.net/jive/thread.jspa?messageID=270840
===========================================================================
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".
===========================================================================
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".