gfx/angle/src/libEGL/Config.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 //
michael@0 2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
michael@0 3 // Use of this source code is governed by a BSD-style license that can be
michael@0 4 // found in the LICENSE file.
michael@0 5 //
michael@0 6
michael@0 7 // Config.h: Defines the egl::Config class, describing the format, type
michael@0 8 // and size for an egl::Surface. Implements EGLConfig and related functionality.
michael@0 9 // [EGL 1.4] section 3.4 page 15.
michael@0 10
michael@0 11 #ifndef INCLUDE_CONFIG_H_
michael@0 12 #define INCLUDE_CONFIG_H_
michael@0 13
michael@0 14 #define EGLAPI
michael@0 15 #include <EGL/egl.h>
michael@0 16
michael@0 17 #include <set>
michael@0 18
michael@0 19 #include "libGLESv2/renderer/Renderer.h"
michael@0 20 #include "common/angleutils.h"
michael@0 21
michael@0 22 namespace egl
michael@0 23 {
michael@0 24 class Display;
michael@0 25
michael@0 26 class Config
michael@0 27 {
michael@0 28 public:
michael@0 29 Config(rx::ConfigDesc desc, EGLint minSwapInterval, EGLint maxSwapInterval, EGLint texWidth, EGLint texHeight);
michael@0 30
michael@0 31 EGLConfig getHandle() const;
michael@0 32
michael@0 33 const GLenum mRenderTargetFormat;
michael@0 34 const GLenum mDepthStencilFormat;
michael@0 35 const GLint mMultiSample;
michael@0 36
michael@0 37 EGLint mBufferSize; // Depth of the color buffer
michael@0 38 EGLint mRedSize; // Bits of Red in the color buffer
michael@0 39 EGLint mGreenSize; // Bits of Green in the color buffer
michael@0 40 EGLint mBlueSize; // Bits of Blue in the color buffer
michael@0 41 EGLint mLuminanceSize; // Bits of Luminance in the color buffer
michael@0 42 EGLint mAlphaSize; // Bits of Alpha in the color buffer
michael@0 43 EGLint mAlphaMaskSize; // Bits of Alpha Mask in the mask buffer
michael@0 44 EGLBoolean mBindToTextureRGB; // True if bindable to RGB textures.
michael@0 45 EGLBoolean mBindToTextureRGBA; // True if bindable to RGBA textures.
michael@0 46 EGLenum mColorBufferType; // Color buffer type
michael@0 47 EGLenum mConfigCaveat; // Any caveats for the configuration
michael@0 48 EGLint mConfigID; // Unique EGLConfig identifier
michael@0 49 EGLint mConformant; // Whether contexts created with this config are conformant
michael@0 50 EGLint mDepthSize; // Bits of Z in the depth buffer
michael@0 51 EGLint mLevel; // Frame buffer level
michael@0 52 EGLBoolean mMatchNativePixmap; // Match the native pixmap format
michael@0 53 EGLint mMaxPBufferWidth; // Maximum width of pbuffer
michael@0 54 EGLint mMaxPBufferHeight; // Maximum height of pbuffer
michael@0 55 EGLint mMaxPBufferPixels; // Maximum size of pbuffer
michael@0 56 EGLint mMaxSwapInterval; // Maximum swap interval
michael@0 57 EGLint mMinSwapInterval; // Minimum swap interval
michael@0 58 EGLBoolean mNativeRenderable; // EGL_TRUE if native rendering APIs can render to surface
michael@0 59 EGLint mNativeVisualID; // Handle of corresponding native visual
michael@0 60 EGLint mNativeVisualType; // Native visual type of the associated visual
michael@0 61 EGLint mRenderableType; // Which client rendering APIs are supported.
michael@0 62 EGLint mSampleBuffers; // Number of multisample buffers
michael@0 63 EGLint mSamples; // Number of samples per pixel
michael@0 64 EGLint mStencilSize; // Bits of Stencil in the stencil buffer
michael@0 65 EGLint mSurfaceType; // Which types of EGL surfaces are supported.
michael@0 66 EGLenum mTransparentType; // Type of transparency supported
michael@0 67 EGLint mTransparentRedValue; // Transparent red value
michael@0 68 EGLint mTransparentGreenValue; // Transparent green value
michael@0 69 EGLint mTransparentBlueValue; // Transparent blue value
michael@0 70 };
michael@0 71
michael@0 72 // Function object used by STL sorting routines for ordering Configs according to [EGL] section 3.4.1 page 24.
michael@0 73 class SortConfig
michael@0 74 {
michael@0 75 public:
michael@0 76 explicit SortConfig(const EGLint *attribList);
michael@0 77
michael@0 78 bool operator()(const Config *x, const Config *y) const;
michael@0 79 bool operator()(const Config &x, const Config &y) const;
michael@0 80
michael@0 81 private:
michael@0 82 void scanForWantedComponents(const EGLint *attribList);
michael@0 83 EGLint wantedComponentsSize(const Config &config) const;
michael@0 84
michael@0 85 bool mWantRed;
michael@0 86 bool mWantGreen;
michael@0 87 bool mWantBlue;
michael@0 88 bool mWantAlpha;
michael@0 89 bool mWantLuminance;
michael@0 90 };
michael@0 91
michael@0 92 class ConfigSet
michael@0 93 {
michael@0 94 friend Display;
michael@0 95
michael@0 96 public:
michael@0 97 ConfigSet();
michael@0 98
michael@0 99 void add(rx::ConfigDesc desc, EGLint minSwapInterval, EGLint maxSwapInterval, EGLint texWidth, EGLint texHeight);
michael@0 100 size_t size() const;
michael@0 101 bool getConfigs(EGLConfig *configs, const EGLint *attribList, EGLint configSize, EGLint *numConfig);
michael@0 102 const egl::Config *get(EGLConfig configHandle);
michael@0 103
michael@0 104 private:
michael@0 105 DISALLOW_COPY_AND_ASSIGN(ConfigSet);
michael@0 106
michael@0 107 typedef std::set<Config, SortConfig> Set;
michael@0 108 typedef Set::iterator Iterator;
michael@0 109 Set mSet;
michael@0 110
michael@0 111 static const EGLint mSortAttribs[];
michael@0 112 };
michael@0 113 }
michael@0 114
michael@0 115 #endif // INCLUDE_CONFIG_H_

mercurial