Index: src/gpu/gl/GrGpuGL.cpp |
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp |
index 44514b81a6091c1bddd5a4c67c8b477d45ba55b1..079387bef573fecc1940f350a853f2ac8da1df98 100644 |
--- a/src/gpu/gl/GrGpuGL.cpp |
+++ b/src/gpu/gl/GrGpuGL.cpp |
@@ -2384,18 +2384,25 @@ bool GrGLGpu::configToGLFormats(GrPixelConfig config, |
break; |
case kAlpha_half_GrPixelConfig: |
- if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() < GR_GL_VER(3, 1)) { |
- *internalFormat = GR_GL_ALPHA; |
- *externalFormat = GR_GL_ALPHA; |
- *externalType = GR_GL_HALF_FLOAT_OES; |
- } else if (this->glCaps().textureRedSupport()) { |
- *internalFormat = GR_GL_R16F; |
+ if (this->glCaps().textureRedSupport()) { |
+ if (getSizedInternalFormat) { |
+ *internalFormat = GR_GL_R16F; |
+ } else { |
+ *internalFormat = GR_GL_RED; |
+ } |
*externalFormat = GR_GL_RED; |
- *externalType = GR_GL_HALF_FLOAT; |
} else { |
- *internalFormat = GR_GL_ALPHA16F; |
+ if (getSizedInternalFormat) { |
+ *internalFormat = GR_GL_ALPHA16F; |
+ } else { |
+ *internalFormat = GR_GL_ALPHA; |
+ } |
*externalFormat = GR_GL_ALPHA; |
+ } |
+ if (kGL_GrGLStandard == this->glStandard() || this->glVersion() >= GR_GL_VER(3, 0)) { |
*externalType = GR_GL_HALF_FLOAT; |
+ } else { |
+ *externalType = GR_GL_HALF_FLOAT_OES; |
} |
break; |