Attempt to restore OpenGL 2.1 support
ClosedPublic

Authored by alvinhochun on Aug 19 2017, 7:39 AM.

Details

Summary

Partially revert D4506, and effectively revert 96835a05b874abe85b95e1aff525faa4a91368a8

KisOpenGLCanvas2 inheritting from a versioned QOpenGLFunctions_x_x isn't the best idea just to get glLogicOp, so I try to use an alternative method to get it.

glLogicOp is supposed to be in OpenGL core functions since full desktop OpenGL 1.0, just never had been a function in OpenGL ES 2.0 or above, so it should be available even with QOpenGLFunctions_1_0. I used QOpenGLFunctions_2_1 just because that's the minimum version we seem to supported before the change from D4506.

I've only tested it on master, with Qt 5.9.1, and with a driver that clearly supports higher than OpenGL 2.1, and it works. I did have the green brush outline problem on 3.1.4 but not with this patch, so I can say it does not revert what D4506 tried to fix.

Ref: https://bugs.kde.org/show_bug.cgi?id=383281

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alvinhochun created this revision.Aug 19 2017, 7:39 AM
rempt accepted this revision.Aug 19 2017, 8:36 AM
rempt added a subscriber: rempt.

Apart from the note about osx, this builds and works fine on my mac.

libs/ui/opengl/kis_opengl.cpp
274

Heh, it's not part of your changes, but this should be

((glMajorVersion * 100 + glMinorVersion) >= 302)

because otherwise with 4.1, we get a false...

This revision is now accepted and ready to land.Aug 19 2017, 8:36 AM
alvinhochun marked an inline comment as done.Aug 19 2017, 9:10 AM

Will be fixed together.

Probably need someone to test this with AMD drivers too, especially those which had the problem with 3.1.4

This revision was automatically updated to reflect the committed changes.