Warning, /graphics/krita/3rdparty/ext_googleangle/01-patches_qt5.12.12/0007-Revert-Fix-scanForWantedComponents-not-ignoring-attr.patch is written in an unsupported language. File is not indexed.
0001 From 7e512e1e8cf3c0c6b8d4f75d31988e02185e0c64 Mon Sep 17 00:00:00 2001 0002 From: Andre de la Rocha <andre.rocha@qt.io> 0003 Date: Tue, 11 Sep 2018 12:52:28 +0200 0004 Subject: [PATCH 07/17] Revert "Fix scanForWantedComponents not ignoring 0005 attribute values of 0." 0006 0007 This patch reverts commit 2648d9297f25a0d1fa2837f020975a45d4e8a8b9 as a 0008 workaround for the "banding" artifacts we were seeing in Qt. Angle 0009 returns a list of supported graphic formats or configurations, sorting 0010 it in a way that the first one should be the one that fits better the 0011 requested format. In Qt we use the first thing we receive in the list. 0012 In the current Angle version, however, a fix has changed the way in 0013 which the list is sorted. In the old version the first element would be 0014 a 32-bit graphic format, while now it's a 16-bit one, resulting in the 0015 "banding" artifacts. The workaround reverts back to the previous sorting 0016 behavior. 0017 --- 0018 src/libANGLE/Config.cpp | 29 +++++++++++++++++------------ 0019 1 file changed, 17 insertions(+), 12 deletions(-) 0020 0021 diff --git a/src/libANGLE/Config.cpp b/src/libANGLE/Config.cpp 0022 index 127480db1..3daef6b57 100644 0023 --- a/src/libANGLE/Config.cpp 0024 +++ b/src/libANGLE/Config.cpp 0025 @@ -183,22 +183,27 @@ class ConfigSorter 0026 } 0027 0028 private: 0029 - static bool wantsComponent(const AttributeMap &attributeMap, EGLAttrib component) 0030 + void scanForWantedComponents(const AttributeMap &attributeMap) 0031 { 0032 // [EGL 1.5] section 3.4.1.2 page 30 0033 // Sorting rule #3: by larger total number of color bits, not considering 0034 // components that are 0 or don't-care. 0035 - EGLAttrib value = attributeMap.get(component, 0); 0036 - return value != 0 && value != EGL_DONT_CARE; 0037 - } 0038 - 0039 - void scanForWantedComponents(const AttributeMap &attributeMap) 0040 - { 0041 - mWantRed = wantsComponent(attributeMap, EGL_RED_SIZE); 0042 - mWantGreen = wantsComponent(attributeMap, EGL_GREEN_SIZE); 0043 - mWantBlue = wantsComponent(attributeMap, EGL_BLUE_SIZE); 0044 - mWantAlpha = wantsComponent(attributeMap, EGL_ALPHA_SIZE); 0045 - mWantLuminance = wantsComponent(attributeMap, EGL_LUMINANCE_SIZE); 0046 + for (auto attribIter = attributeMap.begin(); attribIter != attributeMap.end(); attribIter++) 0047 + { 0048 + EGLAttrib attributeKey = attribIter->first; 0049 + EGLAttrib attributeValue = attribIter->second; 0050 + if (attributeKey != 0 && attributeValue != EGL_DONT_CARE) 0051 + { 0052 + switch (attributeKey) 0053 + { 0054 + case EGL_RED_SIZE: mWantRed = true; break; 0055 + case EGL_GREEN_SIZE: mWantGreen = true; break; 0056 + case EGL_BLUE_SIZE: mWantBlue = true; break; 0057 + case EGL_ALPHA_SIZE: mWantAlpha = true; break; 0058 + case EGL_LUMINANCE_SIZE: mWantLuminance = true; break; 0059 + } 0060 + } 0061 + } 0062 } 0063 0064 EGLint wantedComponentsSize(const Config &config) const 0065 -- 0066 2.24.1.windows.2 0067