On Wed, 19 Apr 2006 16:00:14 +0200, "Ricard Marxer Piñón" <ricardmp@...400...> wrote:
Hi there,
I'm having a little bit of trouble understanding the code. Maybe someone can give me a fast explanation of this.
From my point of view Inkscape should have to type of renderers:
- a fast and optimized one (maybe not necessarly an exact one) for
realtime rendering. kind of a WYSIWYG renderer for when modifying on screen
- a slow but precise renderer for getting a print-ready, camera-ready or
even video/film-ready, hi-res,...
These two renderers should have a common API (primitive drawing commands proper to rasterized images (points, lines and filled triangles)) in order to be able to extend this idea to other renderers (maybe someone comes up with a better antialiasing algorithm or a better renderer, or even a different buffer type result (hexagonal pixel buffers,...).
I know that the fast renderer might be a bit harder since it must be able to only draw changes, but there must be a way of dealing with this.
This seems to be lumping together an awful lot of different separate concerns.
At the lowest level, we've simply got a rasterizer which renders polygons onto a buffer, filled with a pattern/texture, as well as some supplementary effects like stroking paths. That's handled via libnr/livarot at the moment. Long-term, we want to use pixman/cairo instead. This would be where the common drawing API.
On top of this, we've got a retained-mode API which remembers the scene graph and can in principle do incremental/differential rendering. For example, if only part of a shape needed painting, this layer would be responsible for extracting a subset of its outline to pass on to the lower-level layer. Right now this is handled by NRArena, which is actually pretty dumb and unoptimized. But that's where the "only draw changes" bits would belong.
From a broad perspective, this is not too different from the architecture of many 3d graphics engines.
I'm not sure where the shader-based stuff belongs in all this -- it sounds like the sort of thing that would go in a cairo backend (glitz, maybe?), hidden behind the cairo API.
-mental