#ifndef COMMON_PACKEDGLENUMS_H_
#define COMMON_PACKEDGLENUMS_H_
#include "common/PackedEGLEnums_autogen.h"
#include "common/PackedGLEnums_autogen.h"
#include <array>
#include <bitset>
#include <cstddef>
#include <EGL/egl.h>
#include "common/bitset_utils.h"
namespace angle
{
template <typename E>
constexpr size_t EnumSize()
{ … }
template <typename E>
class EnumIterator final
{ … };
template <typename E, size_t MaxSize = EnumSize<E>()>
struct AllEnums
{ … };
template <typename E, typename T, size_t MaxSize = EnumSize<E>()>
class PackedEnumMap
{ … };
PackedEnumBitSet;
}
#define ANGLE_DEFINE_ID_TYPE …
gl
egl
#undef ANGLE_DEFINE_ID_TYPE
namespace egl_gl
{
gl::TextureTarget EGLCubeMapTargetToCubeMapTarget(EGLenum eglTarget);
gl::TextureTarget EGLImageTargetToTextureTarget(EGLenum eglTarget);
gl::TextureType EGLTextureTargetToTextureType(EGLenum eglTarget);
}
namespace gl
{
template <typename EnumT, typename FromT>
typename std::enable_if<std::is_enum<EnumT>::value, EnumT>::type PackParam(FromT from)
{ … }
template <typename EnumT, typename FromT>
typename std::enable_if<!std::is_pointer<FromT>::value && !std::is_enum<EnumT>::value, EnumT>::type
PackParam(FromT from)
{ … }
IsEGLImage;
IsGLSync;
IsEGLSync;
template <typename EnumT, typename FromT>
typename std::enable_if<IsEGLImage<EnumT>::value || IsGLSync<EnumT>::value ||
IsEGLSync<EnumT>::value,
EnumT>::type
PackParam(FromT from)
{ … }
template <typename EnumT, typename FromT>
typename std::enable_if<std::is_pointer<FromT>::value && !std::is_enum<EnumT>::value &&
!IsEGLImage<EnumT>::value && !IsGLSync<EnumT>::value,
EnumT>::type
PackParam(FromT from)
{ … }
}
#endif