| Index: Source/core/html/canvas/WebGLVertexArrayObjectBase.cpp
|
| diff --git a/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp b/Source/core/html/canvas/WebGLVertexArrayObjectBase.cpp
|
| similarity index 61%
|
| copy from Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
|
| copy to Source/core/html/canvas/WebGLVertexArrayObjectBase.cpp
|
| index 82a21d0ba8f7d3abf65a61b551fa3abeac821060..1d3a6b058c198623c364bb9a334745e1f1bcbd9a 100644
|
| --- a/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
|
| +++ b/Source/core/html/canvas/WebGLVertexArrayObjectBase.cpp
|
| @@ -1,42 +1,16 @@
|
| -/*
|
| - * Copyright (C) 2011 Google Inc. All rights reserved.
|
| - *
|
| - * Redistribution and use in source and binary forms, with or without
|
| - * modification, are permitted provided that the following conditions
|
| - * are met:
|
| - * 1. Redistributions of source code must retain the above copyright
|
| - * notice, this list of conditions and the following disclaimer.
|
| - * 2. Redistributions in binary form must reproduce the above copyright
|
| - * notice, this list of conditions and the following disclaimer in the
|
| - * documentation and/or other materials provided with the distribution.
|
| - *
|
| - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
| - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
| - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
| - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
| - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
| - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
| - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
| - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| - */
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
|
|
| #include "config.h"
|
|
|
| -#include "core/html/canvas/WebGLVertexArrayObjectOES.h"
|
| +#include "core/html/canvas/WebGLVertexArrayObjectBase.h"
|
|
|
| #include "core/html/canvas/WebGLRenderingContextBase.h"
|
|
|
| namespace blink {
|
|
|
| -PassRefPtrWillBeRawPtr<WebGLVertexArrayObjectOES> WebGLVertexArrayObjectOES::create(WebGLRenderingContextBase* ctx, VaoType type)
|
| -{
|
| - return adoptRefWillBeNoop(new WebGLVertexArrayObjectOES(ctx, type));
|
| -}
|
| -
|
| -WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES(WebGLRenderingContextBase* ctx, VaoType type)
|
| +WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase(WebGLRenderingContextBase* ctx, VaoType type)
|
| : WebGLContextObject(ctx)
|
| , m_object(0)
|
| , m_type(type)
|
| @@ -57,7 +31,7 @@ WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES(WebGLRenderingContextBase*
|
| }
|
| }
|
|
|
| -WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES()
|
| +WebGLVertexArrayObjectBase::~WebGLVertexArrayObjectBase()
|
| {
|
| #if ENABLE(OILPAN)
|
| m_destructionInProgress = true;
|
| @@ -74,7 +48,7 @@ WebGLVertexArrayObjectOES::~WebGLVertexArrayObjectOES()
|
| detachAndDeleteObject();
|
| }
|
|
|
| -void WebGLVertexArrayObjectOES::dispatchDetached(WebGraphicsContext3D* context3d)
|
| +void WebGLVertexArrayObjectBase::dispatchDetached(WebGraphicsContext3D* context3d)
|
| {
|
| if (m_boundElementArrayBuffer)
|
| m_boundElementArrayBuffer->onDetached(context3d);
|
| @@ -86,7 +60,7 @@ void WebGLVertexArrayObjectOES::dispatchDetached(WebGraphicsContext3D* context3d
|
| }
|
| }
|
|
|
| -void WebGLVertexArrayObjectOES::deleteObjectImpl(WebGraphicsContext3D* context3d)
|
| +void WebGLVertexArrayObjectBase::deleteObjectImpl(WebGraphicsContext3D* context3d)
|
| {
|
| switch (m_type) {
|
| case VaoTypeDefault:
|
| @@ -110,7 +84,7 @@ void WebGLVertexArrayObjectOES::deleteObjectImpl(WebGraphicsContext3D* context3d
|
| #endif
|
| }
|
|
|
| -void WebGLVertexArrayObjectOES::setElementArrayBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer> buffer)
|
| +void WebGLVertexArrayObjectBase::setElementArrayBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer> buffer)
|
| {
|
| if (buffer)
|
| buffer->onAttached();
|
| @@ -119,7 +93,7 @@ void WebGLVertexArrayObjectOES::setElementArrayBuffer(PassRefPtrWillBeRawPtr<Web
|
| m_boundElementArrayBuffer = buffer;
|
| }
|
|
|
| -WebGLVertexArrayObjectOES::VertexAttribState* WebGLVertexArrayObjectOES::getVertexAttribState(size_t index)
|
| +WebGLVertexArrayObjectBase::VertexAttribState* WebGLVertexArrayObjectBase::getVertexAttribState(size_t index)
|
| {
|
| ASSERT(index < context()->maxVertexAttribs());
|
| // Lazily create the vertex attribute states.
|
| @@ -128,7 +102,7 @@ WebGLVertexArrayObjectOES::VertexAttribState* WebGLVertexArrayObjectOES::getVert
|
| return m_vertexAttribState[index].get();
|
| }
|
|
|
| -void WebGLVertexArrayObjectOES::setVertexAttribState(
|
| +void WebGLVertexArrayObjectBase::setVertexAttribState(
|
| GLuint index, GLsizei bytesPerElement, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset, PassRefPtrWillBeRawPtr<WebGLBuffer> buffer)
|
| {
|
| GLsizei validatedStride = stride ? stride : bytesPerElement;
|
| @@ -149,7 +123,7 @@ void WebGLVertexArrayObjectOES::setVertexAttribState(
|
| state->offset = offset;
|
| }
|
|
|
| -void WebGLVertexArrayObjectOES::unbindBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer> buffer)
|
| +void WebGLVertexArrayObjectBase::unbindBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer> buffer)
|
| {
|
| if (m_boundElementArrayBuffer == buffer) {
|
| m_boundElementArrayBuffer->onDetached(context()->webContext());
|
| @@ -165,18 +139,18 @@ void WebGLVertexArrayObjectOES::unbindBuffer(PassRefPtrWillBeRawPtr<WebGLBuffer>
|
| }
|
| }
|
|
|
| -void WebGLVertexArrayObjectOES::setVertexAttribDivisor(GLuint index, GLuint divisor)
|
| +void WebGLVertexArrayObjectBase::setVertexAttribDivisor(GLuint index, GLuint divisor)
|
| {
|
| VertexAttribState* state = getVertexAttribState(index);
|
| state->divisor = divisor;
|
| }
|
|
|
| -DEFINE_TRACE(WebGLVertexArrayObjectOES::VertexAttribState)
|
| +DEFINE_TRACE(WebGLVertexArrayObjectBase::VertexAttribState)
|
| {
|
| visitor->trace(bufferBinding);
|
| }
|
|
|
| -DEFINE_TRACE(WebGLVertexArrayObjectOES)
|
| +DEFINE_TRACE(WebGLVertexArrayObjectBase)
|
| {
|
| visitor->trace(m_boundElementArrayBuffer);
|
| visitor->trace(m_vertexAttribState);
|
|
|