Changeset 283301 in webkit
- Timestamp:
- Sep 29, 2021, 10:30:32 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r283299 r283301 1 2021-09-29 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 GPUP Cocoa GraphicsContextGLOpenGL should check for ANGLE presence 4 https://bugs.webkit.org/show_bug.cgi?id=230946 5 6 Reviewed by Antti Koivisto. 7 8 For consistency, avoid crashing the GPUP mode when trying 9 to create GraphicsContextGLOpenGL when the ANGLE-shared dylib 10 is not present. 11 12 No new tests, refactor. 13 14 * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: 15 (WebCore::isANGLEAvailable): 16 (WebCore::initializeEGLDisplay): 17 (WebCore::GraphicsContextGLOpenGL::create): 18 (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL): 19 (WebCore::GraphicsContextGLOpenGL::makeContextCurrent): 20 (WebCore::InitializeEGLDisplay): Deleted. 21 1 22 2021-09-29 Kimmo Kinnunen <kkinnunen@apple.com> 2 23 -
trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm
r283299 r283301 60 60 namespace WebCore { 61 61 62 static bool isANGLEAvailable() 63 { 64 return !!EGL_Initialize; 65 } 66 62 67 // In isCurrentContextPredictable() == true case this variable is accessed in single-threaded manner. 63 68 // In isCurrentContextPredictable() == false case this variable is accessed from multiple threads but always sequentially … … 114 119 } 115 120 116 static ScopedEGLDefaultDisplay InitializeEGLDisplay(const GraphicsContextGLAttributes& attrs) 117 { 121 static ScopedEGLDefaultDisplay initializeEGLDisplay(const GraphicsContextGLAttributes& attrs) 122 { 123 if (!isANGLEAvailable()) { 124 WTFLogAlways("Failed to load ANGLE shared library."); 125 return { }; 126 } 127 118 128 EGLint majorVersion = 0; 119 129 EGLint minorVersion = 0; … … 181 191 #endif 182 192 183 static bool isANGLEAvailable()184 {185 return !!EGL_Initialize;186 }187 188 193 RefPtr<GraphicsContextGLOpenGL> GraphicsContextGLOpenGL::create(GraphicsContextGLAttributes attrs, HostWindow* hostWindow) 189 194 { 190 // If ANGLE is not loaded, we can fail immediately.191 if (!isANGLEAvailable()) {192 WTFLogAlways("ANGLE shared library was not loaded. Can't make GraphicsContextGL.");193 return nullptr;194 }195 196 195 // Make space for the incoming context if we're full. 197 196 GraphicsContextGLOpenGLManager::sharedManager().recycleContextIfNecessary(); … … 246 245 #endif 247 246 248 m_displayObj = InitializeEGLDisplay(attrs);247 m_displayObj = initializeEGLDisplay(attrs); 249 248 if (!m_displayObj) 250 249 return; … … 520 519 if (currentContext == this) 521 520 return true; 522 // Calling MakeCurrent is important to set volatile platform context. See InitializeEGLDisplay().521 // Calling MakeCurrent is important to set volatile platform context. See initializeEGLDisplay(). 523 522 if (!EGL_MakeCurrent(m_displayObj, EGL_NO_SURFACE, EGL_NO_SURFACE, m_contextObj)) 524 523 return false;
Note:
See TracChangeset
for help on using the changeset viewer.