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

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

Issue 398183002: Fix alpha textures in NV ES3 contexts on Windows (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: suppress warning Created 6 years, 5 months 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/GrGLUtil.cpp ('k') | tests/DeferredCanvasTest.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 52e3c33601fee7ed886385acf16f600d0cea666b..b62129fe879603fa421e216aef083ac9544f5f1d 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -137,9 +137,7 @@ GrGpuGL::GrGpuGL(const GrGLContext& ctx, GrContext* context)
GrPrintf("------ RENDERER %s\n", renderer);
GrPrintf("------ VERSION %s\n", version);
GrPrintf("------ EXTENSIONS\n");
-#if 0 // TODO: Reenable this after GrGLInterface's extensions can be accessed safely.
- ctx.extensions().print();
-#endif
+ ctx.extensions().print();
GrPrintf("\n");
GrPrintf(this->glCaps().dump().c_str());
}
@@ -574,13 +572,21 @@ bool GrGpuGL::uploadTexData(const GrGLTexture::Desc& desc,
}
GrGLenum internalFormat;
- GrGLenum externalFormat;
- GrGLenum externalType;
+ GrGLenum externalFormat = 0x0; // suprress warning
+ GrGLenum externalType = 0x0;// suprress warning
+
// glTexStorage requires sized internal formats on both desktop and ES. ES2 requires an unsized
// format for glTexImage, unlike ES3 and desktop. However, we allow the driver to decide the
// size of the internal format whenever possible and so only use a sized internal format when
// using texture storage.
- if (!this->configToGLFormats(dataConfig, useTexStorage, &internalFormat,
+ bool useSizedFormat = useTexStorage;
+ // At least some versions of the desktop ES3 drivers for NVIDIA won't accept GL_RED in
+ // glTexImage2D for the internal format but will accept GL_R8.
+ if (!useSizedFormat && kNVIDIA_GrGLVendor == this->glContext().vendor() &&
+ kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER(3, 0)) {
+ useSizedFormat = true;
+ }
+ if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat,
&externalFormat, &externalType)) {
return false;
}
« no previous file with comments | « src/gpu/gl/GrGLUtil.cpp ('k') | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698