RESOLVED FIXED Bug 57530
[Qt] GraphicsContext3D internal buffers are not freed
https://bugs.webkit.org/show_bug.cgi?id=57530
Summary [Qt] GraphicsContext3D internal buffers are not freed
Jarkko Sakkinen
Reported 2011-03-31 01:06:40 PDT
There's code for destroying internal FBO, color texture and depth buffer from the code. These resouces aren't freed when shader OpenGL context is created with the viewport.
Attachments
fix (2.18 KB, patch)
2011-03-31 02:41 PDT, Jarkko Sakkinen
benjamin: review-
QString::fromUtf8() (2.18 KB, patch)
2011-04-05 09:56 PDT, Jarkko Sakkinen
benjamin: review-
free internal buffers (1.31 KB, patch)
2011-04-13 14:32 PDT, Andrew Wason
no flags
Jarkko Sakkinen
Comment 1 2011-03-31 02:41:55 PDT
Benjamin Poulain
Comment 2 2011-04-05 06:02:36 PDT
Comment on attachment 87685 [details] fix View in context: https://bugs.webkit.org/attachment.cgi?id=87685&action=review > Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:597 > + void* addr = m_glWidget->context()->getProcAddress(QString::fromAscii(nameWithExt.utf8().data())); QString::fromAscii() is almost never valid inside a library. It does not actually convert from Ascii, but from the default codec, which can be set to anything by the user code. You should use QString::fromLatin1() or QLatin1String() or in thisn case: QString::fromUtf8().
Jarkko Sakkinen
Comment 3 2011-04-05 09:56:19 PDT
Created attachment 88264 [details] QString::fromUtf8()
Benjamin Poulain
Comment 4 2011-04-06 09:06:45 PDT
Comment on attachment 88264 [details] QString::fromUtf8() View in context: https://bugs.webkit.org/attachment.cgi?id=88264&action=review > Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:455 > + m_glWidget->makeCurrent(); > + if (m_glWidget->isValid()) { > + ::glDeleteTextures(1, &m_texture); > + deleteRenderbuffers(1, &m_depthBuffer); > + deleteFramebuffers(1, &m_canvasFbo); > + } Please resubmit the patch with just this. > Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:597 > + void* addr = m_glWidget->context()->getProcAddress(QString::fromUtf8(nameWithExt.utf8().data())); Actually, looking at it, shouldn't it be QString(nameWithExt)? I don't see why we should pass by UTF-8 to convert for WTF::String to QString. You should commit this separately. It seems unrelated with the resource cleaning. > Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:665 > + if ((width == m_currentWidth && height == m_currentHeight) || (!m_internal)) No problem with that but you can commit that separately, with the above change, in a code cleaning patch.
Andrew Wason
Comment 5 2011-04-13 14:32:54 PDT
Created attachment 89460 [details] free internal buffers This is Jarkkos patch without the extra compiler warning cleanup, which is now in a patch on bug #58478
Benjamin Poulain
Comment 6 2011-04-13 16:19:07 PDT
Comment on attachment 89460 [details] free internal buffers Looks good.
Benjamin Poulain
Comment 7 2011-04-13 16:20:16 PDT
(In reply to comment #5) > Created an attachment (id=89460) [details] > free internal buffers > > This is Jarkkos patch without the extra compiler warning cleanup, which is now in a patch on bug #58478 Good job doing the updated patch. Jarkko is on vacation IIRC.
WebKit Commit Bot
Comment 8 2011-04-14 04:01:31 PDT
Comment on attachment 89460 [details] free internal buffers Clearing flags on attachment: 89460 Committed r83834: <http://trac.webkit.org/changeset/83834>
WebKit Commit Bot
Comment 9 2011-04-14 04:01:34 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.