Backed out changeset b4c58f7a3d4b (bug 1039950) for Windows warnings as errors failures
authorEd Morley <emorley@mozilla.com>
Tue, 05 Aug 2014 13:25:40 +0100
changeset 197819 ff07dcb918fd84f1f7e848c65033b12542630782
parent 197818 f63f87e7657662245e093b71b28ae09f42294532
child 197820 71a55df665e4fdae992d014840967cc1a368e4fd
push id47232
push useremorley@mozilla.com
push dateTue, 05 Aug 2014 12:25:55 +0000
treeherdermozilla-inbound@ff07dcb918fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1039950
milestone34.0a1
backs outb4c58f7a3d4bc7a63db9bdbe9f0ce3ae4af473a3
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset b4c58f7a3d4b (bug 1039950) for Windows warnings as errors failures
dom/canvas/WebGLContextGL.cpp
dom/canvas/WebGLProgram.h
gfx/gl/GLBlitHelper.cpp
gfx/gl/GLBlitHelper.h
gfx/gl/GLBlitTextureImageHelper.cpp
gfx/gl/GLBlitTextureImageHelper.h
gfx/gl/GLContext.h
gfx/gl/GLReadTexImageHelper.cpp
gfx/gl/GLReadTexImageHelper.h
gfx/gl/GLTypes.h
gfx/gl/SkiaGLGlue.cpp
gfx/layers/opengl/OGLShaderProgram.cpp
gfx/layers/opengl/OGLShaderProgram.h
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -125,17 +125,17 @@ WebGLContext::BindAttribLocation(WebGLPr
                                  const nsAString& name)
 {
     if (IsContextLost())
         return;
 
     if (!ValidateObject("bindAttribLocation: program", prog))
         return;
 
-    GLProgram progname = prog->GLName();
+    GLuint progname = prog->GLName();
 
     if (!ValidateGLSLVariableName(name, "bindAttribLocation"))
         return;
 
     if (!ValidateAttribIndex(location, "bindAttribLocation"))
         return;
 
     if (StringBeginsWith(name, NS_LITERAL_STRING("gl_")))
@@ -850,17 +850,17 @@ WebGLContext::GetActiveAttrib(WebGLProgr
         return nullptr;
 
     if (!ValidateObject("getActiveAttrib: program", prog))
         return nullptr;
 
     MakeContextCurrent();
 
     GLint len = 0;
-    GLProgram progname = prog->GLName();;
+    GLuint progname = prog->GLName();;
     gl->fGetProgramiv(progname, LOCAL_GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
     if (len == 0)
         return nullptr;
 
     nsAutoArrayPtr<char> name(new char[len]);
     GLint attrsize = 0;
     GLuint attrtype = 0;
 
@@ -941,17 +941,17 @@ WebGLContext::GetActiveUniform(WebGLProg
         return nullptr;
 
     if (!ValidateObject("getActiveUniform: program", prog))
         return nullptr;
 
     MakeContextCurrent();
 
     GLint len = 0;
-    GLProgram progname = prog->GLName();
+    GLuint progname = prog->GLName();
     gl->fGetProgramiv(progname, LOCAL_GL_ACTIVE_UNIFORM_MAX_LENGTH, &len);
     if (len == 0)
         return nullptr;
 
     nsAutoArrayPtr<char> name(new char[len]);
 
     GLint usize = 0;
     GLuint utype = 0;
@@ -1019,17 +1019,17 @@ WebGLContext::GetAttribLocation(WebGLPro
 
     if (!ValidateGLSLVariableName(name, "getAttribLocation"))
         return -1;
 
     NS_LossyConvertUTF16toASCII cname(name);
     nsCString mappedName;
     prog->MapIdentifier(cname, &mappedName);
 
-    GLProgram progname = prog->GLName();
+    GLuint progname = prog->GLName();
 
     MakeContextCurrent();
     return gl->fGetAttribLocation(progname, mappedName.get());
 }
 
 JS::Value
 WebGLContext::GetBufferParameter(GLenum target, GLenum pname)
 {
@@ -1367,17 +1367,17 @@ JS::Value
 WebGLContext::GetProgramParameter(WebGLProgram *prog, GLenum pname)
 {
     if (IsContextLost())
         return JS::NullValue();
 
     if (!ValidateObjectAllowDeleted("getProgramParameter: program", prog))
         return JS::NullValue();
 
-    GLProgram progname = prog->GLName();
+    GLuint progname = prog->GLName();
 
     MakeContextCurrent();
 
     switch (pname) {
         case LOCAL_GL_ATTACHED_SHADERS:
         case LOCAL_GL_ACTIVE_UNIFORMS:
         case LOCAL_GL_ACTIVE_ATTRIBUTES:
         {
@@ -1434,17 +1434,17 @@ WebGLContext::GetProgramInfoLog(WebGLPro
         return;
     }
 
     if (!ValidateObject("getProgramInfoLog: program", prog)) {
         retval.Truncate();
         return;
     }
 
-    GLProgram progname = prog->GLName();
+    GLuint progname = prog->GLName();
 
     MakeContextCurrent();
 
     GLint k = -1;
     gl->fGetProgramiv(progname, LOCAL_GL_INFO_LOG_LENGTH, &k);
     if (k == -1) {
         // If GetProgramiv doesn't modify |k|,
         // it's because there was a GL error.
@@ -1633,17 +1633,17 @@ WebGLContext::GetUniform(JSContext* cx, 
         return JS::NullValue();
     }
 
     if (location->ProgramGeneration() != prog->Generation()) {
         ErrorInvalidOperation("getUniform: this uniform location is obsolete since the program has been relinked");
         return JS::NullValue();
     }
 
-    GLProgram progname = prog->GLName();
+    GLuint progname = prog->GLName();
 
     MakeContextCurrent();
 
     GLint uniforms = 0;
     GLint uniformNameMaxLength = 0;
     gl->fGetProgramiv(progname, LOCAL_GL_ACTIVE_UNIFORMS, &uniforms);
     gl->fGetProgramiv(progname, LOCAL_GL_ACTIVE_UNIFORM_MAX_LENGTH, &uniformNameMaxLength);
 
@@ -1763,17 +1763,17 @@ WebGLContext::GetUniformLocation(WebGLPr
 
     if (!ValidateGLSLVariableName(name, "getUniformLocation"))
         return nullptr;
 
     NS_LossyConvertUTF16toASCII cname(name);
     nsCString mappedName;
     prog->MapIdentifier(cname, &mappedName);
 
-    GLProgram progname = prog->GLName();
+    GLuint progname = prog->GLName();
     MakeContextCurrent();
     GLint intlocation = gl->fGetUniformLocation(progname, mappedName.get());
 
     nsRefPtr<WebGLUniformLocation> loc;
     if (intlocation >= 0) {
         WebGLUniformInfo info = prog->GetUniformInfoForMappedIdentifier(mappedName);
         loc = new WebGLUniformLocation(this,
                                        prog,
@@ -1897,17 +1897,17 @@ WebGLContext::LinkProgram(WebGLProgram *
         return;
 
     if (!ValidateObject("linkProgram", program))
         return;
 
     InvalidateBufferFetching(); // we do it early in this function
     // as some of the validation below changes program state
 
-    GLProgram progname = program->GLName();
+    GLuint progname = program->GLName();
 
     if (!program->NextGeneration()) {
         // XXX throw?
         return;
     }
 
     if (!program->HasBothShaderTypesAttached()) {
         GenerateWarning("linkProgram: this program doesn't have both a vertex shader"
@@ -2914,17 +2914,17 @@ WebGLContext::UseProgram(WebGLProgram *p
 
     if (!ValidateObjectAllowNull("useProgram", prog))
         return;
 
     MakeContextCurrent();
 
     InvalidateBufferFetching();
 
-    GLProgram progname = prog ? prog->GLName() : GLProgram(0);
+    GLuint progname = prog ? prog->GLName() : 0;
 
     if (prog && !prog->LinkStatus())
         return ErrorInvalidOperation("useProgram: program was not linked successfully");
 
     gl->fUseProgram(progname);
 
     mCurrentProgram = prog;
 }
@@ -2943,17 +2943,17 @@ WebGLContext::ValidateProgram(WebGLProgr
 #ifdef XP_MACOSX
     // see bug 593867 for NVIDIA and bug 657201 for ATI. The latter is confirmed with Mac OS 10.6.7
     if (gl->WorkAroundDriverBugs()) {
         GenerateWarning("validateProgram: implemented as a no-operation on Mac to work around crashes");
         return;
     }
 #endif
 
-    GLProgram progname = prog->GLName();
+    GLuint progname = prog->GLName();
     gl->fValidateProgram(progname);
 }
 
 already_AddRefed<WebGLFramebuffer>
 WebGLContext::CreateFramebuffer()
 {
     if (IsContextLost())
         return nullptr;
--- a/dom/canvas/WebGLProgram.h
+++ b/dom/canvas/WebGLProgram.h
@@ -34,17 +34,17 @@ public:
     WebGLProgram(WebGLContext *context);
 
     void Delete();
 
     void DetachShaders() {
         mAttachedShaders.Clear();
     }
 
-    gl::GLProgram GLName() { return mGLName; }
+    GLuint GLName() { return mGLName; }
     const nsTArray<WebGLRefPtr<WebGLShader> >& AttachedShaders() const { return mAttachedShaders; }
     bool LinkStatus() { return mLinkStatus; }
     uint32_t Generation() const { return mGeneration.value(); }
     void SetLinkStatus(bool val) { mLinkStatus = val; }
 
     bool ContainsShader(WebGLShader *shader) {
         return mAttachedShaders.Contains(shader);
     }
@@ -113,17 +113,17 @@ public:
     static uint64_t IdentifierHashFunction(const char *ident, size_t size);
     static void HashMapIdentifier(const nsACString& name, nsCString *hashedName);
 
 protected:
     ~WebGLProgram() {
         DeleteOnce();
     }
 
-    gl::GLProgram mGLName;
+    GLuint mGLName;
     bool mLinkStatus;
     // attached shaders of the program object
     nsTArray<WebGLRefPtr<WebGLShader> > mAttachedShaders;
     CheckedUint32 mGeneration;
 
     // post-link data
     FallibleTArray<bool> mAttribsInUse;
     nsAutoPtr<CStringMap> mIdentifierMap, mIdentifierReverseMap;
--- a/gfx/gl/GLBlitHelper.cpp
+++ b/gfx/gl/GLBlitHelper.cpp
@@ -276,17 +276,17 @@ GLBlitHelper::InitTexQuadProgram(BlitTyp
             gl_FragColor.g = y - 0.81297 * cr - 0.39176 * cb;               \n\
             gl_FragColor.b = y + cb * 2.01723;                              \n\
             gl_FragColor.a = 1.0;                                           \n\
         }                                                                   \n\
     ";
 
     bool success = false;
 
-    gl::GLProgram *programPtr;
+    GLuint *programPtr;
     GLuint *fragShaderPtr;
     const char* fragShaderSource;
     switch (target) {
     case BlitTex2D:
         programPtr = &mTex2DBlit_Program;
         fragShaderPtr = &mTex2DBlit_FragShader;
         fragShaderSource = kTex2DBlit_FragShaderSource;
         break;
@@ -306,17 +306,17 @@ GLBlitHelper::InitTexQuadProgram(BlitTyp
         programPtr = &mTexYUVPlanarBlit_Program;
         fragShaderPtr = &mTexYUVPlanarBlit_FragShader;
         fragShaderSource = kTexYUVPlanarBlit_FragShaderSource;
         break;
     default:
         return false;
     }
 
-    gl::GLProgram& program = *programPtr;
+    GLuint& program = *programPtr;
     GLuint& fragShader = *fragShaderPtr;
 
     // Use do-while(false) to let us break on failure
     do {
         if (program) {
             // Already have it...
             success = true;
             break;
@@ -514,37 +514,37 @@ GLBlitHelper::DeleteTexBlitProgram()
         mTex2DBlit_FragShader = 0;
     }
     if (mTex2DRectBlit_FragShader) {
         mGL->fDeleteShader(mTex2DRectBlit_FragShader);
         mTex2DRectBlit_FragShader = 0;
     }
     if (mTex2DBlit_Program) {
         mGL->fDeleteProgram(mTex2DBlit_Program);
-        mTex2DBlit_Program = GLProgram(0);
+        mTex2DBlit_Program = 0;
     }
     if (mTex2DRectBlit_Program) {
         mGL->fDeleteProgram(mTex2DRectBlit_Program);
-        mTex2DRectBlit_Program = GLProgram(0);
+        mTex2DRectBlit_Program = 0;
     }
     if (mTexExternalBlit_FragShader) {
         mGL->fDeleteShader(mTexExternalBlit_FragShader);
         mTexExternalBlit_FragShader = 0;
     }
     if (mTexYUVPlanarBlit_FragShader) {
         mGL->fDeleteShader(mTexYUVPlanarBlit_FragShader);
         mTexYUVPlanarBlit_FragShader = 0;
     }
     if (mTexExternalBlit_Program) {
         mGL->fDeleteProgram(mTexExternalBlit_Program);
-        mTexExternalBlit_Program = GLProgram(0);
+        mTexExternalBlit_Program = 0;
     }
     if (mTexYUVPlanarBlit_Program) {
         mGL->fDeleteProgram(mTexYUVPlanarBlit_Program);
-        mTexYUVPlanarBlit_Program = GLProgram(0);
+        mTexYUVPlanarBlit_Program = 0;
     }
 }
 
 void
 GLBlitHelper::BlitFramebufferToFramebuffer(GLuint srcFB, GLuint destFB,
                                            const gfx::IntSize& srcSize,
                                            const gfx::IntSize& destSize)
 {
--- a/gfx/gl/GLBlitHelper.h
+++ b/gfx/gl/GLBlitHelper.h
@@ -100,26 +100,26 @@ class GLBlitHelper MOZ_FINAL
     };
     // The GLContext is the sole owner of the GLBlitHelper.
     GLContext* mGL;
 
     GLuint mTexBlit_Buffer;
     GLuint mTexBlit_VertShader;
     GLuint mTex2DBlit_FragShader;
     GLuint mTex2DRectBlit_FragShader;
-    gl::GLProgram mTex2DBlit_Program;
-    gl::GLProgram mTex2DRectBlit_Program;
+    GLuint mTex2DBlit_Program;
+    GLuint mTex2DRectBlit_Program;
 
     GLint mYFlipLoc;
 
     // Data for image blit path
     GLuint mTexExternalBlit_FragShader;
     GLuint mTexYUVPlanarBlit_FragShader;
-    gl::GLProgram mTexExternalBlit_Program;
-    gl::GLProgram mTexYUVPlanarBlit_Program;
+    GLuint mTexExternalBlit_Program;
+    GLuint mTexYUVPlanarBlit_Program;
     GLuint mFBO;
     GLuint mSrcTexY;
     GLuint mSrcTexCb;
     GLuint mSrcTexCr;
     GLuint mSrcTexEGL;
     GLint mYTexScaleLoc;
     GLint mCbCrTexScaleLoc;
     int mTexWidth;
--- a/gfx/gl/GLBlitTextureImageHelper.cpp
+++ b/gfx/gl/GLBlitTextureImageHelper.cpp
@@ -13,16 +13,17 @@
 #include "gfx2DGlue.h"
 #include "gfxUtils.h"
 
 namespace mozilla {
 namespace gl {
 
 GLBlitTextureImageHelper::GLBlitTextureImageHelper(GLContext* gl)
     : mGL(gl)
+    , mBlitProgram(0)
     , mBlitFramebuffer(0)
 
 {
 }
 
 GLBlitTextureImageHelper::~GLBlitTextureImageHelper()
 {
     // Likely used by OGL Layers.
--- a/gfx/gl/GLBlitTextureImageHelper.h
+++ b/gfx/gl/GLBlitTextureImageHelper.h
@@ -20,18 +20,17 @@ class GLContext;
 class TextureImage;
 
 class GLBlitTextureImageHelper MOZ_FINAL
 {
     // The GLContext is the sole owner of the GLBlitTextureImageHelper.
     GLContext* mGL;
 
     // lazy-initialized things
-    GLProgram mBlitProgram;
-    GLuint mBlitFramebuffer;
+    GLuint mBlitProgram, mBlitFramebuffer;
     void UseBlitProgram();
     void SetBlitFramebufferForDestTexture(GLuint aTexture);
 
 public:
 
     GLBlitTextureImageHelper(GLContext *gl);
     ~GLBlitTextureImageHelper();
 
--- a/gfx/gl/GLContext.h
+++ b/gfx/gl/GLContext.h
@@ -741,32 +741,32 @@ private:
 public:
 
     void fActiveTexture(GLenum texture) {
         BEFORE_GL_CALL;
         mSymbols.fActiveTexture(texture);
         AFTER_GL_CALL;
     }
 
-    void fAttachShader(GLProgram program, GLuint shader) {
+    void fAttachShader(GLuint program, GLuint shader) {
         BEFORE_GL_CALL;
-        mSymbols.fAttachShader(program.Name(), shader);
+        mSymbols.fAttachShader(program, shader);
         AFTER_GL_CALL;
     }
 
     void fBeginQuery(GLenum target, GLuint id) {
         BEFORE_GL_CALL;
         ASSERT_SYMBOL_PRESENT(fBeginQuery);
         mSymbols.fBeginQuery(target, id);
         AFTER_GL_CALL;
     }
 
-    void fBindAttribLocation(GLProgram program, GLuint index, const GLchar* name) {
+    void fBindAttribLocation(GLuint program, GLuint index, const GLchar* name) {
         BEFORE_GL_CALL;
-        mSymbols.fBindAttribLocation(program.Name(), index, name);
+        mSymbols.fBindAttribLocation(program, index, name);
         AFTER_GL_CALL;
     }
 
     void fBindBuffer(GLenum target, GLuint buffer) {
         BEFORE_GL_CALL;
         mSymbols.fBindBuffer(target, buffer);
         AFTER_GL_CALL;
     }
@@ -961,19 +961,19 @@ public:
 
     void fDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf) {
         BEFORE_GL_CALL;
         ASSERT_SYMBOL_PRESENT(fDebugMessageInsert);
         mSymbols.fDebugMessageInsert(source, type, id, severity, length, buf);
         AFTER_GL_CALL;
     }
 
-    void fDetachShader(GLProgram program, GLuint shader) {
+    void fDetachShader(GLuint program, GLuint shader) {
         BEFORE_GL_CALL;
-        mSymbols.fDetachShader(program.Name(), shader);
+        mSymbols.fDetachShader(program, shader);
         AFTER_GL_CALL;
     }
 
     void fDepthFunc(GLenum func) {
         BEFORE_GL_CALL;
         mSymbols.fDepthFunc(func);
         AFTER_GL_CALL;
     }
@@ -1072,37 +1072,37 @@ public:
     }
 
     void fFrontFace(GLenum face) {
         BEFORE_GL_CALL;
         mSymbols.fFrontFace(face);
         AFTER_GL_CALL;
     }
 
-    void fGetActiveAttrib(GLProgram program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
+    void fGetActiveAttrib(GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
         BEFORE_GL_CALL;
-        mSymbols.fGetActiveAttrib(program.Name(), index, maxLength, length, size, type, name);
+        mSymbols.fGetActiveAttrib(program, index, maxLength, length, size, type, name);
         AFTER_GL_CALL;
     }
 
-    void fGetActiveUniform(GLProgram program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
+    void fGetActiveUniform(GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
         BEFORE_GL_CALL;
-        mSymbols.fGetActiveUniform(program.Name(), index, maxLength, length, size, type, name);
+        mSymbols.fGetActiveUniform(program, index, maxLength, length, size, type, name);
         AFTER_GL_CALL;
     }
 
-    void fGetAttachedShaders(GLProgram program, GLsizei maxCount, GLsizei* count, GLuint* shaders) {
+    void fGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders) {
         BEFORE_GL_CALL;
-        mSymbols.fGetAttachedShaders(program.Name(), maxCount, count, shaders);
+        mSymbols.fGetAttachedShaders(program, maxCount, count, shaders);
         AFTER_GL_CALL;
     }
 
-    GLint fGetAttribLocation(GLProgram program, const GLchar* name) {
+    GLint fGetAttribLocation(GLuint program, const GLchar* name) {
         BEFORE_GL_CALL;
-        GLint retval = mSymbols.fGetAttribLocation(program.Name(), name);
+        GLint retval = mSymbols.fGetAttribLocation(program, name);
         AFTER_GL_CALL;
         return retval;
     }
 
 private:
     void raw_fGetIntegerv(GLenum pname, GLint *params) {
         BEFORE_GL_CALL;
         mSymbols.fGetIntegerv(pname, params);
@@ -1161,24 +1161,16 @@ public:
                 break;
 
             default:
                 raw_fGetIntegerv(pname, params);
                 break;
         }
     }
 
-    void fGetIntegerv(GLenum pname, GLProgram *params) {
-        MOZ_ASSERT(pname == LOCAL_GL_CURRENT_PROGRAM, "GetIntegerv(int, GLProgram*) must be called for LOCAL_GL_CURRENT_PROGRAM");
-
-        GLint name;
-        fGetIntegerv(pname, &name);
-        *params = GLProgram(name);
-    }
-
     void GetUIntegerv(GLenum pname, GLuint *params) {
         fGetIntegerv(pname, reinterpret_cast<GLint*>(params));
     }
 
     void fGetFloatv(GLenum pname, GLfloat *params) {
         BEFORE_GL_CALL;
         mSymbols.fGetFloatv(pname, params);
         AFTER_GL_CALL;
@@ -2014,20 +2006,20 @@ private:
 
     void raw_fGenTextures(GLsizei n, GLuint* names) {
         BEFORE_GL_CALL;
         mSymbols.fGenTextures(n, names);
         AFTER_GL_CALL;
     }
 
 public:
-    GLProgram fCreateProgram() {
+    GLuint fCreateProgram() {
         GLuint ret = raw_fCreateProgram();
         TRACKING_CONTEXT(CreatedProgram(this, ret));
-        return GLProgram(ret);
+        return ret;
     }
 
     GLuint fCreateShader(GLenum t) {
         GLuint ret = raw_fCreateShader(t);
         TRACKING_CONTEXT(CreatedShader(this, ret));
         return ret;
     }
 
--- a/gfx/gl/GLReadTexImageHelper.cpp
+++ b/gfx/gl/GLReadTexImageHelper.cpp
@@ -18,16 +18,20 @@
 namespace mozilla {
 namespace gl {
 
 using namespace mozilla::gfx;
 
 GLReadTexImageHelper::GLReadTexImageHelper(GLContext* gl)
     : mGL(gl)
 {
+    mPrograms[0] = 0;
+    mPrograms[1] = 0;
+    mPrograms[2] = 0;
+    mPrograms[3] = 0;
 }
 
 GLReadTexImageHelper::~GLReadTexImageHelper()
 {
     mGL->fDeleteProgram(mPrograms[0]);
     mGL->fDeleteProgram(mPrograms[1]);
     mGL->fDeleteProgram(mPrograms[2]);
     mGL->fDeleteProgram(mPrograms[3]);
@@ -74,17 +78,17 @@ readTextureImageFS_TEXTURE_RECTANGLE[] =
     "#extension GL_ARB_texture_rectangle\n"
     "#ifdef GL_ES\n"
     "precision mediump float;\n"
     "#endif\n"
     "varying vec2 vTexCoord;\n"
     "uniform sampler2DRect uTexture;\n"
     "void main() { gl_FragColor = texture2DRect(uTexture, vTexCoord).bgra; }";
 
-GLProgram
+GLuint
 GLReadTexImageHelper::TextureImageProgramFor(GLenum aTextureTarget,
                                              int aConfig)
 {
     int variant = 0;
     const GLchar* readTextureImageFS = nullptr;
     if (aTextureTarget == LOCAL_GL_TEXTURE_2D) {
         if (aConfig & mozilla::layers::ENABLE_TEXTURE_RB_SWAP) {
             // Need to swizzle R/B.
@@ -109,29 +113,29 @@ GLReadTexImageHelper::TextureImageProgra
         const GLchar* vsSourcePtr = &readTextureImageVS[0];
         mGL->fShaderSource(vs, 1, &vsSourcePtr, nullptr);
         mGL->fCompileShader(vs);
 
         GLuint fs = mGL->fCreateShader(LOCAL_GL_FRAGMENT_SHADER);
         mGL->fShaderSource(fs, 1, &readTextureImageFS, nullptr);
         mGL->fCompileShader(fs);
 
-        GLProgram program = mGL->fCreateProgram();
+        GLuint program = mGL->fCreateProgram();
         mGL->fAttachShader(program, vs);
         mGL->fAttachShader(program, fs);
         mGL->fBindAttribLocation(program, 0, "aVertex");
         mGL->fBindAttribLocation(program, 1, "aTexCoord");
         mGL->fLinkProgram(program);
 
         GLint success;
         mGL->fGetProgramiv(program, LOCAL_GL_LINK_STATUS, &success);
 
         if (!success) {
             mGL->fDeleteProgram(program);
-            program = GLProgram(0);
+            program = 0;
         }
 
         mGL->fDeleteShader(vs);
         mGL->fDeleteShader(fs);
 
         mPrograms[variant] = program;
     }
 
@@ -612,18 +616,17 @@ GLReadTexImageHelper::ReadTexImage(GLuin
 
     /* Allocate resulting image surface */
     int32_t stride = aSize.width * BytesPerPixel(SurfaceFormat::R8G8B8A8);
     RefPtr<DataSourceSurface> isurf =
         Factory::CreateDataSourceSurfaceWithStride(aSize,
                                                    SurfaceFormat::R8G8B8A8,
                                                    stride);
 
-    GLint oldrb, oldfb, oldTexUnit, oldTex;
-    GLProgram oldprog;
+    GLint oldrb, oldfb, oldprog, oldTexUnit, oldTex;
     GLuint rb, fb;
 
     do {
         mGL->fGetIntegerv(LOCAL_GL_RENDERBUFFER_BINDING, &oldrb);
         mGL->fGetIntegerv(LOCAL_GL_FRAMEBUFFER_BINDING, &oldfb);
         mGL->fGetIntegerv(LOCAL_GL_CURRENT_PROGRAM, &oldprog);
         mGL->fGetIntegerv(LOCAL_GL_ACTIVE_TEXTURE, &oldTexUnit);
         mGL->fActiveTexture(LOCAL_GL_TEXTURE0);
@@ -661,17 +664,17 @@ GLReadTexImageHelper::ReadTexImage(GLuin
         mGL->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, fb);
         mGL->fFramebufferRenderbuffer(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0,
                                       LOCAL_GL_RENDERBUFFER, rb);
         CLEANUP_IF_GLERROR_OCCURRED("when binding and creating framebuffer");
 
         MOZ_ASSERT(mGL->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) == LOCAL_GL_FRAMEBUFFER_COMPLETE);
 
         /* Setup vertex and fragment shader */
-        GLProgram program = TextureImageProgramFor(aTextureTarget, aConfig);
+        GLuint program = TextureImageProgramFor(aTextureTarget, aConfig);
         MOZ_ASSERT(program);
 
         mGL->fUseProgram(program);
         CLEANUP_IF_GLERROR_OCCURRED("when using program");
         mGL->fUniform1i(mGL->fGetUniformLocation(program, "uTexture"), 0);
         CLEANUP_IF_GLERROR_OCCURRED("when setting uniform location");
 
         /* Setup quad geometry */
--- a/gfx/gl/GLReadTexImageHelper.h
+++ b/gfx/gl/GLReadTexImageHelper.h
@@ -28,19 +28,19 @@ void ReadPixelsIntoDataSurface(GLContext
 TemporaryRef<gfx::DataSourceSurface>
 ReadBackSurface(GLContext* gl, GLuint aTexture, bool aYInvert, gfx::SurfaceFormat aFormat);
 
 class GLReadTexImageHelper MOZ_FINAL
 {
     // The GLContext is the sole owner of the GLBlitHelper.
     GLContext* mGL;
 
-    GLProgram mPrograms[4];
+    GLuint mPrograms[4];
 
-    GLProgram TextureImageProgramFor(GLenum aTextureTarget, int aShader);
+    GLuint TextureImageProgramFor(GLenum aTextureTarget, int aShader);
 
     bool DidGLErrorOccur(const char* str);
 
 public:
 
     GLReadTexImageHelper(GLContext* gl);
     ~GLReadTexImageHelper();
 
--- a/gfx/gl/GLTypes.h
+++ b/gfx/gl/GLTypes.h
@@ -45,76 +45,16 @@ typedef void GLvoid;
 typedef char GLchar;
 #ifndef __gl2_h_
 typedef intptr_t GLsizeiptr;
 typedef intptr_t GLintptr;
 #endif
 
 #endif /* #if !defined(__gltypes_h_) && !defined(__gl_h_) */
 
-namespace mozilla {
-namespace gl {
-
-enum {
-    BufferObject,
-    ShaderObject,
-    ProgramObject,
-    ProgramPipelineObject,
-    TextureObject,
-    SamplerObject,
-    RenderbufferObject,
-    FramebufferObject,
-    VertexArrayObject,
-    TransformFeedbackObject,
-    QueryObject,
-    SyncObject,
-};
-
-// Generic GL object handles
-/*
- * Each GL object type has an associated strongly-typed handle type.
- * By default the handles are initialized to the zero OpenGL name but if
- * need be can be explicitely initialized to a specific name.
- * Some exmaples:
- *   GLTexture tex; // tex is 0
- *   tex = 42 // error
- *   tex = GLTexture(42); // tex is 42
- *   tex = GLTexture(); // tex is 0 again
- *
- *   void f(GLTexture tex);
- *   f(tex); // ok
- *   f(42); // error
- *   f(GLTexture()) // ok, it is the 0 handle
- */
-
-template<int Type>
-struct ObjectHandle
-{
-    ObjectHandle(): mName(0) {}
-
-    // The explicit here is to prevent automatic conversions when calling functions
-    explicit ObjectHandle(GLuint name): mName(name) {}
-
-    operator bool() const {
-        return mName != 0;
-    }
-
-    GLuint Name() const {
-        return mName;
-    }
-
-private:
-    GLuint mName;
-};
-
-typedef ObjectHandle<ProgramObject> GLProgram;
-
-}
-}
-
 #include <stdint.h>
 
 // ARB_sync
 typedef struct __GLsync* GLsync;
 typedef int64_t GLint64;
 typedef uint64_t GLuint64;
 
 // OES_EGL_image (GLES)
--- a/gfx/gl/SkiaGLGlue.cpp
+++ b/gfx/gl/SkiaGLGlue.cpp
@@ -51,22 +51,22 @@ void EnsureGLContext(const GrGLInterface
 
 GrGLvoid glActiveTexture_mozilla(GrGLenum texture)
 {
     return sGLContext.get()->fActiveTexture(texture);
 }
 
 GrGLvoid glAttachShader_mozilla(GrGLuint program, GrGLuint shader)
 {
-    return sGLContext.get()->fAttachShader(mozilla::gl::GLProgram(program), shader);
+    return sGLContext.get()->fAttachShader(program, shader);
 }
 
 GrGLvoid glBindAttribLocation_mozilla(GrGLuint program, GrGLuint index, const GLchar* name)
 {
-    return sGLContext.get()->fBindAttribLocation(mozilla::gl::GLProgram(program), index, name);
+    return sGLContext.get()->fBindAttribLocation(program, index, name);
 }
 
 GrGLvoid glBindBuffer_mozilla(GrGLenum target, GrGLuint buffer)
 {
     return sGLContext.get()->fBindBuffer(target, buffer);
 }
 
 GrGLvoid glBindFramebuffer_mozilla(GrGLenum target, GrGLuint framebuffer)
@@ -137,17 +137,17 @@ GrGLvoid glCompileShader_mozilla(GrGLuin
 GrGLvoid glCopyTexSubImage2D_mozilla(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset,
                                      GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height)
 {
     return sGLContext.get()->fCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
 }
 
 GrGLuint glCreateProgram_mozilla(void)
 {
-    return sGLContext.get()->fCreateProgram().Name();
+    return sGLContext.get()->fCreateProgram();
 }
 
 GrGLuint glCreateShader_mozilla(GrGLenum type)
 {
     return sGLContext.get()->fCreateShader(type);
 }
 
 GrGLvoid glCullFace_mozilla(GrGLenum mode)
@@ -162,17 +162,17 @@ GrGLvoid glDeleteBuffers_mozilla(GrGLsiz
 
 GrGLvoid glDeleteFramebuffers_mozilla(GrGLsizei n, const GrGLuint* framebuffers)
 {
     return sGLContext.get()->fDeleteFramebuffers(n, framebuffers);
 }
 
 GrGLvoid glDeleteProgram_mozilla(GrGLuint program)
 {
-    return sGLContext.get()->fDeleteProgram(mozilla::gl::GLProgram(program));
+    return sGLContext.get()->fDeleteProgram(program);
 }
 
 GrGLvoid glDeleteRenderbuffers_mozilla(GrGLsizei n, const GrGLuint* renderbuffers)
 {
     return sGLContext.get()->fDeleteRenderbuffers(n, renderbuffers);
 }
 
 GrGLvoid glDeleteShader_mozilla(GrGLuint shader)
@@ -287,22 +287,22 @@ GrGLenum glGetError_mozilla()
 
 GrGLvoid glGetIntegerv_mozilla(GrGLenum pname, GrGLint* params)
 {
     return sGLContext.get()->fGetIntegerv(pname, params);
 }
 
 GrGLvoid glGetProgramInfoLog_mozilla(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, char* infolog)
 {
-    return sGLContext.get()->fGetProgramInfoLog(mozilla::gl::GLProgram(program), bufsize, length, infolog);
+    return sGLContext.get()->fGetProgramInfoLog(program, bufsize, length, infolog);
 }
 
 GrGLvoid glGetProgramiv_mozilla(GrGLuint program, GrGLenum pname, GrGLint* params)
 {
-    return sGLContext.get()->fGetProgramiv(mozilla::gl::GLProgram(program), pname, params);
+    return sGLContext.get()->fGetProgramiv(program, pname, params);
 }
 
 GrGLvoid glGetRenderbufferParameteriv_mozilla(GrGLenum target, GrGLenum pname, GrGLint* params)
 {
     return sGLContext.get()->fGetRenderbufferParameteriv(target, pname, params);
 }
 
 GrGLvoid glGetShaderInfoLog_mozilla(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, char* infolog)
@@ -391,27 +391,27 @@ const GLubyte* glGetString_mozilla(GrGLe
         }
     }
 
     return sGLContext.get()->fGetString(name);
 }
 
 GrGLint glGetUniformLocation_mozilla(GrGLuint program, const char* name)
 {
-    return sGLContext.get()->fGetUniformLocation(mozilla::gl::GLProgram(program), name);
+    return sGLContext.get()->fGetUniformLocation(program, name);
 }
 
 GrGLvoid glLineWidth_mozilla(GrGLfloat width)
 {
     return sGLContext.get()->fLineWidth(width);
 }
 
 GrGLvoid glLinkProgram_mozilla(GrGLuint program)
 {
-    return sGLContext.get()->fLinkProgram(mozilla::gl::GLProgram(program));
+    return sGLContext.get()->fLinkProgram(program);
 }
 
 GrGLvoid glPixelStorei_mozilla(GrGLenum pname, GrGLint param)
 {
     return sGLContext.get()->fPixelStorei(pname, param);
 }
 
 GrGLvoid glReadPixels_mozilla(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height,
@@ -573,17 +573,17 @@ GrGLvoid glUniformMatrix3fv_mozilla(GrGL
 
 GrGLvoid glUniformMatrix4fv_mozilla(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value)
 {
     return sGLContext.get()->fUniformMatrix4fv(location, count, transpose, value);
 }
 
 GrGLvoid glUseProgram_mozilla(GrGLuint program)
 {
-    return sGLContext.get()->fUseProgram(mozilla::gl::GLProgram(program));
+    return sGLContext.get()->fUseProgram(program);
 }
 
 GrGLvoid glVertexAttrib4fv_mozilla(GrGLuint index, const GrGLfloat* values)
 {
     return sGLContext.get()->fVertexAttrib4fv(index, values);
 }
 
 GrGLvoid glVertexAttribPointer_mozilla(GrGLuint index, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const void* ptr)
--- a/gfx/layers/opengl/OGLShaderProgram.cpp
+++ b/gfx/layers/opengl/OGLShaderProgram.cpp
@@ -481,17 +481,17 @@ ShaderProgramOGL::CreateProgram(const ch
                                 const char *aFragmentShaderString)
 {
   GLuint vertexShader = CreateShader(LOCAL_GL_VERTEX_SHADER, aVertexShaderString);
   GLuint fragmentShader = CreateShader(LOCAL_GL_FRAGMENT_SHADER, aFragmentShaderString);
 
   if (!vertexShader || !fragmentShader)
     return false;
 
-  gl::GLProgram result = mGL->fCreateProgram();
+  GLint result = mGL->fCreateProgram();
   mGL->fAttachShader(result, vertexShader);
   mGL->fAttachShader(result, fragmentShader);
 
   mGL->fLinkProgram(result);
 
   GLint success, len;
   mGL->fGetProgramiv(result, LOCAL_GL_LINK_STATUS, &success);
   mGL->fGetProgramiv(result, LOCAL_GL_INFO_LOG_LENGTH, (GLint*) &len);
--- a/gfx/layers/opengl/OGLShaderProgram.h
+++ b/gfx/layers/opengl/OGLShaderProgram.h
@@ -232,17 +232,17 @@ struct ProgramProfileOGL
 
 
 #if defined(DEBUG)
 #define CHECK_CURRENT_PROGRAM 1
 #define ASSERT_THIS_PROGRAM                                             \
   do {                                                                  \
     GLuint currentProgram;                                              \
     mGL->GetUIntegerv(LOCAL_GL_CURRENT_PROGRAM, &currentProgram);       \
-    NS_ASSERTION(gl::GLProgram(currentProgram) == mProgram,         \
+    NS_ASSERTION(currentProgram == mProgram,                            \
                  "SetUniform with wrong program active!");              \
   } while (0)
 #else
 #define ASSERT_THIS_PROGRAM                                             \
   do { } while (0)
 #endif
 
 /**
@@ -382,17 +382,17 @@ public:
 
   size_t GetTextureCount() const {
     return mProfile.mTextureCount;
   }
 
 protected:
   RefPtr<GLContext> mGL;
   // the OpenGL id of the program
-  gl::GLProgram mProgram;
+  GLuint mProgram;
   ProgramProfileOGL mProfile;
   enum {
     STATE_NEW,
     STATE_OK,
     STATE_ERROR
   } mProgramState;
 
 #ifdef CHECK_CURRENT_PROGRAM