-
Notifications
You must be signed in to change notification settings - Fork 44
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
Split out the GL backend #392
Conversation
36d0f66
to
b6332f9
Compare
e1e1cd4
to
4dd8b97
Compare
4dd8b97
to
0667574
Compare
Had a quick look at this - the approach seems generally valid, but it's a bit hard to review because it's hard to see what has been moved, what has been copied, and what is new. I'll need to set aside some time to map that out. |
The name of the game here is basically: copy all the code from the |
bdc79c0
to
a631af7
Compare
OK, I think I have this running correctly. For concreteness, I am using this branch merged into the #514 branch. Running KivaExplorer with
|
I am also getting failures for Quartz backend:
but I have to check if that is independent of this. |
Looks like #488 caused some breakage in the GL code... With an ugly workaround, I can get it to render: I'll see how hard it is to fix in a less ugly way. |
Open an issue. It's not related here. |
Done. |
a631af7
to
f665e53
Compare
OK. Try again now that I've fixed the font issue. |
OK - it is working better. No font rotation which implies something isn't right with the affine transform code. I'll play with some examples to see if it is just fonts. I still see the red sometimes: this morning I was not plugged into my external monitor and was working on my retina laptop display. On my external monitor I see the image above, on my laptop monitor I see this instead: This feels like it may be an issue with the Enable qt backend GL window class rather than this PR. I am also seeing a lot of flicker when I resize the window like it is painting white then painting the widget. |
I can basically guarantee that the GL backend already had these drawing issues. It looks like CI is segfaulting consistently when using PyQt5. We should probably disable the GL tests there and split out a new issue. |
GL is broken in the master branch. If you apply my |
Yep - it looks as if it is just text which isn't following the rotation of the transform. I'm guessing by the blocky nature of the blue square that it doesn't support drawing with line joins. So I think this is OK in that it is no worse than what we currently have; which is perfectly fine for a refactor. I agree that we should disable the pyqt5 tests for GL and open issues. There is a bigger question about if there are so many missing features with the GL backend is it worth keeping, or should we drop it? It is fast, though. |
Same flickering issue for Pyside2 - even more feels like an issue with the Enable Qt GL window class. |
Much smoother on pyqt4; still a little flickering. |
e0a588a
to
d19c37a
Compare
OK. The only way I've been able to get rid of the test segfaults is by skipping the QPainter tests when running on Linux with Qt5. That's not great, and I'm currently a bit puzzled how the new GL code should be causing problems here. Looking into the drawing issues with Qt5 on macOS, I see a bit of confusion about HiDPI displays. In fact, the GL drawing tests fail there because the context is being resized for the higher res screen, but it appears to be happening in the Pyglet code somewhere. I'll open an issue to track. All of that said, this PR is ready for reviews with an eye to actually merging the code. |
Just shouting into the void here, but here's what I can get out of gdb when looking at the PyQt5-related segfault in the unit tests:
Tested on Ubuntu 18.04 |
You are not shouting to the void :) I am trying to map out the ten thousand line of diffs here and I found some unexplained changes. I think I should batch them instead of spamming the thread though. I am still working on it. |
472f544
to
f47217e
Compare
Good catch. I've corrected this and am also checking to see if it fixes the QPainter segfault.
This is basically the same file as
Yes, it would be nice if it did. |
812d492
to
25344c0
Compare
It did not. |
Thank you @jwiggins for the update, and the latest commits (they look like the original commits from the beginning). The changes make sense. The only lingering issue is the segfault on the two text related tests for QPainter on Linux. I don't really know enough about the objectives of those QPainter tests to tell if the failures represent genuine issues we should worry about and what kind of impact downstream it would be. Apart from that, the rest looks good to me. |
FTR, looks like chaco is happy with the changes introduced in this PR - enthought/chaco#561. I verified in the CI job logs that enable was in fact installed from source ( Testing against another, larger, internal project next. Note that the changes in chaco were not tested on OSX though. UPDATE : The internal project is also happy with the changes in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
To be frank, I couldn't follow most (if not all) of the code changes - but in terms of functionality, i'm happy that the chaco testsuite and an internal project testsuite are both happy with the changes introduced in this PR. Given that, i'm okay with this being merged.
@jwiggins I'm not sure if there are improvements that can be made to the gl/agg backends beyond this PR - or if there are issues that weren't resolved in this PR which we want to address later on (like the QPainter tests segfaulting). Please consider opening additional issues as necessary to track any work that is needed in the future.
Finally, given the weight of changes made in this PR, it is probably best if we make a release candidate i.e. 5.0.0.rc1 (which should be shipped via pypi and edm) and then give our users a week or two to raise concerns before making the final 5.0.0 release.
Big thanks to @corranwebster, @kitchoi, and @rahulporuri for the reviews and feedback here. Let's keep moving. |
This PR aims to separate the Kiva OpenGL backend completely from the agg backend. This has several benefits:
To that end, I've copied all of the GL-specific code from
kiva.agg
into a newkiva.gl
subpackage. Included in the copy is a very small subset of agg 2.4 which is needed for affine transform, color, and path representations.This will begin life as a draft PR, because there are a couple of important steps remaining:
kiva.agg
package