Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pixbuf_new_from_data or cairo take un-premultiplied rgb data #416

Closed
totaam opened this issue Aug 12, 2013 · 7 comments
Closed

pixbuf_new_from_data or cairo take un-premultiplied rgb data #416

totaam opened this issue Aug 12, 2013 · 7 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Aug 12, 2013

Issue migrated from trac ticket # 416

component: client | priority: major | resolution: fixed

2013-08-12 11:26:28: totaam created the issue


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

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

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 07:24:53: totaam uploaded file mmap-argb-in-place.patch (1.0 KiB)

remove unnecessary conversions with mmap codepath only

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 07:26:10: totaam changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 07:26:10: totaam changed owner from antoine to totaam

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 07:26:10: totaam commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 08:51:30: totaam changed status from assigned to closed

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 08:51:30: totaam changed resolution from ** to fixed

@totaam
Copy link
Collaborator Author

totaam commented Dec 3, 2013

2013-12-03 08:51:30: totaam commented


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

@totaam totaam closed this as completed Dec 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant