diff --git a/krita/ui/canvas/kis_mirror_axis.cpp b/krita/ui/canvas/kis_mirror_axis.cpp --- a/krita/ui/canvas/kis_mirror_axis.cpp +++ b/krita/ui/canvas/kis_mirror_axis.cpp @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include @@ -147,13 +149,16 @@ gc.setBrush(Qt::white); gc.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); -//QT5TODO: T360 -#if defined(HAVE_OPENGL) && defined(HAVE_GLEW) +#if defined(HAVE_OPENGL) + QOpenGLContext *ctx = QOpenGLContext::currentContext(); + bool hasMultisample = ((gc.paintEngine()->type() == QPaintEngine::OpenGL2) && + (ctx->hasExtension("GL_ARB_multisample"))); + // QPainter cannot anti-alias the edges of circles etc. when using OpenGL // So instead, use native OpenGL anti-aliasing when available. - if(gc.paintEngine()->type() == QPaintEngine::OpenGL2 && GLEW_ARB_multisample) { + if (hasMultisample) { gc.beginNativePainting(); - glEnable(GL_MULTISAMPLE); + ctx->functions()->glEnable(GL_MULTISAMPLE); gc.endNativePainting(); } #endif @@ -210,11 +215,10 @@ } } -//QT5TODO: T360 -#if defined(HAVE_OPENGL) && defined(HAVE_GLEW) - if(gc.paintEngine()->type() == QPaintEngine::OpenGL2 && GLEW_ARB_multisample) { +#if defined(HAVE_OPENGL) + if (hasMultisample) { gc.beginNativePainting(); - glDisable(GL_MULTISAMPLE); + ctx->functions()->glDisable(GL_MULTISAMPLE); gc.endNativePainting(); } #endif diff --git a/krita/ui/opengl/kis_opengl_canvas2_p.h b/krita/ui/opengl/kis_opengl_canvas2_p.h --- a/krita/ui/opengl/kis_opengl_canvas2_p.h +++ b/krita/ui/opengl/kis_opengl_canvas2_p.h @@ -139,7 +139,7 @@ int interval = ((wglGetSwapIntervalEXT)ctx->getProcAddress("wglGetSwapIntervalEXT"))(); if (interval) { - qWarning() << "Failed to disable VSync with WGLEW_EXT_swap_control"; + qWarning() << "Failed to disable VSync with WGL_EXT_swap_control"; } retval = !interval; diff --git a/krita/ui/opengl/kis_opengl_image_textures.cpp b/krita/ui/opengl/kis_opengl_image_textures.cpp --- a/krita/ui/opengl/kis_opengl_image_textures.cpp +++ b/krita/ui/opengl/kis_opengl_image_textures.cpp @@ -453,7 +453,6 @@ dbgUI << "Choosing texture format:"; -// QT5TODO: T360 if (colorModelId == RGBAColorModelID) { if (colorDepthId == Float16BitsColorDepthID) { @@ -471,7 +470,7 @@ haveBuiltInOpenExr = true; #endif - if (haveBuiltInOpenExr && ctx->hasExtension("GLEW_ARB_half_float_pixel")) { + if (haveBuiltInOpenExr && ctx->hasExtension("GL_ARB_half_float_pixel")) { m_texturesInfo.type = GL_HALF_FLOAT_ARB; destinationColorDepthId = Float16BitsColorDepthID; dbgUI << "Pixel type half"; @@ -483,10 +482,10 @@ m_texturesInfo.format = GL_RGBA; } else if (colorDepthId == Float32BitsColorDepthID) { - if (ctx->hasExtension("GLEW_ARB_texture_float")) { + if (ctx->hasExtension("GL_ARB_texture_float")) { m_texturesInfo.internalFormat = GL_RGBA32F_ARB; dbgUI << "Using ARB float"; - } else if (ctx->hasExtension("GLEW_ATI_texture_float")) { + } else if (ctx->hasExtension("GL_ATI_texture_float")) { m_texturesInfo.internalFormat = GL_RGBA_FLOAT32_ATI; dbgUI << "Using ATI float"; }