Bug 12192 - Gdk.Pixbuf.FromDrawable not working correctly on mac
Summary: Gdk.Pixbuf.FromDrawable not working correctly on mac
Status: NEW
Alias: None
Product: Gtk#
Classification: Mono
Component: gtk-sharp ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-05-10 08:56 UTC by Lluis Sanchez
Modified: 2013-05-28 08:38 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test case in C (1.46 KB, text/plain)
2013-05-10 09:17 UTC, Michael Natterer
Details
Patch to fix the color component confusion (4.44 KB, patch)
2013-05-14 10:40 UTC, Michael Natterer
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 12192 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Lluis Sanchez 2013-05-10 08:56:09 UTC
Consider this small app: https://gist.github.com/slluis/dbbaa28b73e146ffac4e. It shows a window with a button. When clicking on it, the button is rendered into a pixbuf.

This is what I see on mac: http://screencast.com/t/dEzbffJH5d

The pixbuf is shown at the bottom, and the colors are wrong. This works on linux and windows, so this looks like a gtk/mac bug unless I'm doing something wrong in that code.
Comment 1 Michael Natterer 2013-05-10 09:17:06 UTC
Created attachment 3945 [details]
Test case in C

The same test case in C. I found the root of the problem in
the pixel copying in _gdk_quartz_image_copy_to_image() but what
I have to do in order to get the RGB(A) components in the right
order seems to contradict the apple docs. Will do some tests on
both patched and unpatched GTK+ (we are using CALayers now in our
version), and on both a window, and the root window.
Comment 2 Michael Natterer 2013-05-14 10:40:08 UTC
Created attachment 3964 [details]
Patch to fix the color component confusion

This is almost too evil to be true, see the comments in the patch,
but I believe it's correct. Can I get some review please before I
push this to upstream?
Comment 3 Michael Natterer 2013-05-28 08:38:14 UTC
Lluis, did the patch fix the swapped color channels for your use case?