Skip to content

Commit

Permalink
#1309: the OSX client is missing "get_depth" so workaround it
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@15094 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 16, 2017
1 parent c564e75 commit 9dd8354
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
28 changes: 17 additions & 11 deletions src/xpra/client/gl/gl_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,17 +502,23 @@ def check_support(force_enable=False, check_colormap=False):
glconfig = Config_new_by_mode(display_mode)
if not glconfig:
gl_check_error("cannot setup an OpenGL context")
props.update({
"display_mode" : get_MODE_names(display_mode),
#"glconfig" : glconfig,
"has_alpha" : glconfig.has_alpha(),
"rgba" : glconfig.is_rgba(),
"stereo" : glconfig.is_stereo(),
"double-buffered" : glconfig.is_double_buffered(),
"depth" : glconfig.get_depth(),
"has-depth-buffer" : glconfig.has_depth_buffer(),
"has-stencil-buffer" : glconfig.has_stencil_buffer(),
})
props["display_mode"] = get_MODE_names(display_mode)
#on OSX, we had to patch out get_depth...
#so take extra precautions when querying properties:
for x,fn_name in {
"has_alpha" : "has_alpha",
"rgba" : "is_rgba",
"stereo" : "is_stereo",
"double-buffered" : "is_double_buffered",
"depth" : "get_depth",
"has-depth-buffer" : "has_depth_buffer",
"has-stencil-buffer" : "has_stencil_buffer",
}.items():
fn = getattr(glconfig, fn_name, None)
if fn:
props[x] = fn()
else:
log("%s does not support %s()", glconfig, fn_name)
for x in ("RED_SIZE", "GREEN_SIZE", "BLUE_SIZE", "ALPHA_SIZE",
"AUX_BUFFERS", "DEPTH_SIZE", "STENCIL_SIZE",
"ACCUM_RED_SIZE", "ACCUM_GREEN_SIZE", "ACCUM_BLUE_SIZE",
Expand Down
6 changes: 5 additions & 1 deletion src/xpra/client/gl/gl_window_backing_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ def __init__(self, wid, window_alpha):
self.init_gl_config(window_alpha)
self.init_backing()
#this is how many bpp we keep in the texture
self.bit_depth = self.glconfig.get_depth()
#OSX workaround (we hacked the bindings are removed this method - oops!)
if hasattr(self.glconfig, "get_depth"):
self.bit_depth = self.glconfig.get_depth()
else:
self.bit_depth = 24
if self.bit_depth==30 and HIGH_BIT_DEPTH:
self.texture_pixel_type = GL_UNSIGNED_INT_2_10_10_10_REV #GL_UNSIGNED_INT_10_10_10_2
self.texture_pixel_format = GL_RGBA
Expand Down

0 comments on commit 9dd8354

Please sign in to comment.