Hi, everyone

Recently I am porting gnash to a 600MHz ARM like machine based on
SDL+AGG. The resulting sdl-gnash palyer could run correctly, but with poor
performance( cpu 100% even playing a simple swf file, e.g. an 400x200
advertisement ).

I read gnash's source, and added a setInvalidatedRegions call in SDLGui, to
set invalidated regions in the renderer after movie_root::advance(), before
movie_root::display(). That helps a lot, but performance is still not
satisfied.

Compiling sdl-gnash staticly with -pg shows: generate_span
and agg::render_scanlines_compound_layered cost most of time. So I wonder
whether there is way to forbid rendering via agg pipelines (so costly ,
vertex generating, coordinate conversions, rasterizing, span
generatering, and then span blending ) every time when drawing a
bitmap/gradient filled shape that has never been changed during the whole
lifetime. I guess the situation is common, for example, if the flash uses a
picture of snow field as its background, and there are snowflakes fly in the
sky, the bitmap background would be rendered from time to time because it
always has intersection with the invalidated regions.

So, my idea is add a bitmap cache for each character( or bitmap/gradient
filled shape only ), when a character is displayed for the first time, agg
renderer will draw in its bitmap cache, then next time the character is
showed, agg renderer could simply read from cache and do a blit. The cache
is cleaned only when the character is rotated or scaled,

I notice one of  the developpers mensioned nearly the same idea in comments
of render_handler_agg.cpp . Is the method feasible? Anyone did such a work
in a branch?

BTW, I am also considering using SIMD instructions to accelerate agg's
blending operation, any suggestion?

Regards,

Wei Cao
_______________________________________________
Gnash-dev mailing list
Gnash-dev@gnu.org
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to