Changeset 283299 in webkit
- Timestamp:
- Sep 29, 2021, 10:17:38 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r283296 r283299 1 2021-09-29 Kimmo Kinnunen <kkinnunen@apple.com> 2 3 Cocoa GraphicsContextGLOpenGL should be more robust in destruction 4 https://bugs.webkit.org/show_bug.cgi?id=230940 5 6 Reviewed by Antti Koivisto. 7 8 Delete resources based on checking if they exist, not based on 9 a flag that should cause them to exist. Currently the constructor can return early, 10 so various resources might not exist even if their flag condition would 11 indicate they should. 12 13 No new tests, refactor. 14 15 * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: 16 (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): 17 1 18 2021-09-29 Simon Fraser <simon.fraser@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm
r283238 r283299 430 430 GraphicsContextGLOpenGLManager::sharedManager().removeContext(this); 431 431 if (makeContextCurrent()) { 432 GraphicsContextGLAttributes attrs = contextAttributes(); 433 gl::DeleteTextures(1, &m_texture); 434 435 if (attrs.antialias) { 432 if (m_texture) 433 gl::DeleteTextures(1, &m_texture); 434 if (m_multisampleColorBuffer) 436 435 gl::DeleteRenderbuffers(1, &m_multisampleColorBuffer); 437 if (attrs.stencil || attrs.depth) 438 gl::DeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer); 436 if (m_multisampleDepthStencilBuffer) 437 gl::DeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer); 438 if (m_multisampleFBO) 439 439 gl::DeleteFramebuffers(1, &m_multisampleFBO); 440 } else { 441 if (attrs.stencil || attrs.depth) 442 gl::DeleteRenderbuffers(1, &m_depthStencilBuffer); 443 } 444 gl::DeleteFramebuffers(1, &m_fbo); 440 if (m_depthStencilBuffer) 441 gl::DeleteRenderbuffers(1, &m_depthStencilBuffer); 442 if (m_fbo) 443 gl::DeleteFramebuffers(1, &m_fbo); 445 444 if (m_preserveDrawingBufferTexture) 446 445 gl::DeleteTextures(1, &m_preserveDrawingBufferTexture); … … 454 453 fence.abandon(); 455 454 } 456 if (m_displayBufferPbuffer) {455 if (m_displayBufferPbuffer) 457 456 EGL_DestroySurface(m_displayObj, m_displayBufferPbuffer); 457 if (m_swapChain) { 458 458 auto recycledBuffer = m_swapChain->recycleBuffer(); 459 459 if (recycledBuffer.handle) … … 466 466 clearCurrentContext(); 467 467 EGL_DestroyContext(m_displayObj, m_contextObj); 468 } else469 ASSERT(currentContext != this);468 } 469 ASSERT(currentContext != this); 470 470 LOG(WebGL, "Destroyed a GraphicsContextGLOpenGL (%p).", this); 471 471 }
Note:
See TracChangeset
for help on using the changeset viewer.