Edit

kc3-lang/angle/src/libANGLE/Config.h

Branch :

  • Show log

    Commit

  • Author : Stuart Morgan
    Date : 2019-08-14 12:25:12
    Hash : 9d737966
    Message : Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>

  • src/libANGLE/Config.h
  • //
    // Copyright 2002 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.
    //
    
    // Config.h: Defines the egl::Config class, describing the format, type
    // and size for an egl::Surface. Implements EGLConfig and related functionality.
    // [EGL 1.5] section 3.4 page 19.
    
    #ifndef INCLUDE_CONFIG_H_
    #define INCLUDE_CONFIG_H_
    
    #include "libANGLE/AttributeMap.h"
    
    #include "common/angleutils.h"
    
    #include <EGL/egl.h>
    #include <GLES2/gl2.h>
    
    #include <map>
    #include <vector>
    
    namespace egl
    {
    
    struct Config
    {
        Config();
        ~Config();
        Config(const Config &other);
        Config &operator=(const Config &other);
    
        GLenum renderTargetFormat;  // TODO(geofflang): remove this
        GLenum depthStencilFormat;  // TODO(geofflang): remove this
    
        EGLint bufferSize;             // Depth of the color buffer
        EGLint redSize;                // Bits of Red in the color buffer
        EGLint greenSize;              // Bits of Green in the color buffer
        EGLint blueSize;               // Bits of Blue in the color buffer
        EGLint luminanceSize;          // Bits of Luminance in the color buffer
        EGLint alphaSize;              // Bits of Alpha in the color buffer
        EGLint alphaMaskSize;          // Bits of Alpha Mask in the mask buffer
        EGLBoolean bindToTextureRGB;   // True if bindable to RGB textures.
        EGLBoolean bindToTextureRGBA;  // True if bindable to RGBA textures.
        EGLenum colorBufferType;       // Color buffer type
        EGLenum configCaveat;          // Any caveats for the configuration
        EGLint configID;               // Unique EGLConfig identifier
        EGLint conformant;             // Whether contexts created with this config are conformant
        EGLint depthSize;              // Bits of Z in the depth buffer
        EGLint level;                  // Frame buffer level
        EGLBoolean matchNativePixmap;  // Match the native pixmap format
        EGLint maxPBufferWidth;        // Maximum width of pbuffer
        EGLint maxPBufferHeight;       // Maximum height of pbuffer
        EGLint maxPBufferPixels;       // Maximum size of pbuffer
        EGLint maxSwapInterval;        // Maximum swap interval
        EGLint minSwapInterval;        // Minimum swap interval
        EGLBoolean nativeRenderable;   // EGL_TRUE if native rendering APIs can render to surface
        EGLint nativeVisualID;         // Handle of corresponding native visual
        EGLint nativeVisualType;       // Native visual type of the associated visual
        EGLint renderableType;         // Which client rendering APIs are supported.
        EGLint sampleBuffers;          // Number of multisample buffers
        EGLint samples;                // Number of samples per pixel
        EGLint stencilSize;            // Bits of Stencil in the stencil buffer
        EGLint surfaceType;            // Which types of EGL surfaces are supported.
        EGLenum transparentType;       // Type of transparency supported
        EGLint transparentRedValue;    // Transparent red value
        EGLint transparentGreenValue;  // Transparent green value
        EGLint transparentBlueValue;   // Transparent blue value
        EGLint optimalOrientation;     // Optimal window surface orientation
        EGLenum colorComponentType;    // Color component type
        EGLBoolean recordable;         // EGL_TRUE if a surface can support recording on Android
    };
    
    class ConfigSet
    {
      private:
        typedef std::map<EGLint, Config> ConfigMap;
    
      public:
        ConfigSet();
        ConfigSet(const ConfigSet &other);
        ~ConfigSet();
        ConfigSet &operator=(const ConfigSet &other);
    
        EGLint add(const Config &config);
        const Config &get(EGLint id) const;
    
        void clear();
    
        size_t size() const;
    
        bool contains(const Config *config) const;
    
        // Filter configurations based on the table in [EGL 1.5] section 3.4.1.2 page 29
        std::vector<const Config *> filter(const AttributeMap &attributeMap) const;
    
        ConfigMap::iterator begin();
        ConfigMap::iterator end();
    
      private:
        ConfigMap mConfigs;
    };
    
    }  // namespace egl
    
    #endif  // INCLUDE_CONFIG_H_