[Xorg-driver-geode] Rendering in geode

Jonathan Morton jonathan.morton at movial.com
Mon Jul 12 07:39:29 PDT 2010


On Mon, 2010-07-12 at 09:52 +0800, Huang, FrankR wrote:
>         picture_10x10[0].pict = XRenderCreatePicture(dpy,
> picture_10x10[0].d, picture_10x10[0].format, CPRepeat, &pa);
>         XRenderComposite(dpy, PictOpOver, picture_10x10[0].pict, 0,
> win->pict, 5, 11, 0, 0, 0, 0, 40, 40);
>         
> The source picture is 10x10 region and is repeatable, the srcX is 5
> and srcY is 11(greater than 10), the needed rendering region is 40x40.
> After this is executed, actually a region of 40x40 is rendered. I have
> not see the modulus(%) operation. For example 11%10 = 1 ... So what's
> your mean about the modulus operation?

The modulus operation is used (in Repeat mode) to determine which source
pixel is used for each destination pixel.  It does not determine the
number of pixels to be rendered, and neither does the dimensions of the
source image.

This is in contrast to some other rendering systems, which use the
source dimensions (possibly remapped in some way) to determine the
rendered area.

> So my question is that in this condition, how the destination region
> is rendered? It is important for me. From the experiment, I found it
> is 40x40 region rendered.

The destination region, as I mentioned, is specified explicitly by the
dx,dy,dw,dh parameters.  For every pixel in this region, a source pixel
is determined to match it.

If that source pixel is outside the source image, then in normal Repeat
mode, it is remapped to a point inside the image by repeatedly adding or
subtracting the appropriate source image dimension (ie. the modulus
operation).

If Repeat is turned off, then source pixels outside the image bounds are
instead treated as the all-zeroes vector as previously explained.

The above applies equally to mask images if present.

The resulting pixel is then applied to the blend operation.

-- 
------
From: Jonathan Morton
      jonathan.morton at movial.com




More information about the xorg-devel mailing list