The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Coverage buffer

Hi,
In riApp.cpp, renderStroke(), path->stroke() fills in covBuffer[] with coverage values, then calls pixelPipe->pixelPipe() in a loop to plot each pixel with a coverage filter that is effectively a box.

Why doesn't path->stroke() plot the pixels itself without having this covBuffer[] thing?

Modifying the code to do this shows little difference in the appearance of a diagonal 1-pixel wide line, and saves memory from having to allocate covBuffer[].

Re: Coverage buffer

Firstly, I will say the mandatory:
The reference implementation is not made for speed. It's made for accuracy and picture quality.

In fact, the reference implementation is about 2 orders of magnitude slower than other software only implementations. Deliberately slowly in fact.

That said, it does make sense to calculate coverage first, then paint it. Painting an object with a solid color is trivially easy, and yes, it would benefit from doing the draw in a better way. But what about paint gradients and textures?

In both of these cases, it is common that in the space occupied by a single pixel on the screen, several different color stops or texels are in that pixel. The coverage filter samples the region correctly to give a correct sum of the colors in that pixel. This is a step most implementations skimp on.

If you're looking for fast OpenVG code, do not look at the reference implementation. It's really a tool for people who create faster OpenVG drivers for verifying that their output is correct, that's about it.