Bug 1289005 - Handle GL_BGRA_EXT in GetBytesPerTexel; r?snorp draft
authorJamie Nicol <jnicol@mozilla.com>
Mon, 25 Jul 2016 14:24:34 +0100
changeset 392317 1c50d9ad27b2357f886a6972adcd0ac1ff33419d
parent 392299 7c669d5d63efceb12696cd65cfa72c296013dafb
child 526318 4ffbc036c5e49ac59830189141ed29e8819ab40d
push id24009
push userbmo:jnicol@mozilla.com
push dateMon, 25 Jul 2016 13:30:35 +0000
reviewerssnorp
bugs1289005
milestone50.0a1
Bug 1289005 - Handle GL_BGRA_EXT in GetBytesPerTexel; r?snorp Also, do not MOZ_CRASH for unknown types and formats. The gfxCriticalError will assert in debug builds and provide the values of unknown types or formats. MozReview-Commit-ID: 46sWBdOdqiE
gfx/gl/GLContext.cpp
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -3067,26 +3067,26 @@ GetBytesPerTexel(GLenum format, GLenum t
             case LOCAL_GL_ALPHA:
             case LOCAL_GL_LUMINANCE:
                 return 1 * multiplier;
             case LOCAL_GL_LUMINANCE_ALPHA:
                 return 2 * multiplier;
             case LOCAL_GL_RGB:
                 return 3 * multiplier;
             case LOCAL_GL_RGBA:
+            case LOCAL_GL_BGRA_EXT:
                 return 4 * multiplier;
             default:
                 break;
         }
     } else if (type == LOCAL_GL_UNSIGNED_SHORT_4_4_4_4 ||
                type == LOCAL_GL_UNSIGNED_SHORT_5_5_5_1 ||
                type == LOCAL_GL_UNSIGNED_SHORT_5_6_5)
     {
         return 2;
     }
 
     gfxCriticalError() << "Unknown texture type " << type << " or format " << format;
-    MOZ_CRASH();
     return 0;
 }
 
 } /* namespace gl */
 } /* namespace mozilla */