-
Notifications
You must be signed in to change notification settings - Fork 166
Revert change of Image surface color type from 24 to 32 bit #1835
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
Revert change of Image surface color type from 24 to 32 bit #1835
Conversation
In a previous change (5c2611d), the case distinction in creation of an image's surface depending on using GTK 4 or not has been removed. By accident, this change replaced the previously used 24 bit color format (for both cases) with a 32 bit color format. This change revert that accidental modification.
I've set up a test environment where I can run the problematic GEF test with an SWT version that contains this fix. But it seems like the test fails, regardless of whether a 32-bit or a 24-bit color depth is chosen. Only when I switch back to the previous implementation via
In the image I posted in the other PR, the text of the second line is slightly shorter than the text in the first line. So missing "font options" would explain those differences. Conversely, this then also means that the GTK4 implementation is incomplete, as there I would expect the same behavior... What about reverting the changes to the Image class altogether? From what I can tell, the decision to move away from |
That's interesting. I do not know what other properties are copied by the call to
The call to Can you detail what exactly you (i.e., the GEF code consuming this method) expect from it? Maybe we can directly address that requirement rather than reverting to a workaround. But in case it's necessary to revert, I don't see any reasons against that (except that we need to find a proper solution to still get rid of that workaround as a follow-up task). We only need to make sure that the line number ruler still works when reverting the change to the |
The issue stems from one of our test cases failing because of this change. In short: In our Graphics object, we push the current state of the GC object on a stack, modify the text anti-aliasing and then afterwards restore the old state with a pop operation. This no longer works and even though we call |
Or maybe to rephrase the problem: When creating a GC object, |
So I guess the same issue occurs if you paint via GC on any image not created with this specific initialization logic (e.g., an image created via copy constructor), as they all use this initialization function of Cairo. Maybe it even occurs when you paint via GC on any other drawable (like a Canvas or other Controls).
So might also be that there is an issue wie Can we somehow reproduce the failure of the added test locally? On my system it succeeds even on the master state, so I think it's up to the specifics of the GitHub Actions environment you mentioned in the other PR, isn't it? |
That's the reason why this a real pain to figure out... The only way I see this problem is when an Xvnc server is running. I also don't see the issue locally but only when the tests are executed on either the Jenkins or as a GitHub action. |
Out of interest: What system are you using? I've just booted up my Ubuntu VM and there I see the same issue that is reported on the build nodes: That said, I think I see what the problem is. Let's consider the following situation:
eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java Lines 2532 to 2547 in da081e9
I think what this boils down to is that the default value for anti-aliasing might not necessarily match the default value of the system. In case of Ubuntu where Grayscale is the default, Cairo will still using RGB, unless you explicitly call |
In a previous change (5c2611d), the case distinction in creation of an image's surface depending on using GTK 4 or not has been removed. By accident, this change replaced the previously used 24 bit color format (for both cases) with a 32 bit color format.
This change revert that accidental modification.