From bc712740bda0b78ba909894eed7aa6feeb9efe34 Mon Sep 17 00:00:00 2001 From: Robert Phillips Date: Fri, 2 Jun 2017 11:20:37 -0400 Subject: Disable single channel renderability for ANGLE ES2 Bug: 720325 Change-Id: Ib55c7a0c59a23b8dc012e04b626010de7da2921b Reviewed-on: https://skia-review.googlesource.com/18485 Reviewed-by: Brian Salomon Commit-Queue: Robert Phillips --- src/gpu/gl/GrGLCaps.cpp | 7 +++++-- src/gpu/gl/GrGLUtil.cpp | 4 ++++ src/gpu/gl/GrGLUtil.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp index ba5ad6e31e..5aca304194 100644 --- a/src/gpu/gl/GrGLCaps.cpp +++ b/src/gpu/gl/GrGLCaps.cpp @@ -1800,10 +1800,13 @@ void GrGLCaps::initConfigTable(const GrContextOptions& contextOptions, GR_GL_ALPHA; fConfigTable[kAlpha_8_GrPixelConfig].fSwizzle = GrSwizzle::AAAA(); } - if (this->textureRedSupport() || + if ((this->textureRedSupport() && + (ctxInfo.renderer() != kANGLE_GrGLRenderer || kGLES_GrGLStandard != standard)) || (kStandard_MSFBOType == this->msFBOType() && ctxInfo.renderer() != kOSMesa_GrGLRenderer)) { + // ES2 ANGLE seems to disallow single channel renderability (despite advertising the + // "GL_EXT_texture_rg" extension. // OpenGL 3.0+ (and GL_ARB_framebuffer_object) supports ALPHA8 as renderable. - // However, osmesa fails if it used even when GL_ARB_framebuffer_object is present. + // However, osmesa fails if it is used even when GL_ARB_framebuffer_object is present. // Core profile removes ALPHA8 support, but we should have chosen R8 in that case. fConfigTable[kAlpha_8_GrPixelConfig].fFlags |= allRenderFlags; } diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp index 41c57eb1e1..cf4615ad86 100644 --- a/src/gpu/gl/GrGLUtil.cpp +++ b/src/gpu/gl/GrGLUtil.cpp @@ -330,6 +330,10 @@ GrGLRenderer GrGLGetRendererFromString(const char* rendererString) { if (0 == strncmp(rendererString, kMaliTStr, SK_ARRAY_COUNT(kMaliTStr) - 1)) { return kMaliT_GrGLRenderer; } + static const char kANGLEStr[] = "ANGLE"; + if (0 == strncmp(rendererString, kANGLEStr, SK_ARRAY_COUNT(kANGLEStr) - 1)) { + return kANGLE_GrGLRenderer; + } } return kOther_GrGLRenderer; } diff --git a/src/gpu/gl/GrGLUtil.h b/src/gpu/gl/GrGLUtil.h index 261a4cd22d..fc2594a3a0 100644 --- a/src/gpu/gl/GrGLUtil.h +++ b/src/gpu/gl/GrGLUtil.h @@ -58,6 +58,7 @@ enum GrGLRenderer { kIntel6xxx_GrGLRenderer, /** T-6xx, T-7xx, or T-8xx */ kMaliT_GrGLRenderer, + kANGLE_GrGLRenderer, kOther_GrGLRenderer }; -- cgit v1.2.3