Bug 632587 - 1/3 - implement getSupportedExtensions - r=bjacob, a=blocking2.0

This commit is contained in:
Vladimir Vukicevic 2011-03-01 17:25:22 -05:00
parent e89d52fbce
commit ce24155a82
3 changed files with 33 additions and 8 deletions

View File

@ -895,3 +895,34 @@ WebGLActiveInfo::GetName(nsAString & aName)
aName = mName;
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetSupportedExtensions(nsIVariant **retval)
{
nsCOMPtr<nsIWritableVariant> wrval = do_CreateInstance("@mozilla.org/variant;1");
NS_ENSURE_TRUE(wrval, NS_ERROR_FAILURE);
nsTArray<const char *> extList;
/* no extensions to add to extList */
nsresult rv;
if (extList.Length() > 0) {
rv = wrval->SetAsArray(nsIDataType::VTYPE_CHAR_STR, nsnull,
extList.Length(), &extList[0]);
} else {
rv = wrval->SetAsEmptyArray();
}
if (NS_FAILED(rv))
return rv;
*retval = wrval.forget().get();
return NS_OK;
}
NS_IMETHODIMP
WebGLContext::GetExtension(const nsAString& aName, nsISupports **retval)
{
*retval = nsnull;
return NS_OK;
}

View File

@ -4410,10 +4410,3 @@ int mozilla::GetWebGLTexelFormat(GLenum format, GLenum type)
}
}
}
NS_IMETHODIMP
WebGLContext::GetExtension(const nsAString& aName, nsISupports **retval)
{
*retval = nsnull;
return NS_OK;
}

View File

@ -133,7 +133,7 @@ interface nsIWebGLUniformLocation : nsISupports
};
[scriptable, uuid(2f21ca21-9720-4eee-ad94-27eefe4f72dc)]
[scriptable, uuid(7cb54577-df8d-40bf-b7bb-2ddec3600a2c)]
interface nsIDOMWebGLRenderingContext : nsISupports
{
//
@ -836,5 +836,6 @@ interface nsIDOMWebGLRenderingContext : nsISupports
[noscript] DOMString mozGetUnderlyingParamString(in WebGLenum pname);
// extensions
nsIVariant getSupportedExtensions();
nsISupports getExtension(in DOMString name);
};