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

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: 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
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index c899eba311f2b8485aaf3a290c0948534b35b1af..6d0613c56345353c29179a83c1998d1e02215ff2 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2242,16 +2242,19 @@ bool GrGpuGL::configToGLFormats(GrPixelConfig config,
break;
case kAlpha_half_GrPixelConfig:
- 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;
+ if (this->glStandard() == kGL_GrGLStandard) {
+ if (this->glCaps().textureRedSupport()) {
+ *internalFormat = GR_GL_R16F;
+ *externalFormat = GR_GL_RED;
+ } else {
+ *internalFormat = GR_GL_ALPHA16F;
+ *externalFormat = GR_GL_ALPHA;
+ }
+ *externalType = GR_GL_HALF_FLOAT;
} else {
- *internalFormat = GR_GL_ALPHA16F;
+ *internalFormat = GR_GL_ALPHA;
*externalFormat = GR_GL_ALPHA;
- *externalType = (kGLES_GrGLStandard == this->glStandard()) ? GR_GL_HALF_FLOAT
- : GR_GL_HALF_FLOAT_OES;
+ *externalType = GR_GL_HALF_FLOAT_OES;
}
break;

Powered by Google App Engine
This is Rietveld 408576698