[cairo] Announcing OpenVG backend
Gerdus van Zyl
gerdusvanzyl at gmail.com
Fri Jan 25 05:02:00 PST 2008
Wow, this is great work! A cursory glance at the sources suggest it
may even work on windows. Is this part of the "official" work to get
h/w accel on other platforms than X or a seperate project?
On Jan 25, 2008 1:34 AM, Øyvind Kolås <pippin at gimp.org> wrote:
> Announcing an OpenVG backend for cairo.
> OpenVG is a royalty-free, cross-platform API providing low-level hardware
> acceleration for vector graphics drawing primarily targeting mobile devices..
> At OpenedHand I have developed a proof of concept cairo backend that renders
> using OpenVG. It isn't complete yet but it renders something sensible for most
> input I've been able to throw at it and is thus probably useful for experiments
> for others as well.
> This backend can be used to use OpenGL for acceleration on the Desktop
> when using
> an OpenVG implementation that uses OpenGL like for instance the LGPL
> ShivaVG by
> Ivan Leben. The backend shuld in theory work with any OpenVG implementation but
> has only been tested with ShivaVG and AmanithVG.
> Performance and todo
> The performance and rendering quality depends on the specific OpenVG backend in
> use, when using OpenVG as the backend cairo ideally acts mostly as a middle man
> translating between the APIs. That being said with one test case where
> I am careful
> to only use the well translated parts of the API I am seeing a 2x-4x increase
> in performance depending on which OpenVG over GL implementation I used.
> Most aspects of cairo map closely to OpenVG, but some like the ability to
> specify a clipping path does not. Another thing that is problematic is drawing
> to in memory images by filling/stroking paths using only OpenVG APIs (and not
> using EGL FBOs). Going down this route could potentially have solved the
> clipping path issue as well by using the mask as the clipping path. At the
> moment the OpenVG backend falls back to rendering things in software and
> uploading the resulting rendering as part of the drawing commands to OpenVG,
> this can have severe impact on performance.
> I am going to experiment a bit with the internal meta-surface of cairo to work
> around the vector based source pattern issue. If this works out well the next
> step will be some sanity checking on the use of the vgMask for the clipping
> path. Here it will probably be neccesary to keep track of a stack of paths to
> be applied/reapplied to the mask.
> There is one addition to the OpenVG API that potentially could be sufficient to
> be more fully accelerated which would look something like:
> VG_API_CALL void vgMaskPath(VGPath mask, VGFillRule fill_rule,
> VGMaskOperation operation,
> VGint x, VGint y, VGint width, VGint height);
> This API call doesn't exist though, but could perhaps be added to ShivsVG, or
> somehow be added on top of OpenVG + OpenGL ES to enable passing vector data
> from cairo to OpenVG instead of using cairo's image backend to rasterise masks
> for the clipping path.
> OpenVG has handles for paths as well as patterns. Multiple paths and
> painting contexts
> can exist in OpenVG, at the moment the backend is uploading paths each
> time they are
> used. One of the things that could be kept in a cache of path handles
> is the glyphs
> of fonts, making the operation to render text much cheaper, as well as
> perhaps making
> advantage of potential tessellation caches or similar on the OpenVG side.
> Getting and testing it
> The backend is available for download from: http://cgit.freedesktop.org/
> To add my sources as a remote in git issue:
> $ git remote add pippin people.freedesktop.org:~pippin/cairo.git
> The main file of interest is the backend itself this file can be examined
> through the gitweb interface on freedesktop.
> I've also made a small demo  for comparison purposes which also can
> serve as an example on the OpenVG backend can be used in conjunction with
> setting up an OpenVG context with ShivaVG/AmanithVG from a glut base.
> /Øyvind Kolås
> 1: http://www.khronos.org/openvg/
> 2: http://www.openedhand.com/
> 3: http://ivanleben.blogspot.com/2007/07/shivavg-open-source-ansi-c-openvg.html
> 4: http://www.amanithvg.com/
> 5: http://gitweb.freedesktop.org/?p=users/pippin/cairo.git;a=blob;f=src/cairo-openvg-surface.c;hb=openvg
> 6: http://people.freedesktop.org/~pippin/cairo/OpenVG/cairovgtest.tar.gz
> «The future is already here. It's just not very evenly distributed»
> -- William Gibson
> http://pippin.gimp.org/ http://ffii.org/
> cairo mailing list
> cairo at cairographics.org
More information about the cairo