Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / dom / canvas / WebGL1Context.cpp
blob87b3bce798addcd9ef24000c59f5dca246e62e28
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "WebGL1Context.h"
8 #include "mozilla/dom/WebGLRenderingContextBinding.h"
9 #include "mozilla/Telemetry.h"
11 namespace mozilla {
13 /*static*/ WebGL1Context*
14 WebGL1Context::Create()
16 return new WebGL1Context();
19 WebGL1Context::WebGL1Context()
20 : WebGLContext()
24 WebGL1Context::~WebGL1Context()
28 JSObject*
29 WebGL1Context::WrapObject(JSContext* cx)
31 return dom::WebGLRenderingContextBinding::Wrap(cx, this);
34 } // namespace mozilla
36 nsresult
37 NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** out_result)
39 mozilla::Telemetry::Accumulate(mozilla::Telemetry::CANVAS_WEBGL_USED, 1);
41 nsIDOMWebGLRenderingContext* ctx = mozilla::WebGL1Context::Create();
43 NS_ADDREF(*out_result = ctx);
44 return NS_OK;