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"
13 /*static*/ WebGL1Context
*
14 WebGL1Context::Create()
16 return new WebGL1Context();
19 WebGL1Context::WebGL1Context()
24 WebGL1Context::~WebGL1Context()
29 WebGL1Context::WrapObject(JSContext
* cx
)
31 return dom::WebGLRenderingContextBinding::Wrap(cx
, this);
34 } // namespace mozilla
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
);