Results 1 to 3 of 3

Thread: Coverage buffer

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    2

    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[].

  2. #2
    Senior Member
    Join Date
    Feb 2006
    Posts
    115

    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.

  3. #3
    Junior Member
    Join Date
    Nov 2010
    Posts
    2

    Re: Coverage buffer

    Hi,
    I figured it out now. This does an ORing operation to update pixels from previous rasterizations:
    r->m_covBuffer[j*clip->w + i] |= (RIuint32)sampleMask;

Similar Threads

  1. opencl buffer from premade opengl buffer
    By MohamedSakr in forum OpenCL
    Replies: 0
    Last Post: 11-21-2012, 03:42 PM
  2. How does a color buffer and a vertex buffer fit together?
    By xkrja in forum Developers Coding:Beginner
    Replies: 1
    Last Post: 02-25-2011, 06:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •