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.