Changeset 242875 in webkit
- Timestamp:
- Mar 13, 2019, 2:25:35 AM (7 years ago)
- Location:
- releases/WebKitGTK/webkit-2.24/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/egl/GLContextEGL.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog
r242873 r242875 1 2019-03-08 Zan Dobersek <zdobersek@igalia.com> 2 3 GLContextEGL: desired EGL config should search for 8-bit components by default 4 https://bugs.webkit.org/show_bug.cgi?id=195413 5 6 Reviewed by Carlos Garcia Campos. 7 8 The EGL config search in GLContextEGL should by default look for 9 RGBA8888 configurations while allowing RGB565 as an alternative. 10 This prevents from accidentally landing on an RGBA1010102 11 configuration that is available with some graphics stacks, and which is 12 not expected in e.g. window snapshotting that's done for layout test 13 output comparison. 14 15 * platform/graphics/egl/GLContextEGL.cpp: 16 (WebCore::GLContextEGL::getEGLConfig): EGL config search should by 17 default request 8-bit color channels. 18 1 19 2019-03-13 Miguel Gomez <magomez@igalia.com> 2 20 -
releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/graphics/egl/GLContextEGL.cpp
r242463 r242875 97 97 bool GLContextEGL::getEGLConfig(EGLDisplay display, EGLConfig* config, EGLSurfaceType surfaceType) 98 98 { 99 std::array<EGLint, 4> rgbaSize = { 8, 8, 8, 8 }; 100 if (const char* environmentVariable = getenv("WEBKIT_EGL_PIXEL_LAYOUT")) { 101 if (!strcmp(environmentVariable, "RGB565")) 102 rgbaSize = { 5, 6, 5, 0 }; 103 else 104 WTFLogAlways("Unknown pixel layout %s, falling back to RGBA8888", environmentVariable); 105 } 106 99 107 EGLint attributeList[] = { 100 108 #if USE(OPENGL_ES) … … 103 111 EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, 104 112 #endif 105 EGL_RED_SIZE, 1,106 EGL_GREEN_SIZE, 1,107 EGL_BLUE_SIZE, 1,108 EGL_ALPHA_SIZE, 1,113 EGL_RED_SIZE, rgbaSize[0], 114 EGL_GREEN_SIZE, rgbaSize[1], 115 EGL_BLUE_SIZE, rgbaSize[2], 116 EGL_ALPHA_SIZE, rgbaSize[3], 109 117 EGL_STENCIL_SIZE, 8, 110 118 EGL_SURFACE_TYPE, EGL_NONE, 111 119 EGL_NONE 112 120 }; 113 114 bool isRGB565 = false;115 if (const char* environmentVariable = getenv("WEBKIT_EGL_PIXEL_LAYOUT")) {116 if (!strcmp(environmentVariable, "RGB565")) {117 isRGB565 = true;118 // EGL_RED_SIZE119 attributeList[3] = 5;120 // EGL_GREEN_SIZE121 attributeList[5] = 6;122 // EGL_BLUE_SIZE123 attributeList[7] = 5;124 // EGL_ALPHA_SIZE125 attributeList[9] = 0;126 } else127 WTFLogAlways("Unknown pixel layout %s, falling back to RGBA8888", environmentVariable);128 }129 121 130 122 switch (surfaceType) { … … 147 139 EGLint numberConfigsReturned; 148 140 Vector<EGLConfig> configs(count); 149 if (!eglChooseConfig(display, attributeList, isRGB565 ? reinterpret_cast<EGLConfig*>(configs.data()) : config, isRGB565 ? count : 1, &numberConfigsReturned) || !numberConfigsReturned)141 if (!eglChooseConfig(display, attributeList, reinterpret_cast<EGLConfig*>(configs.data()), count, &numberConfigsReturned) || !numberConfigsReturned) 150 142 return false; 151 152 if (!isRGB565)153 return true;154 143 155 144 auto index = configs.findMatching([&](EGLConfig value) { … … 159 148 eglGetConfigAttrib(display, value, EGL_BLUE_SIZE, &blueSize); 160 149 eglGetConfigAttrib(display, value, EGL_ALPHA_SIZE, &alphaSize); 161 return (redSize == 5 && greenSize == 6 && blueSize == 5 && !alphaSize); 150 return redSize == rgbaSize[0] && greenSize == rgbaSize[1] 151 && blueSize == rgbaSize[2] && alphaSize == rgbaSize[3]; 162 152 }); 163 153
Note:
See TracChangeset
for help on using the changeset viewer.