Bug 704839 - [5/9] - Refactor mutual ownership of WebGL objects - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Sun, 04 Dec 2011 14:15:43 -0500
changeset 81406 9d44f155bdbb2bba1a54efab894137c4954532d3
parent 81405 e8de56f450c95cc9b4d7f77b1950535e1764ed6a
child 81407 c1de92ddbedfcc6f18e0f22d27fb003d844af535
push id3801
push userbjacob@mozilla.com
push dateSun, 04 Dec 2011 19:18:01 +0000
treeherdermozilla-inbound@d75664a67e3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs704839
milestone11.0a1
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
Bug 704839 - [5/9] - Refactor mutual ownership of WebGL objects - r=jgilbert This patch fixes the implementation of DELETE_STATUS queries.
content/canvas/src/WebGLContextGL.cpp
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -2569,17 +2569,18 @@ WebGLContext::GetProgramParameter(nsIWeb
 {
     if (mContextLost)
         return NS_OK;
 
     *retval = nsnull;
 
     WebGLuint progname;
     bool isDeleted;
-    if (!GetGLName<WebGLProgram>("getProgramParameter: program", pobj, &progname, nsnull, &isDeleted))
+    WebGLProgram *prog;
+    if (!GetConcreteObjectAndGLName("getProgramParameter: program", pobj, &prog, &progname, nsnull, &isDeleted))
         return NS_OK;
 
     nsCOMPtr<nsIWritableVariant> wrval = do_CreateInstance("@mozilla.org/variant;1");
     NS_ENSURE_TRUE(wrval, NS_ERROR_FAILURE);
 
     MakeContextCurrent();
 
     switch (pname) {
@@ -2592,16 +2593,18 @@ WebGLContext::GetProgramParameter(nsIWeb
         case LOCAL_GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
         {
             GLint i = 0;
             gl->fGetProgramiv(progname, pname, &i);
             wrval->SetAsInt32(i);
         }
             break;
         case LOCAL_GL_DELETE_STATUS:
+            wrval->SetAsBool(prog->IsDeleteRequested());
+            break;
         case LOCAL_GL_LINK_STATUS:
         {
             GLint i = 0;
             gl->fGetProgramiv(progname, pname, &i);
             wrval->SetAsBool(bool(i));
         }
             break;
         case LOCAL_GL_VALIDATE_STATUS:
@@ -4509,16 +4512,18 @@ WebGLContext::GetShaderParameter(nsIWebG
         }
             break;
         case LOCAL_GL_SHADER_SOURCE_LENGTH:
         {
             wrval->SetAsInt32(PRInt32(shader->Source().Length()) + 1);
         }
             break;
         case LOCAL_GL_DELETE_STATUS:
+            wrval->SetAsBool(shader->IsDeleteRequested());
+            break;
         case LOCAL_GL_COMPILE_STATUS:
         {
             GLint i = 0;
             gl->fGetShaderiv(shadername, pname, &i);
             wrval->SetAsBool(bool(i));
         }
             break;
         default: