Skip to content

Commit

Permalink
add opengl paint debugging with XPRA_OPENGL_PAINT_BOX env var
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@7601 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 14, 2014
1 parent e9dfc16 commit eb9ae12
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/xpra/client/gl/gl_window_backing_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from xpra.log import Logger
log = Logger("opengl", "paint")
OPENGL_DEBUG = os.environ.get("XPRA_OPENGL_DEBUG", "0")=="1"
OPENGL_PAINT_BOX = os.environ.get("XPRA_OPENGL_PAINT_BOX", "0")=="1"

from xpra.gtk_common.gtk_util import import_gobject
idle_add = import_gobject().idle_add
Expand Down Expand Up @@ -422,6 +423,15 @@ def present_fbo(self, x, y, w, h):
glEnd()
glDisable(GL_TEXTURE_RECTANGLE_ARB)

#show region being painted:
if OPENGL_PAINT_BOX:
glLineWidth(1)
glColor4f(0.8, 0.4, 0.4, 0.3) #red-ish
glBegin(GL_LINE_LOOP)
for x,y in ((x, y), (x+w, y), (x+w, y+h), (x, y+h)):
glVertex2i(x, y)
glEnd()

#if desired, paint window border
if self.border and self.border.shown:
#double size since half the line will be off-screen
Expand All @@ -431,8 +441,6 @@ def present_fbo(self, x, y, w, h):
for x,y in ((0, 0), (w, 0), (w, h), (0, h)):
glVertex2i(x, y)
glEnd()
#reset color to default
glColor4f(1.0, 1.0, 1.0, 1.0)

# Show the backbuffer on screen
self.gl_show()
Expand Down

0 comments on commit eb9ae12

Please sign in to comment.