2013-06-28 01:07:21 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "WebGLExtensions.h"
|
2014-11-14 07:03:50 +03:00
|
|
|
|
2013-09-04 16:14:52 +04:00
|
|
|
#include "GLContext.h"
|
2014-11-14 07:03:50 +03:00
|
|
|
#include "mozilla/dom/WebGLRenderingContextBinding.h"
|
|
|
|
#include "WebGLBuffer.h"
|
|
|
|
#include "WebGLContext.h"
|
|
|
|
#include "WebGLVertexArray.h"
|
2013-06-28 01:07:21 +04:00
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
namespace mozilla {
|
2013-06-28 01:07:21 +04:00
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
WebGLExtensionVertexArray::WebGLExtensionVertexArray(WebGLContext* webgl)
|
|
|
|
: WebGLExtensionBase(webgl)
|
2013-06-28 01:07:21 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
WebGLExtensionVertexArray::~WebGLExtensionVertexArray()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
already_AddRefed<WebGLVertexArray>
|
|
|
|
WebGLExtensionVertexArray::CreateVertexArrayOES()
|
2013-06-28 01:07:21 +04:00
|
|
|
{
|
2016-07-19 04:31:56 +03:00
|
|
|
if (mIsLost)
|
2014-03-12 06:51:39 +04:00
|
|
|
return nullptr;
|
|
|
|
|
2013-06-28 01:07:21 +04:00
|
|
|
return mContext->CreateVertexArray();
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
void
|
|
|
|
WebGLExtensionVertexArray::DeleteVertexArrayOES(WebGLVertexArray* array)
|
2013-06-28 01:07:21 +04:00
|
|
|
{
|
2016-07-19 04:31:56 +03:00
|
|
|
if (mIsLost)
|
2014-11-14 07:03:50 +03:00
|
|
|
return;
|
2014-03-12 06:51:39 +04:00
|
|
|
|
2013-06-28 01:07:21 +04:00
|
|
|
mContext->DeleteVertexArray(array);
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
bool
|
2016-11-30 05:30:28 +03:00
|
|
|
WebGLExtensionVertexArray::IsVertexArrayOES(const WebGLVertexArray* array)
|
2013-06-28 01:07:21 +04:00
|
|
|
{
|
2016-07-19 04:31:56 +03:00
|
|
|
if (mIsLost)
|
2014-03-12 06:51:39 +04:00
|
|
|
return false;
|
|
|
|
|
2013-06-28 01:07:21 +04:00
|
|
|
return mContext->IsVertexArray(array);
|
|
|
|
}
|
|
|
|
|
2014-11-14 07:03:50 +03:00
|
|
|
void
|
|
|
|
WebGLExtensionVertexArray::BindVertexArrayOES(WebGLVertexArray* array)
|
2013-06-28 01:07:21 +04:00
|
|
|
{
|
2016-07-19 04:31:56 +03:00
|
|
|
if (mIsLost)
|
2014-11-14 07:03:50 +03:00
|
|
|
return;
|
2014-03-12 06:51:39 +04:00
|
|
|
|
2013-06-28 01:07:21 +04:00
|
|
|
mContext->BindVertexArray(array);
|
|
|
|
}
|
|
|
|
|
2015-06-01 17:17:00 +03:00
|
|
|
IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionVertexArray, OES_vertex_array_object)
|
2014-11-14 07:03:50 +03:00
|
|
|
|
|
|
|
} // namespace mozilla
|