daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // Config.cpp: Implements the egl::Config class, describing the format, type |
| 8 | // and size for an egl::Surface. Implements EGLConfig and related functionality. |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 9 | // [EGL 1.5] section 3.4 page 19. |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 10 | |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 11 | #include "libANGLE/Config.h" |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 12 | #include "libANGLE/AttributeMap.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 13 | |
| 14 | #include <algorithm> |
| 15 | #include <vector> |
| 16 | |
shannon.woods%transgaming.com@gtempaccount.com | dcf33d5 | 2013-04-13 03:33:11 +0000 | [diff] [blame] | 17 | #include <EGL/eglext.h> |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 18 | #include "angle_gl.h" |
daniel@transgaming.com | 106e1f7 | 2012-10-31 18:38:36 +0000 | [diff] [blame] | 19 | |
alokp@chromium.org | ea0e1af | 2010-03-22 19:33:14 +0000 | [diff] [blame] | 20 | #include "common/debug.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 21 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 22 | namespace egl |
| 23 | { |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 24 | |
| 25 | Config::Config() |
Geoff Lang | f21a108 | 2015-01-09 14:41:27 -0500 | [diff] [blame] | 26 | : renderTargetFormat(GL_NONE), |
| 27 | depthStencilFormat(GL_NONE), |
| 28 | bufferSize(0), |
| 29 | redSize(0), |
| 30 | greenSize(0), |
| 31 | blueSize(0), |
| 32 | luminanceSize(0), |
| 33 | alphaSize(0), |
| 34 | alphaMaskSize(0), |
| 35 | bindToTextureRGB(EGL_FALSE), |
| 36 | bindToTextureRGBA(EGL_FALSE), |
| 37 | colorBufferType(EGL_NONE), |
| 38 | configCaveat(EGL_NONE), |
| 39 | configID(0), |
| 40 | conformant(0), |
| 41 | depthSize(0), |
| 42 | level(0), |
| 43 | matchNativePixmap(EGL_FALSE), |
| 44 | maxPBufferWidth(0), |
| 45 | maxPBufferHeight(0), |
| 46 | maxPBufferPixels(0), |
| 47 | maxSwapInterval(0), |
| 48 | minSwapInterval(0), |
| 49 | nativeRenderable(EGL_FALSE), |
| 50 | nativeVisualID(0), |
| 51 | nativeVisualType(0), |
| 52 | renderableType(0), |
| 53 | sampleBuffers(0), |
| 54 | samples(0), |
| 55 | stencilSize(0), |
| 56 | surfaceType(0), |
| 57 | transparentType(EGL_NONE), |
| 58 | transparentRedValue(0), |
| 59 | transparentGreenValue(0), |
Geoff Lang | 7f448b5 | 2015-12-16 13:31:57 -0500 | [diff] [blame] | 60 | transparentBlueValue(0), |
Geoff Lang | c5a2a17 | 2017-01-13 15:55:07 -0500 | [diff] [blame] | 61 | optimalOrientation(0), |
| 62 | colorComponentType(EGL_COLOR_COMPONENT_TYPE_FIXED_EXT) |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 63 | {} |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 64 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 65 | Config::~Config() {} |
Jamie Madill | acf2f3a | 2017-11-21 19:22:44 -0500 | [diff] [blame] | 66 | |
| 67 | Config::Config(const Config &other) = default; |
| 68 | |
| 69 | Config &Config::operator=(const Config &other) = default; |
| 70 | |
| 71 | ConfigSet::ConfigSet() = default; |
| 72 | |
| 73 | ConfigSet::ConfigSet(const ConfigSet &other) = default; |
| 74 | |
| 75 | ConfigSet &ConfigSet::operator=(const ConfigSet &other) = default; |
| 76 | |
| 77 | ConfigSet::~ConfigSet() = default; |
| 78 | |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 79 | EGLint ConfigSet::add(const Config &config) |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 80 | { |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 81 | // Set the config's ID to a small number that starts at 1 ([EGL 1.5] section 3.4) |
Cooper Partin | 4d61f7e | 2015-08-12 10:56:50 -0700 | [diff] [blame] | 82 | EGLint id = static_cast<EGLint>(mConfigs.size()) + 1; |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 83 | |
| 84 | Config copyConfig(config); |
Geoff Lang | c223dc6 | 2015-01-09 13:10:01 -0500 | [diff] [blame] | 85 | copyConfig.configID = id; |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 86 | mConfigs.insert(std::make_pair(id, copyConfig)); |
| 87 | |
| 88 | return id; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 89 | } |
| 90 | |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 91 | const Config &ConfigSet::get(EGLint id) const |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 92 | { |
Jamie Madill | 73edef0 | 2015-02-17 18:58:21 -0500 | [diff] [blame] | 93 | ASSERT(mConfigs.find(id) != mConfigs.end()); |
| 94 | return mConfigs.find(id)->second; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 95 | } |
| 96 | |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 97 | void ConfigSet::clear() |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 98 | { |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 99 | mConfigs.clear(); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 100 | } |
| 101 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 102 | size_t ConfigSet::size() const |
| 103 | { |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 104 | return mConfigs.size(); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 105 | } |
| 106 | |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 107 | bool ConfigSet::contains(const Config *config) const |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 108 | { |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 109 | for (auto i = mConfigs.begin(); i != mConfigs.end(); i++) |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 110 | { |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 111 | const Config &item = i->second; |
| 112 | if (config == &item) |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 113 | { |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 114 | return true; |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | return false; |
| 119 | } |
| 120 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 121 | // Function object used by STL sorting routines for ordering Configs according to [EGL 1.5] |
| 122 | // section 3.4.1.2 page 28. |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 123 | class ConfigSorter |
| 124 | { |
| 125 | public: |
| 126 | explicit ConfigSorter(const AttributeMap &attributeMap) |
Jamie Madill | 5659619 | 2015-03-19 10:23:13 -0400 | [diff] [blame] | 127 | : mWantRed(false), |
| 128 | mWantGreen(false), |
| 129 | mWantBlue(false), |
| 130 | mWantAlpha(false), |
| 131 | mWantLuminance(false) |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 132 | { |
| 133 | scanForWantedComponents(attributeMap); |
| 134 | } |
| 135 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 136 | bool operator()(const Config *x, const Config *y) const { return (*this)(*x, *y); } |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 137 | |
| 138 | bool operator()(const Config &x, const Config &y) const |
| 139 | { |
Jamie Madill | c09ae15 | 2019-02-01 14:16:32 -0500 | [diff] [blame^] | 140 | #define SORT(attribute) \ |
| 141 | do \ |
| 142 | { \ |
| 143 | if (x.attribute != y.attribute) \ |
| 144 | return x.attribute < y.attribute; \ |
| 145 | } while (0) |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 146 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 147 | static_assert(EGL_NONE < EGL_SLOW_CONFIG && EGL_SLOW_CONFIG < EGL_NON_CONFORMANT_CONFIG, |
| 148 | "Unexpected EGL enum value."); |
Geoff Lang | c223dc6 | 2015-01-09 13:10:01 -0500 | [diff] [blame] | 149 | SORT(configCaveat); |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 150 | |
Geoff Lang | c5a2a17 | 2017-01-13 15:55:07 -0500 | [diff] [blame] | 151 | static_assert(EGL_COLOR_COMPONENT_TYPE_FIXED_EXT < EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT, |
| 152 | "Unexpected order of EGL enums."); |
| 153 | SORT(colorComponentType); |
| 154 | |
Geoff Lang | d447581 | 2015-03-18 10:53:05 -0400 | [diff] [blame] | 155 | static_assert(EGL_RGB_BUFFER < EGL_LUMINANCE_BUFFER, "Unexpected EGL enum value."); |
Geoff Lang | c223dc6 | 2015-01-09 13:10:01 -0500 | [diff] [blame] | 156 | SORT(colorBufferType); |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 157 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 158 | // By larger total number of color bits, only considering those that are requested to be > |
| 159 | // 0. |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 160 | EGLint xComponentsSize = wantedComponentsSize(x); |
| 161 | EGLint yComponentsSize = wantedComponentsSize(y); |
| 162 | if (xComponentsSize != yComponentsSize) |
| 163 | { |
| 164 | return xComponentsSize > yComponentsSize; |
| 165 | } |
| 166 | |
Geoff Lang | c223dc6 | 2015-01-09 13:10:01 -0500 | [diff] [blame] | 167 | SORT(bufferSize); |
| 168 | SORT(sampleBuffers); |
| 169 | SORT(samples); |
| 170 | SORT(depthSize); |
| 171 | SORT(stencilSize); |
| 172 | SORT(alphaMaskSize); |
| 173 | SORT(nativeVisualType); |
| 174 | SORT(configID); |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 175 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 176 | #undef SORT |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 177 | |
| 178 | return false; |
| 179 | } |
| 180 | |
| 181 | private: |
Geoff Lang | 2648d92 | 2017-06-15 11:36:47 -0400 | [diff] [blame] | 182 | static bool wantsComponent(const AttributeMap &attributeMap, EGLAttrib component) |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 183 | { |
| 184 | // [EGL 1.5] section 3.4.1.2 page 30 |
| 185 | // Sorting rule #3: by larger total number of color bits, not considering |
| 186 | // components that are 0 or don't-care. |
Geoff Lang | 2648d92 | 2017-06-15 11:36:47 -0400 | [diff] [blame] | 187 | EGLAttrib value = attributeMap.get(component, 0); |
| 188 | return value != 0 && value != EGL_DONT_CARE; |
| 189 | } |
| 190 | |
| 191 | void scanForWantedComponents(const AttributeMap &attributeMap) |
| 192 | { |
| 193 | mWantRed = wantsComponent(attributeMap, EGL_RED_SIZE); |
| 194 | mWantGreen = wantsComponent(attributeMap, EGL_GREEN_SIZE); |
| 195 | mWantBlue = wantsComponent(attributeMap, EGL_BLUE_SIZE); |
| 196 | mWantAlpha = wantsComponent(attributeMap, EGL_ALPHA_SIZE); |
| 197 | mWantLuminance = wantsComponent(attributeMap, EGL_LUMINANCE_SIZE); |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | EGLint wantedComponentsSize(const Config &config) const |
| 201 | { |
| 202 | EGLint total = 0; |
| 203 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 204 | if (mWantRed) |
| 205 | total += config.redSize; |
| 206 | if (mWantGreen) |
| 207 | total += config.greenSize; |
| 208 | if (mWantBlue) |
| 209 | total += config.blueSize; |
| 210 | if (mWantAlpha) |
| 211 | total += config.alphaSize; |
| 212 | if (mWantLuminance) |
| 213 | total += config.luminanceSize; |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 214 | |
| 215 | return total; |
| 216 | } |
| 217 | |
| 218 | bool mWantRed; |
| 219 | bool mWantGreen; |
| 220 | bool mWantBlue; |
| 221 | bool mWantAlpha; |
| 222 | bool mWantLuminance; |
| 223 | }; |
| 224 | |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 225 | std::vector<const Config *> ConfigSet::filter(const AttributeMap &attributeMap) const |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 226 | { |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 227 | std::vector<const Config *> result; |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 228 | result.reserve(mConfigs.size()); |
| 229 | |
| 230 | for (auto configIter = mConfigs.begin(); configIter != mConfigs.end(); configIter++) |
| 231 | { |
| 232 | const Config &config = configIter->second; |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 233 | bool match = true; |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 234 | |
| 235 | for (auto attribIter = attributeMap.begin(); attribIter != attributeMap.end(); attribIter++) |
| 236 | { |
Ian Ewell | ec2c0c5 | 2016-04-05 13:46:26 -0400 | [diff] [blame] | 237 | EGLAttrib attributeKey = attribIter->first; |
| 238 | EGLAttrib attributeValue = attribIter->second; |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 239 | |
Geoff Lang | 638c727 | 2017-06-13 15:50:26 -0400 | [diff] [blame] | 240 | if (attributeValue == EGL_DONT_CARE) |
| 241 | { |
| 242 | continue; |
| 243 | } |
| 244 | |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 245 | switch (attributeKey) |
| 246 | { |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 247 | case EGL_BUFFER_SIZE: |
| 248 | match = config.bufferSize >= attributeValue; |
| 249 | break; |
| 250 | case EGL_ALPHA_SIZE: |
| 251 | match = config.alphaSize >= attributeValue; |
| 252 | break; |
| 253 | case EGL_BLUE_SIZE: |
| 254 | match = config.blueSize >= attributeValue; |
| 255 | break; |
| 256 | case EGL_GREEN_SIZE: |
| 257 | match = config.greenSize >= attributeValue; |
| 258 | break; |
| 259 | case EGL_RED_SIZE: |
| 260 | match = config.redSize >= attributeValue; |
| 261 | break; |
| 262 | case EGL_DEPTH_SIZE: |
| 263 | match = config.depthSize >= attributeValue; |
| 264 | break; |
| 265 | case EGL_STENCIL_SIZE: |
| 266 | match = config.stencilSize >= attributeValue; |
| 267 | break; |
| 268 | case EGL_CONFIG_CAVEAT: |
| 269 | match = config.configCaveat == (EGLenum)attributeValue; |
| 270 | break; |
| 271 | case EGL_CONFIG_ID: |
| 272 | match = config.configID == attributeValue; |
| 273 | break; |
| 274 | case EGL_LEVEL: |
| 275 | match = config.level >= attributeValue; |
| 276 | break; |
| 277 | case EGL_NATIVE_RENDERABLE: |
| 278 | match = config.nativeRenderable == (EGLBoolean)attributeValue; |
| 279 | break; |
| 280 | case EGL_NATIVE_VISUAL_TYPE: |
| 281 | match = config.nativeVisualType == attributeValue; |
| 282 | break; |
| 283 | case EGL_SAMPLES: |
| 284 | match = config.samples >= attributeValue; |
| 285 | break; |
| 286 | case EGL_SAMPLE_BUFFERS: |
| 287 | match = config.sampleBuffers >= attributeValue; |
| 288 | break; |
| 289 | case EGL_SURFACE_TYPE: |
| 290 | match = (config.surfaceType & attributeValue) == attributeValue; |
| 291 | break; |
| 292 | case EGL_TRANSPARENT_TYPE: |
| 293 | match = config.transparentType == (EGLenum)attributeValue; |
| 294 | break; |
| 295 | case EGL_TRANSPARENT_BLUE_VALUE: |
| 296 | match = config.transparentBlueValue == attributeValue; |
| 297 | break; |
| 298 | case EGL_TRANSPARENT_GREEN_VALUE: |
| 299 | match = config.transparentGreenValue == attributeValue; |
| 300 | break; |
| 301 | case EGL_TRANSPARENT_RED_VALUE: |
| 302 | match = config.transparentRedValue == attributeValue; |
| 303 | break; |
| 304 | case EGL_BIND_TO_TEXTURE_RGB: |
| 305 | match = config.bindToTextureRGB == (EGLBoolean)attributeValue; |
| 306 | break; |
| 307 | case EGL_BIND_TO_TEXTURE_RGBA: |
| 308 | match = config.bindToTextureRGBA == (EGLBoolean)attributeValue; |
| 309 | break; |
| 310 | case EGL_MIN_SWAP_INTERVAL: |
| 311 | match = config.minSwapInterval == attributeValue; |
| 312 | break; |
| 313 | case EGL_MAX_SWAP_INTERVAL: |
| 314 | match = config.maxSwapInterval == attributeValue; |
| 315 | break; |
| 316 | case EGL_LUMINANCE_SIZE: |
| 317 | match = config.luminanceSize >= attributeValue; |
| 318 | break; |
| 319 | case EGL_ALPHA_MASK_SIZE: |
| 320 | match = config.alphaMaskSize >= attributeValue; |
| 321 | break; |
| 322 | case EGL_COLOR_BUFFER_TYPE: |
| 323 | match = config.colorBufferType == (EGLenum)attributeValue; |
| 324 | break; |
| 325 | case EGL_RENDERABLE_TYPE: |
| 326 | match = (config.renderableType & attributeValue) == attributeValue; |
| 327 | break; |
| 328 | case EGL_MATCH_NATIVE_PIXMAP: |
| 329 | match = false; |
| 330 | UNIMPLEMENTED(); |
| 331 | break; |
| 332 | case EGL_CONFORMANT: |
| 333 | match = (config.conformant & attributeValue) == attributeValue; |
| 334 | break; |
| 335 | case EGL_MAX_PBUFFER_WIDTH: |
| 336 | match = config.maxPBufferWidth >= attributeValue; |
| 337 | break; |
| 338 | case EGL_MAX_PBUFFER_HEIGHT: |
| 339 | match = config.maxPBufferHeight >= attributeValue; |
| 340 | break; |
| 341 | case EGL_MAX_PBUFFER_PIXELS: |
| 342 | match = config.maxPBufferPixels >= attributeValue; |
| 343 | break; |
| 344 | case EGL_OPTIMAL_SURFACE_ORIENTATION_ANGLE: |
| 345 | match = config.optimalOrientation == attributeValue; |
| 346 | break; |
| 347 | case EGL_COLOR_COMPONENT_TYPE_EXT: |
| 348 | match = config.colorComponentType == static_cast<EGLenum>(attributeValue); |
| 349 | break; |
| 350 | default: |
| 351 | UNREACHABLE(); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 352 | } |
| 353 | |
daniel@transgaming.com | 6a94b97 | 2010-05-13 02:02:34 +0000 | [diff] [blame] | 354 | if (!match) |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 355 | { |
daniel@transgaming.com | 6a94b97 | 2010-05-13 02:02:34 +0000 | [diff] [blame] | 356 | break; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 357 | } |
| 358 | } |
| 359 | |
daniel@transgaming.com | 6a94b97 | 2010-05-13 02:02:34 +0000 | [diff] [blame] | 360 | if (match) |
| 361 | { |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 362 | result.push_back(&config); |
daniel@transgaming.com | 6a94b97 | 2010-05-13 02:02:34 +0000 | [diff] [blame] | 363 | } |
| 364 | } |
| 365 | |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 366 | // Sort the result |
| 367 | std::sort(result.begin(), result.end(), ConfigSorter(attributeMap)); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 368 | |
Geoff Lang | 6812a55 | 2015-01-06 17:26:42 -0500 | [diff] [blame] | 369 | return result; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 370 | } |
| 371 | |
Geoff Lang | 2aaa7b4 | 2018-01-12 17:17:27 -0500 | [diff] [blame] | 372 | ConfigSet::ConfigMap::iterator ConfigSet::begin() |
| 373 | { |
| 374 | return mConfigs.begin(); |
| 375 | } |
| 376 | |
| 377 | ConfigSet::ConfigMap::iterator ConfigSet::end() |
| 378 | { |
| 379 | return mConfigs.end(); |
| 380 | } |
Jamie Madill | b980c56 | 2018-11-27 11:34:27 -0500 | [diff] [blame] | 381 | } // namespace egl |