/src/mozilla-central/dom/canvas/WebGLExtensionVertexArray.cpp
Line | Count | Source (jump to first uncovered line) |
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/. */ |
5 | | |
6 | | #include "WebGLExtensions.h" |
7 | | |
8 | | #include "GLContext.h" |
9 | | #include "mozilla/dom/WebGLRenderingContextBinding.h" |
10 | | #include "WebGLBuffer.h" |
11 | | #include "WebGLContext.h" |
12 | | #include "WebGLVertexArray.h" |
13 | | |
14 | | namespace mozilla { |
15 | | |
16 | | WebGLExtensionVertexArray::WebGLExtensionVertexArray(WebGLContext* webgl) |
17 | | : WebGLExtensionBase(webgl) |
18 | 0 | { |
19 | 0 | } |
20 | | |
21 | | WebGLExtensionVertexArray::~WebGLExtensionVertexArray() |
22 | 0 | { |
23 | 0 | } |
24 | | |
25 | | already_AddRefed<WebGLVertexArray> |
26 | | WebGLExtensionVertexArray::CreateVertexArrayOES() |
27 | 0 | { |
28 | 0 | if (mIsLost) |
29 | 0 | return nullptr; |
30 | 0 | |
31 | 0 | return mContext->CreateVertexArray(); |
32 | 0 | } |
33 | | |
34 | | void |
35 | | WebGLExtensionVertexArray::DeleteVertexArrayOES(WebGLVertexArray* array) |
36 | 0 | { |
37 | 0 | if (mIsLost) |
38 | 0 | return; |
39 | 0 | |
40 | 0 | mContext->DeleteVertexArray(array); |
41 | 0 | } |
42 | | |
43 | | bool |
44 | | WebGLExtensionVertexArray::IsVertexArrayOES(const WebGLVertexArray* array) |
45 | 0 | { |
46 | 0 | if (mIsLost) |
47 | 0 | return false; |
48 | 0 | |
49 | 0 | return mContext->IsVertexArray(array); |
50 | 0 | } |
51 | | |
52 | | void |
53 | | WebGLExtensionVertexArray::BindVertexArrayOES(WebGLVertexArray* array) |
54 | 0 | { |
55 | 0 | if (mIsLost) |
56 | 0 | return; |
57 | 0 | |
58 | 0 | mContext->BindVertexArray(array); |
59 | 0 | } |
60 | | |
61 | | IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionVertexArray, OES_vertex_array_object) |
62 | | |
63 | | } // namespace mozilla |