Fix for alpha textures on Nexus 6.
authorjvanverth <jvanverth@google.com>
Tue, 9 Dec 2014 19:37:11 +0000 (11:37 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 9 Dec 2014 19:37:11 +0000 (11:37 -0800)
Nexus 6 appears to require a sized internal format for A8 textures, much
like other newer mobile devices. Changed to use sized format for A8
textures in general with ES 3.0.

Review URL: https://codereview.chromium.org/783523003

src/gpu/gl/GrGpuGL.cpp

index 56eeb47..c899eba 100644 (file)
@@ -563,15 +563,11 @@ bool GrGpuGL::uploadTexData(const GrSurfaceDesc& desc,
     // size of the internal format whenever possible and so only use a sized internal format when
     // using texture storage.
     bool useSizedFormat = useTexStorage;
-    // At least some versions of the ES3 drivers for NVIDIA and IMG won't accept GL_RED in
+    // Many versions of the ES3 drivers on various platforms will not accept GL_RED in
     // glTexImage2D for the internal format but will accept GL_R8.
-    if (kNVIDIA_GrGLVendor == this->glContext().vendor() ||
-        kImagination_GrGLVendor == this->glContext().vendor() ||
-        this->glContext().isMesa()) {
-        if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER(3, 0) &&
-            kAlpha_8_GrPixelConfig == dataConfig) {
-           useSizedFormat = true;
-        }
+    if (kGLES_GrGLStandard == this->glStandard() && this->glVersion() >= GR_GL_VER(3, 0) &&
+        kAlpha_8_GrPixelConfig == dataConfig) {
+        useSizedFormat = true;
     }
     if (!this->configToGLFormats(dataConfig, useSizedFormat, &internalFormat,
                                  &externalFormat, &externalType)) {