Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why does a gradiant paint affect performance so much?  RSS feed

 
Aaron Roberts
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following in a paint method -



Commenting out the first two lines, gives a huge performance jump. Is there some way around this? I'd rather not create my own gradiant routine.

Any ideas?

Regards,
Aaron R>
 
Mikael Grev
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
drawLine() is hardware accelerated if painted with a Color. If you use a GradientPaint it has to be drawn in software, which is a lot slower.
NO way around that I know of other than lobby to Sun for getting hw-accelerated gradients.

Cheers,
Mikael
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And that's interesting since Swing's new default L&F, Ocean, uses Gradients like crazy. :roll:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!