Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1328)

Unified Diff: src/gpu/gl/GrGpuGL.cpp

Issue 799593002: Fix float and half float support on mobile. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rearrange format setup to get around GCC 4.8 Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLCaps.cpp ('k') | tests/FloatingPointTextureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index c899eba311f2b8485aaf3a290c0948534b35b1af..0de41318e865193c2668c63b142049c5f374c14e 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2242,16 +2242,18 @@ bool GrGpuGL::configToGLFormats(GrPixelConfig config,
break;
case kAlpha_half_GrPixelConfig:
- if (this->glCaps().textureRedSupport()) {
+ 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;
*externalFormat = GR_GL_RED;
- *externalType = (kGLES_GrGLStandard == this->glStandard()) ? GR_GL_HALF_FLOAT
- : GR_GL_HALF_FLOAT_OES;
+ *externalType = GR_GL_HALF_FLOAT;
} else {
*internalFormat = GR_GL_ALPHA16F;
*externalFormat = GR_GL_ALPHA;
- *externalType = (kGLES_GrGLStandard == this->glStandard()) ? GR_GL_HALF_FLOAT
- : GR_GL_HALF_FLOAT_OES;
+ *externalType = GR_GL_HALF_FLOAT;
}
break;
« no previous file with comments | « src/gpu/gl/GrGLCaps.cpp ('k') | tests/FloatingPointTextureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698