chromium/third_party/angle/src/tests/test_utils/gl_raii.h

//
// Copyright 2016 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.
//
// gl_raii:
//   Helper methods for containing GL objects like buffers and textures.

#ifndef ANGLE_TESTS_GL_RAII_H_
#define ANGLE_TESTS_GL_RAII_H_

#include <functional>

#include "common/debug.h"
#include "util/shader_utils.h"

namespace angle
{

// This is a bit of hack to work around a bug in MSVS intellisense, and make it very easy to
// use the correct function pointer type without worrying about the various definitions of
// GL_APICALL.
GLGen;
GLDelete;

class GLWrapper : angle::NonCopyable
{};

class GLVertexArray : public GLWrapper
{};
class GLBuffer : public GLWrapper
{};
class GLTexture : public GLWrapper
{};
class GLFramebuffer : public GLWrapper
{};
class GLMemoryObject : public GLWrapper
{};
class GLRenderbuffer : public GLWrapper
{};
class GLSampler : public GLWrapper
{};
class GLSemaphore : public GLWrapper
{};
class GLTransformFeedback : public GLWrapper
{};
class GLProgramPipeline : public GLWrapper
{};
class GLQueryEXT : public GLWrapper
{};
GLQuery;
class GLPerfMonitor : public GLWrapper
{};

class GLShader : angle::NonCopyable
{};

// Prefer ANGLE_GL_PROGRAM for local variables.
class GLProgram : angle::NonCopyable
{};

#define ANGLE_GL_EMPTY_PROGRAM(name)

#define ANGLE_GL_PROGRAM(name, vertex, fragment)

#define ANGLE_GL_PROGRAM_WITH_GS(name, vertex, geometry, fragment)

#define ANGLE_GL_PROGRAM_WITH_TESS(name, vertex, tcs, tes, fragment)

#define ANGLE_GL_PROGRAM_TRANSFORM_FEEDBACK(name, vertex, fragment, tfVaryings, bufferMode)

#define ANGLE_GL_COMPUTE_PROGRAM(name, compute)

#define ANGLE_GL_BINARY_OES_PROGRAM(name, binary, binaryFormat)

#define ANGLE_GL_BINARY_ES3_PROGRAM(name, binary, binaryFormat)

}  // namespace angle

#endif  // ANGLE_TESTS_GL_RAII_H_