Changeset 284827 in webkit
- Timestamp:
- Oct 25, 2021, 2:50:46 PM (5 years ago)
- Location:
- branches/safari-612-branch/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612-branch/Source/WebCore/ChangeLog
r284824 r284827 1 2021-10-25 Null <null@apple.com> 2 3 Cherry-pick r283299. rdar://problem/84629227 4 5 Cocoa GraphicsContextGLOpenGL should be more robust in destruction 6 https://bugs.webkit.org/show_bug.cgi?id=230940 7 8 Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-09-29 9 Reviewed by Antti Koivisto. 10 11 Delete resources based on checking if they exist, not based on 12 a flag that should cause them to exist. Currently the constructor can return early, 13 so various resources might not exist even if their flag condition would 14 indicate they should. 15 16 No new tests, refactor. 17 18 * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: 19 (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): 20 21 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283299 268f45cc-cd09-0410-ab3c-d52691b4dbfc 22 23 2021-09-29 Kimmo Kinnunen <kkinnunen@apple.com> 24 25 Cocoa GraphicsContextGLOpenGL should be more robust in destruction 26 https://bugs.webkit.org/show_bug.cgi?id=230940 27 28 Reviewed by Antti Koivisto. 29 30 Delete resources based on checking if they exist, not based on 31 a flag that should cause them to exist. Currently the constructor can return early, 32 so various resources might not exist even if their flag condition would 33 indicate they should. 34 35 No new tests, refactor. 36 37 * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm: 38 (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL): 39 1 40 2021-10-25 Null <null@apple.com> 2 41 -
branches/safari-612-branch/Source/WebCore/platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm
r284393 r284827 428 428 GraphicsContextGLOpenGLManager::sharedManager().removeContext(this); 429 429 if (makeContextCurrent()) { 430 GraphicsContextGLAttributes attrs = contextAttributes(); 431 gl::DeleteTextures(1, &m_texture); 432 433 if (attrs.antialias) { 430 if (m_texture) 431 gl::DeleteTextures(1, &m_texture); 432 if (m_multisampleColorBuffer) 434 433 gl::DeleteRenderbuffers(1, &m_multisampleColorBuffer); 435 if (attrs.stencil || attrs.depth) 436 gl::DeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer); 434 if (m_multisampleDepthStencilBuffer) 435 gl::DeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer); 436 if (m_multisampleFBO) 437 437 gl::DeleteFramebuffers(1, &m_multisampleFBO); 438 } else { 439 if (attrs.stencil || attrs.depth) 440 gl::DeleteRenderbuffers(1, &m_depthStencilBuffer); 441 } 442 gl::DeleteFramebuffers(1, &m_fbo); 438 if (m_depthStencilBuffer) 439 gl::DeleteRenderbuffers(1, &m_depthStencilBuffer); 440 if (m_fbo) 441 gl::DeleteFramebuffers(1, &m_fbo); 443 442 if (m_preserveDrawingBufferTexture) 444 443 gl::DeleteTextures(1, &m_preserveDrawingBufferTexture); … … 452 451 fence.abandon(); 453 452 } 454 if (m_displayBufferPbuffer) {453 if (m_displayBufferPbuffer) 455 454 EGL_DestroySurface(m_displayObj, m_displayBufferPbuffer); 455 if (m_swapChain) { 456 456 auto recycledBuffer = m_swapChain->recycleBuffer(); 457 457 if (recycledBuffer.handle) … … 464 464 clearCurrentContext(); 465 465 EGL_DestroyContext(m_displayObj, m_contextObj); 466 } else467 ASSERT(currentContext != this);466 } 467 ASSERT(currentContext != this); 468 468 LOG(WebGL, "Destroyed a GraphicsContextGLOpenGL (%p).", this); 469 469 }
Note:
See TracChangeset
for help on using the changeset viewer.