Hi, can anyone provide some feedback on this patch? This is my first patch to
compiz, so I'm not sure how to go about the patch review and acceptance process.
Thanks,
Brian
On Sun, Sep 18, 2011 at 11:49:51AM -0700, Brian Nguyen wrote:
> PrivateGLScreen::paintBackground(): If background textures are empty,
> fix the vertex array pointer to use the beginning of the vertex data
> rather than (data + 2). Fix data allocation so only the necessary number
> of vertices is allocated. Disable the unspecified texture coordinate
> array in this case, since leaving it enabled may cause the GL driver to
> segfault when attempting to dereference it.
> ---
> plugins/opengl/src/paint.cpp | 30 ++++++++++++++++++++++--------
> 1 files changed, 22 insertions(+), 8 deletions(-)
>
> diff --git a/plugins/opengl/src/paint.cpp b/plugins/opengl/src/paint.cpp
> index 21b2c11..ecdbdf5 100644
> --- a/plugins/opengl/src/paint.cpp
> +++ b/plugins/opengl/src/paint.cpp
> @@ -92,15 +92,16 @@ PrivateGLScreen::paintBackground (const CompRegion
> ®ion,
> backgroundLoaded = true;
> }
>
> - data = new GLfloat [nBox * 16];
> - if (!data)
> - return;
> -
> - d = data;
> - n = nBox;
> -
> if (backgroundTextures.empty ())
> {
> +
> + data = new GLfloat [nBox * 8];
> + if (!data)
> + return;
> +
> + d = data;
> + n = nBox;
> +
> while (n--)
> {
> *d++ = pBox->x1;
> @@ -118,14 +119,27 @@ PrivateGLScreen::paintBackground (const CompRegion
> ®ion,
> pBox++;
> }
>
> - glVertexPointer (2, GL_FLOAT, sizeof (GLfloat) * 2, data + 2);
> + glDisableClientState(GL_TEXTURE_COORD_ARRAY);
> +
> + glVertexPointer (2, GL_FLOAT, sizeof (GLfloat) * 2, data);
>
> glColor4us (0, 0, 0, std::numeric_limits<unsigned short>::max ());
> glDrawArrays (GL_QUADS, 0, nBox * 4);
> glColor4usv (defaultColor);
> +
> + glEnableClientState(GL_TEXTURE_COORD_ARRAY);
> +
> }
> else
> {
> +
> + data = new GLfloat [nBox * 16];
> + if (!data)
> + return;
> +
> + d = data;
> + n = nBox;
> +
> for (unsigned int i = 0; i < backgroundTextures.size (); i++)
> {
> GLTexture *bg = backgroundTextures[i];
> --
> 1.7.1
>
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may
contain
confidential information. Any unauthorized review, use, disclosure or
distribution
is prohibited. If you are not the intended recipient, please contact the
sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
_______________________________________________
dev mailing list
[email protected]
http://lists.compiz.org/mailman/listinfo/dev