def draw_region(self, x, y, width, height, coding, img_data, rowstride, options): #log("draw_region(%s, %s, %s, %s, %s, %s bytes, %s, %s)", x, y, width, height, coding, len(img_data), rowstride, options) if coding == "mmap": # No GL output for mmap assert coding != "mmap" elif coding == "rgb24": if rowstride > 0: assert len(img_data) == rowstride * height else: assert len(img_data) == width * 3 * height self.update_texture_rgb24(img_data, x, y, width, height, rowstride) elif coding == "x264": assert "x264" in ENCODINGS from xpra.x264.codec import Decoder #@UnresolvedImport self.paint_with_video_decoder(Decoder, "x264", img_data, x, y, width, height, rowstride, options) elif coding == "vpx": assert "vpx" in ENCODINGS from xpra.vpx.codec import Decoder #@UnresolvedImport @Reimport self.paint_with_video_decoder(Decoder, "vpx", img_data, x, y, width, height, rowstride, options) else: raise Exception("** No JPEG/PNG support for OpenGL") queue_draw(self, x, y, width, height) return True
def draw_region(self, x, y, width, height, coding, img_data, rowstride, options): # log("draw_region(%s, %s, %s, %s, %s, %s bytes, %s, %s)", x, y, width, height, coding, len(img_data), rowstride, options) if coding == "mmap": # No GL output for mmap assert coding != "mmap" elif coding == "rgb24": if rowstride > 0: assert len(img_data) == rowstride * height else: assert len(img_data) == width * 3 * height self.update_texture_rgb24(img_data, x, y, width, height, rowstride) elif coding == "x264": assert "x264" in ENCODINGS from xpra.x264.codec import Decoder # @UnresolvedImport self.paint_with_video_decoder(Decoder, "x264", img_data, x, y, width, height, rowstride, options) elif coding == "vpx": assert "vpx" in ENCODINGS from xpra.vpx.codec import Decoder # @UnresolvedImport @Reimport self.paint_with_video_decoder(Decoder, "vpx", img_data, x, y, width, height, rowstride, options) else: raise Exception("** No JPEG/PNG support for OpenGL") queue_draw(self, x, y, width, height) return True
def spinner(self, ok): if not self._backing.paint_screen or not self._backing.glarea or not self.can_have_spinner(): return w, h = self.get_size() if ok: self._backing.render_image(0, 0, w, h) queue_draw(self._backing.glarea, 0, 0, w, h) else: import gtk.gdk window = gdk_window(self._backing.glarea) context = window.cairo_create() self.paint_spinner(context, gtk.gdk.Rectangle(0, 0, w, h))
def spinner(self, ok): if not self._backing.paint_screen or not self._backing.glarea or not self.can_have_spinner( ): return w, h = self.get_size() if ok: self._backing.render_image(0, 0, w, h) queue_draw(self._backing.glarea, 0, 0, w, h) else: import gtk.gdk window = gdk_window(self._backing.glarea) context = window.cairo_create() self.paint_spinner(context, gtk.gdk.Rectangle(0, 0, w, h))