Bug 895855 - [WebGL 2.0] Build error when using --disable-webgl. r=bjacob

This commit is contained in:
Guillaume Abadie 2013-07-19 12:53:54 -04:00
parent e54eb27318
commit b85cdb7050
2 changed files with 6 additions and 8 deletions

View File

@ -4,13 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMWebGLRenderingContext.h"
#include "WebGL2Context.h"
#define DUMMY(func,rtype) nsresult func (rtype ** aResult) { return NS_ERROR_FAILURE; }
DUMMY(NS_NewCanvasRenderingContextWebGL, nsIDOMWebGLRenderingContext)
WebGL2Context * WebGL2Context::Create()
{
return nullptr;
}

View File

@ -31,7 +31,9 @@
#include "nsNetUtil.h"
#include "nsStreamUtils.h"
#ifdef MOZ_WEBGL
#include "../canvas/src/WebGL2Context.h"
#endif
using namespace mozilla::layers;
@ -684,8 +686,9 @@ HTMLCanvasElement::GetContextHelper(const nsAString& aContextId,
ctx.forget(aContext);
return NS_OK;
}
else if (WebGL2Context::IsSupported() &&
aContextId.EqualsLiteral("experimental-webgl2"))
#ifdef MOZ_WEBGL
if (WebGL2Context::IsSupported() &&
aContextId.EqualsLiteral("experimental-webgl2"))
{
Telemetry::Accumulate(Telemetry::CANVAS_WEBGL_USED, 1);
nsRefPtr<WebGL2Context> ctx = WebGL2Context::Create();
@ -698,6 +701,7 @@ HTMLCanvasElement::GetContextHelper(const nsAString& aContextId,
ctx.forget(aContext);
return NS_OK;
}
#endif
NS_ConvertUTF16toUTF8 ctxId(aContextId);