Edit

kc3-lang/angle/src/common/PackedEGLEnums_autogen.cpp

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2018-05-24 17:31:43
    Hash : d4703d50
    Message : Move packed enum code to common/ This makes it accessible in the utilities files. Bug: angleproject:2574 Bug: angleproject:2169 Change-Id: I0fdd34b4233e72b7534cb2b09f451539c1a394cd Reviewed-on: https://chromium-review.googlesource.com/1067110 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>

  • src/common/PackedEGLEnums_autogen.cpp
  • // 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 "common/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