Hi Jan,
On Nov 10, 2006, at 3:17 AM, Jan Bösenberg (INCORS GmbH) wrote:
In one application I do a lot of text rendering and some line drawing.
Much to my surprise, my profiler says that the app spends much more
time
on line drawing than on the text rendering. OK, I am using ready made
GlyphVectors for the text rendering, which should make text rendering
quite fast, but I still would not expect the app to spend that much
time
on line drawing.
Complex (wide, antialiased, etc) line drawing can be quite time
consuming, and you're right that it's not exactly a fair comparison.
In the text case, we can convert glyphs into bitmaps which are much
faster to render than say, on-the-fly rasterized wide lines.
One important thing to note is that I am using a non-rectangular shape
for clipping when drawing lines (I am using a trapezoid shaped
GeneralPath). The rest is simply done by creating a Line2D object,
setting a BasicStroke (with CAP_BUTT and JOIN_BEVEL) and calling the
draw(Shape s) method on the Graphics object.
Any ideas where the time is spent? Is it the non-rectangular
clipping shape?
I assume you have antialiasing enabled? For things like
antialiasing, non-rectangular clip, wide BasicStroke... any of these
things can cause us to fall back on a different renderer, so it's not
just one thing that's causing the slowdown. The OpenGL-based
pipeline can accelerate things like antialiased rendering as well as
complex clipping, so that might help improve performance in your
case. Short of that, we'll just need to continue improving
performance of our rasterizing code.
Thanks,
Chris
Cheers
Jan
======================================================================
=====
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".