Skip to content

Commit

Permalink
old python compat: use our make_byte_buffer instead of bytearray dire…
Browse files Browse the repository at this point in the history
…ctly

git-svn-id: https://xpra.org/svn/Xpra/trunk@4841 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 3, 2013
1 parent e9d29ce commit f9dfb96
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/xpra/client/gtk2/pixmap_backing.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ def _do_paint_rgb24(self, img_data, x, y, width, height, rowstride, options, cal
return True

def _do_paint_rgb32(self, img_data, x, y, width, height, rowstride, options, callbacks):
#log.debug("do_paint_rgb32(%s bytes, %s, %s, %s, %s, %s, %s, %s) backing depth=%s", len(img_data), x, y, width, height, rowstride, options, callbacks, self._backing.get_depth())
#log.info("do_paint_rgb32(%s bytes, %s, %s, %s, %s, %s, %s, %s) backing depth=%s", len(img_data), x, y, width, height, rowstride, options, callbacks, self._backing.get_depth())
#log.info("data head=%s", [hex(ord(v))[2:] for v in list(img_data[:500])])
#log.info("data=%s", type(img_data))
if self._backing is None:
return False
#FIXME: slow, we create a bytearray and then convert it back to a string!
img_data = bytearray(img_data)
from xpra.codecs.argb.argb import unpremultiply_argb_in_place #@UnresolvedImport
from xpra.codecs.argb.argb import unpremultiply_argb_in_place, make_byte_buffer #@UnresolvedImport
img_data = make_byte_buffer(img_data)
unpremultiply_argb_in_place(img_data)
img_data = str(img_data)
pixbuf = gdk.pixbuf_new_from_data(img_data, gtk.gdk.COLORSPACE_RGB, True, 8, width, height, rowstride)
Expand Down

0 comments on commit f9dfb96

Please sign in to comment.