xpra icon
Bug tracker and wiki

Opened 5 years ago

Closed 5 years ago

#416 closed enhancement (fixed)

pixbuf_new_from_data or cairo take un-premultiplied rgb data

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 0.11
Component: client Version:
Keywords: Cc:

Description

r4151 does this, but it's slow and ugly.

Do this in-place properly, or at least return a string we can use directly.

Attachments (1)

mmap-argb-in-place.patch (986 bytes) - added by Antoine Martin 5 years ago.
remove unnecessary conversions with mmap codepath only

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by Antoine Martin

Attachment: mmap-argb-in-place.patch added

remove unnecessary conversions with mmap codepath only

comment:1 Changed 5 years ago by Antoine Martin

Owner: changed from Antoine Martin to Antoine Martin
Status: newassigned

The problem is that:

  • we can get a string as data (from all encoders that can output with alpha: rgb, png, webp) or a class 'xpra.net.mmap_pipe.c_char_Array_409600' with mmap. A string cannot be used as writeable buffer but the c_char_Array can.
  • the data we pass to pixbuf_new_from_data() must be string or read-only buffer, not bytearray

The patch above skips the conversions for the mmap codepath, but we need something that also addresses the double-copy from the standard codepath.

comment:2 Changed 5 years ago by Antoine Martin

Resolution: fixed
Status: assignedclosed

Done in r4843 (see changeset for details)

  • mmap: zero copy
  • string buffers: one copy with numpy (cannot be avoided)
  • without numpy installed: two copies as before

More buffer work in #465

Note: See TracTickets for help on using tickets.