xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #321: 0001-gl-clear-the-backbuffer-after-swapping-to-force-us-t.patch

File 0001-gl-clear-the-backbuffer-after-swapping-to-force-us-t.patch, 2.6 KB (added by ahuillet, 8 years ago)

Expose backbuffer incorrect assumptions

  • src/xpra/gl/gl_window_backing.py

    From 494a3e1f235ebd1f69899b921eb1cadcf2c9b228 Mon Sep 17 00:00:00 2001
    From: Arthur Huillet <arthur.huillet@free.fr>
    Date: Tue, 23 Apr 2013 12:41:54 +0200
    Subject: [PATCH] gl: clear the backbuffer after swapping - to force us to take
     into account that its contents are undefined
    
    THIS BREAKS RGB24 PAINTING
    ---
     src/xpra/gl/gl_window_backing.py | 10 ++++++++--
     1 file changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/src/xpra/gl/gl_window_backing.py b/src/xpra/gl/gl_window_backing.py
    index 67f8228..7b0f657 100644
    a b from OpenGL.GL import GL_PROJECTION, GL_MODELVIEW, GL_VERTEX_ARRAY, \ 
    2525    GL_TEXTURE_COORD_ARRAY, GL_UNPACK_ROW_LENGTH, GL_UNPACK_ALIGNMENT, \
    2626    GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_NEAREST, \
    2727    GL_UNSIGNED_BYTE, GL_LUMINANCE, GL_RGB, GL_LINEAR, \
    28     GL_TEXTURE0, GL_TEXTURE1, GL_TEXTURE2, GL_QUADS, \
     28    GL_TEXTURE0, GL_TEXTURE1, GL_TEXTURE2, GL_QUADS, GL_COLOR_BUFFER_BIT, \
     29        GL_FRONT, GL_FRONT_AND_BACK, GL_BACK, \
    2930    glActiveTexture, glTexSubImage2D, \
    3031    glGetString, glViewport, glMatrixMode, glLoadIdentity, glOrtho, \
    3132    glEnableClientState, glGenTextures, glDisable, \
    from OpenGL.GL import GL_PROJECTION, GL_MODELVIEW, GL_VERTEX_ARRAY, \ 
    3334    glTexParameteri, \
    3435    glTexImage2D, \
    3536    glMultiTexCoord2i, glColor3f, \
    36     glTexCoord2i, glVertex2i, glEnd
     37    glTexCoord2i, glVertex2i, glEnd, \
     38        glClear, glDrawBuffer
    3739from OpenGL.GL.ARB.texture_rectangle import GL_TEXTURE_RECTANGLE_ARB
    3840from OpenGL.GL.ARB.vertex_program import glGenProgramsARB, glDeleteProgramsARB, \
    3941    glBindProgramARB, glProgramStringARB, GL_PROGRAM_ERROR_STRING_ARB, GL_PROGRAM_FORMAT_ASCII_ARB
    class GLPixmapBacking(PixmapBacking): 
    128130    def gl_end(self, drawable):
    129131        if drawable.is_double_buffered():
    130132            drawable.swap_buffers()
     133            glClear(GL_COLOR_BUFFER_BIT)
    131134        else:
    132135            glFlush()
    133136        drawable.gl_end()
    class GLPixmapBacking(PixmapBacking): 
    158161            glDisable(GL_TEXTURE_RECTANGLE_ARB)
    159162        glActiveTexture(GL_TEXTURE0);
    160163        glEnable(GL_TEXTURE_RECTANGLE_ARB)
     164        glDrawBuffer(GL_FRONT_AND_BACK);
    161165
    162166        # Upload data as temporary RGB texture
     167               
    163168        glBindTexture(GL_TEXTURE_RECTANGLE_ARB, self.textures[3])
    164169        glPixelStorei(GL_UNPACK_ROW_LENGTH, rowstride/3)
    165170        glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
    class GLPixmapBacking(PixmapBacking): 
    181186
    182187        # Reset state
    183188        glEnable(GL_FRAGMENT_PROGRAM_ARB)
     189        glDrawBuffer(GL_BACK);
    184190        self.gl_end(drawable)
    185191        return True
    186192