Hash :
8e34494f
Author :
Date :
2015-07-09T14:22:07
Share data between VertexArray and Impl. Using the same design as for the Framebuffer::Data helper, we can use a struct to share between the object and the Impl. This also gives the Impl access to the maxEnabledAttrib, and saves some duplicated storage. BUG=angleproject:1040 TEST=WebGL CTS, end2end_tests, unittests Change-Id: I55c91e8a5f3dcae302cab441182320aafd5375ef Reviewed-on: https://chromium-review.googlesource.com/283930 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
//
// Copyright 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// VertexAttribImpl.h: Defines the abstract rx::VertexAttribImpl class.
#ifndef LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_
#define LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_
#include "common/angleutils.h"
#include "libANGLE/Buffer.h"
#include "libANGLE/VertexArray.h"
namespace rx
{
class VertexArrayImpl : angle::NonCopyable
{
public:
VertexArrayImpl(const gl::VertexArray::Data &data) : mData(data) { }
virtual ~VertexArrayImpl() { }
virtual void setElementArrayBuffer(const gl::Buffer *buffer) = 0;
virtual void setAttribute(size_t idx, const gl::VertexAttribute &attr) = 0;
virtual void setAttributeDivisor(size_t idx, GLuint divisor) = 0;
virtual void enableAttribute(size_t idx, bool enabledState) = 0;
protected:
const gl::VertexArray::Data &mData;
};
}
#endif // LIBANGLE_RENDERER_VERTEXARRAYIMPL_H_