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

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

Issue 811133002: Re-enable default sized formats, handling BGRA exception. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase to ToT (ignore, wrong changelist) 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 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;
« 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