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

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

Issue 762923003: Add support for half float alpha textures. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix config setup 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/GrGLDefines.h ('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 383427d9c28cf2cfc1dfd5ecd7273c1e54fdeb81..56eeb47efce197878a9d79dc5df28360e28df075 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2245,6 +2245,20 @@ bool GrGpuGL::configToGLFormats(GrPixelConfig config,
*externalType = GR_GL_FLOAT;
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;
+ } else {
+ *internalFormat = GR_GL_ALPHA16F;
+ *externalFormat = GR_GL_ALPHA;
+ *externalType = (kGLES_GrGLStandard == this->glStandard()) ? GR_GL_HALF_FLOAT
+ : GR_GL_HALF_FLOAT_OES;
+ }
+ break;
+
default:
return false;
}
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | tests/FloatingPointTextureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698