Skip to content

Commit 059a14d

Browse files
calling 'reshape(0,0)' when destroying webgl context
This releases the textures attached to context fbo faster, without waiting for GC. These textures make up for the most of gfx memory used, and when opening different apps quickly we may run out of gfx memory before GC kicks in.
1 parent 7fcd70c commit 059a14d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,8 @@ void WebGLRenderingContextBase::destroyGraphicsContextGL()
13051305
removeActivityStateChangeObserver();
13061306

13071307
if (m_context) {
1308+
// first release the big textures allocated for the FBOs
1309+
m_context->reshape(0,0);
13081310
m_context->setClient(nullptr);
13091311
m_context = nullptr;
13101312
removeActiveContext(*this);

0 commit comments

Comments
 (0)