[cairo] [RFC] Cairo GLES2 and GL_CLAMP_TO_BORDER

Alexandros Frantzis alexandros.frantzis at linaro.org
Fri Feb 18 08:13:20 PST 2011


On Fri, Feb 18, 2011 at 10:39:42AM -0500, Behdad Esfahbod wrote:
> I didn't know GL_CLAMP_TO_BORDER is not part of GLES2.  Humm, in my GLES2
> codes I have this and seems to work fine:
> 
>   glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
>   glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
> 
> Is it just that the border is removed?  In which case we can includes a 1px
> border in the texture, right?
> 
> behdad

I considered this briefly before, but I believe that it will make the
code much more complicated. Implicit borders are not supported at all in
GLES2, neither through GL_TEXTURE_BORDER_COLOR in glTexParameter() nor
through the border value in glTexImage*(). The only option is to
explicitly create W+1 x H+1 textures, but then we will have to take care
of all the complications of handling W+1 x H+1 textures as W x H
textures everywhere.

I haven't thought this through 100% but my feeling is that we are better
off without such complications.

I will be happy to be proven wrong, though :)

Thanks,
Alexandros



More information about the cairo mailing list