Hash :
8ceea819
Author :
Date :
2018-04-10T03:07:13
Refactor packed enum generation to support EGL enums. Convert the very simple EGL texture type enum. BUG=angleproject:1618 Change-Id: Ieea382a282a8f2544f2982627e8445e6e5cea826 Reviewed-on: https://chromium-review.googlesource.com/1019386 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
// GENERATED FILE - DO NOT EDIT.
// Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json.
//
// Copyright 2018 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.
//
// PackedEGLEnums_autogen.cpp:
// Implements ANGLE-specific enums classes for EGLenums and functions operating
// on them.
#include "libANGLE/PackedEGLEnums_autogen.h"
#include "common/debug.h"
namespace egl
{
template <>
TextureFormat FromEGLenum<TextureFormat>(EGLenum from)
{
switch (from)
{
case EGL_NO_TEXTURE:
return TextureFormat::NoTexture;
case EGL_TEXTURE_RGB:
return TextureFormat::RGB;
case EGL_TEXTURE_RGBA:
return TextureFormat::RGBA;
default:
return TextureFormat::InvalidEnum;
}
}
EGLenum ToEGLenum(TextureFormat from)
{
switch (from)
{
case TextureFormat::NoTexture:
return EGL_NO_TEXTURE;
case TextureFormat::RGB:
return EGL_TEXTURE_RGB;
case TextureFormat::RGBA:
return EGL_TEXTURE_RGBA;
default:
UNREACHABLE();
return 0;
}
}
} // namespace egl