You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Lukasz Matuszczak <l....@atrem.pl> on 2005/10/07 11:42:18 UTC
static patch tests & text rendering
Hello Thomas,
Wow, i'm really impressed with batik:static attribute performance. I am rotating
a small arrow over the complex background, and it works even 100x faster.
However i see two weaknesses:
1. When I use the "rotate" interactor (even for very small angle) static
mechanism doesn't seem to work.
2. When I mark the arrow as static (i'm only rotating it) the rendering is very
slow.
I think that second drawback would be hard to correct (how to rotate one
nonrectangular so partly transparent bitmap over another bitmap?) but the first
one I consider a bug.
Another question is about rendering text using svg and system fonts. Why is it
that the first one is even 20x slower than the second one (Windows XP, batik
from trunk). Is it a normal behaviour? I would like to use only svg fonts
because they are system- and even platform- independent, but the performance is
also crucial.
Regards,
Lukasz Matuszczak
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: static patch tests & text rendering
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Lukasz,
Lukasz Matuszczak wrote:
> Wow, i'm really impressed with batik:static attribute performance. I am
> rotating a small arrow over the complex background, and it works even
> 100x faster.
> However i see two weaknesses:
> 1. When I use the "rotate" interactor (even for very small angle) static
> mechanism doesn't seem to work.
It does work, it's just that the Java2D draw if a small angle
rotated raster (with Bi-Linear interp) is much slower than the
unrotated version. I now have a version that re-renders the content
if when rotated so the bit is always aligned to the pixel grid. this
does mean that a 'continuously' rotating static element will have to
be rendered at every frame (although with the old code this was
likely the case as well).
> 2. When I mark the arrow as static (i'm only rotating it) the rendering
> is very slow.
The old code checked the X&Y scale to ensure they matched the
previous rendering, I suspect that these wavered slightly when the
arrow was rotated causing the arrow to be redrawn to the offscreen
bitmap at each frame. For something so simple redrawing it every
frame is _much_ better. Also if you marked the content as 'static'
above where you are changing the transform it will cause the
"whole subtree" to be rerendered from scratch:
<g batik:static="true">
<path id="arrow" transform="rotate(...)"/>
</g>
> I think that second drawback would be hard to correct (how to rotate one
> nonrectangular so partly transparent bitmap over another bitmap?) but
> the first one I consider a bug.
> Another question is about rendering text using svg and system fonts. Why
> is it that the first one is even 20x slower than the second one (Windows
> XP, batik from trunk). Is it a normal behaviour?
I suspect that the issue is that we only lookup and parse the
SVG Font elements when you first reference them. You also need to
take care that all your glyphs are present otherwise Batik starts
looking at all available fonts on the system and this takes a very
long time.
> I would like to use only svg fonts because they are system- and
> even platform- independent, but the performance is also crucial.
Well if you can find something that looks funny I'd be happy
to look into it, but I'd need more info than just it seems slow.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org