The canvas handling code work in widget (scaled) logical pixel space, but the OpenGL shaders work in (unscaled) device pixel space, which is probably what causing issues.
I also suspect the wrong scaling algorithm is chosen since it doesn't take into account the devicePixelRatioF() scale, but that is another issue...