Bug 1610775 [wpt PR 21336] - Update urllib3 to 1.25.8, a=testonly
[gecko.git] / dom / canvas / WebGLVertexArrayGL.cpp
blob5ebd01c76aedfb3f5124fec87f635160f253ac1f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 "WebGLVertexArrayGL.h"
8 #include "GLContext.h"
9 #include "WebGLContext.h"
11 namespace mozilla {
13 WebGLVertexArrayGL::WebGLVertexArrayGL(WebGLContext* webgl)
14 : WebGLVertexArray(webgl), mGLName([&]() {
15 GLuint ret = 0;
16 webgl->gl->fGenVertexArrays(1, &ret);
17 return ret;
18 }()) {}
20 WebGLVertexArrayGL::~WebGLVertexArrayGL() {
21 if (!mContext) return;
22 mContext->gl->fDeleteVertexArrays(1, &mGLName);
25 void WebGLVertexArrayGL::BindVertexArray() {
26 mContext->mBoundVertexArray = this;
27 mContext->gl->fBindVertexArray(mGLName);
30 } // namespace mozilla