From 444d4f9eb0f1f2df79ed3557ba843645515e5695 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 17 Jun 2012 13:49:41 +0000 Subject: [PATCH] if OpenGL does not have FragmentProgramARB then we can still use it, just not for csc. So we toggle use_openGL_CSC flag as needed, and make it global. git-svn-id: https://xpra.org/svn/Xpra/trunk@930 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/gl_client_window.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/xpra/gl_client_window.py b/src/xpra/gl_client_window.py index 9472577a60..b6defc2e5f 100644 --- a/src/xpra/gl_client_window.py +++ b/src/xpra/gl_client_window.py @@ -49,9 +49,9 @@ raise ImportError("** OpenGL output requires OpenGL version 1.1 or greater, not %s.%s" % (gl_major, gl_minor)) log.info("found valid OpenGL: %s.%s", gl_major, gl_minor) - if not glInitFragmentProgramARB(): - #see http://www.opengl.org/registry/specs/ARB/fragment_program.txt - raise ImportError("** OpenGL output requires the ARB_fragment_program extension") + #this allows us to do CSC via OpenGL: + #see http://www.opengl.org/registry/specs/ARB/fragment_program.txt + use_openGL_CSC = glInitFragmentProgramARB() finally: gldrawable.gl_end() del glcontext, gldrawable, glext, glconfig @@ -77,7 +77,6 @@ def do_configure_event(self, event): drawable = self.glarea.get_gl_drawable() context = self.glarea.get_gl_context() - self.use_openGL_CSC = True self.yuv420_shader = None self.current_mode = 0 # 0 = uninitialized 1 = RGB 2 = YUV @@ -150,7 +149,7 @@ def close_decoder(): del decoders[self._id] self._on_close.append(close_decoder) try: - if self.use_openGL_CSC: + if use_openGL_CSC: decompress = decoder.decompress_image_to_yuv update_texture = self.update_texture_yuv420 else: @@ -167,7 +166,7 @@ def close_decoder(): log("paint_with_video_decoder: decompressed %s to %s bytes (%s%%) of rgb24 (%s*%s*3=%s) (outstride: %s)", len(img_data), len(data), int(100*len(img_data)/len(data)),width, height, width*height*3, outstride) update_texture(data, x, y, width, height, outstride) finally: - if not self.use_openGL_CSC: + if not use_openGL_CSC: decoder.free_image() def update_texture_rgb24(self, img_data, x, y, width, height, rowstride):