From a0d5ad7208d579e3a9f7a680cbbaf0d2ae5c5d71 Mon Sep 17 00:00:00 2001 From: hendrikw Date: Tue, 2 Dec 2014 07:30:30 -0800 Subject: [PATCH] skia: Prevent GL_RED from being used with MESA MESA unfortunately doesn't support GL_RED or GL_RG when used with frame buffers. Don't allow fTextureRedSupport to be set when using MESA. BUG=skia:3181 Review URL: https://codereview.chromium.org/769073003 --- src/gpu/gl/GrGLCaps.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index 414f06d..b4ee4a6 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -178,20 +178,17 @@ bool GrGLCaps::init(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) { ctxInfo.hasExtension("GL_EXT_texture_storage"); } - // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support it if - // it doesn't have ARB_texture_rg extension. - if (kGL_GrGLStandard == standard) { - if (ctxInfo.isMesa()) { - fTextureRedSupport = ctxInfo.hasExtension("GL_ARB_texture_rg"); - } else { + // ARB_texture_rg is part of OpenGL 3.0, but mesa doesn't support GL_RED + // and GL_RG on FBO textures. + if (!ctxInfo.isMesa()) { + if (kGL_GrGLStandard == standard) { fTextureRedSupport = version >= GR_GL_VER(3,0) || ctxInfo.hasExtension("GL_ARB_texture_rg"); + } else { + fTextureRedSupport = version >= GR_GL_VER(3,0) || + ctxInfo.hasExtension("GL_EXT_texture_rg"); } - } else { - fTextureRedSupport = version >= GR_GL_VER(3,0) || - ctxInfo.hasExtension("GL_EXT_texture_rg"); } - fImagingSupport = kGL_GrGLStandard == standard && ctxInfo.hasExtension("GL_ARB_imaging"); -- 2.7.4