[Pixman] [PATCH] Don't discriminate PAD and REFLECT repeat in standard fast paths
Bill Spitzak
spitzak at gmail.com
Wed Sep 22 11:03:34 PDT 2010
What I do in OpenGL is draw a rectangle (well two triangles) textured
with the image with PAD repeat. Outside the rectangle is 0,0,0,0. This
produces the sharp edge I wanted and allows full acceleration to be
used. Because OpenGL and DirectX assume that such sharp edges are how
images will be drawn with translations, they obviously made this the
accelerated path.
Even if you don't want to use geometry, you could also intersect the
clip with a quad (using the current clip implementation) and then draw
all images with PAD.
The problem is that you have to get rid of the current, and useless,
definition of NONE. It must be changed to make a "sharp" edge. This will
not change the output when the image scale is 1 or less, and I believe
the change when the image scale is > 1 will produce the results desired
by most users (ie they expect that drawing a 10x10 image will cover the
same pixels as a 10x10 rectangle).
Soeren Sandmann wrote:
> Bill Spitzak <spitzak at gmail.com> writes:
>
>> This is in fact what users expect, and also what other graphics
>> libraries are doing (which explains why the hardware is supporting PAD
>> directly).
>
> The reason Render's NONE is difficult to accelerate in hardware is
> that for formats without alpha (such as x8r8g8b8), Render wants the
> border to be (0, 0, 0, 0), whereas GL will give you (0xFF, 0, 0, 0).
>
> I thought I heard at one point that Direct3D can do (0, 0, 0, 0), but
> maybe not.
>
>
> Soren
>
More information about the Pixman
mailing list