[webkit-reviews] review denied: [Bug 64879] [Qt] Implement WebGL antialiasing (part 3) : [Attachment 103241] implement antialiasing
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Aug 8 07:42:30 PDT 2011
Noam Rosenthal <noam.rosenthal at nokia.com> has denied Andrew Wason
<rectalogic at rectalogic.com>'s request for review:
Bug 64879: [Qt] Implement WebGL antialiasing (part 3)
https://bugs.webkit.org/show_bug.cgi?id=64879
Attachment 103241: implement antialiasing
https://bugs.webkit.org/attachment.cgi?id=103241&action=review
------- Additional Comments from Noam Rosenthal <noam.rosenthal at nokia.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=103241&action=review
> Source/WebCore/ChangeLog:8
> + Existing WebGL layout tests.
Do you mean "Existing WebGL layout tests cover this"?
> Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:155
> + if (m_context->m_attrs.antialias) {
> + // Switch to FBOs context for resolving multisamples, then restore.
> + const QGLContext* currentContext = QGLContext::currentContext();
> + const QGLContext* widgetContext = m_glWidget->context();
> + if (currentContext != widgetContext)
> + m_glWidget->makeCurrent();
> + blitMultisampleFramebuffer();
> + if (currentContext) {
> + if (currentContext != widgetContext)
> + const_cast<QGLContext*>(currentContext)->makeCurrent();
> + } else
> + m_glWidget->doneCurrent();
> + }
> +
I don't like this inside paintToTextureMapper. Maybe put this in a new function
like blitMultisampleFramebufferAndRestoreContext?
If we do that you don't actually need the comment and the code describes
itself.
> Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp:389
> if (m_internal->m_glWidget->isValid()) {
> glDeleteTextures(1, &m_texture);
> - glDeleteRenderbuffers(1, &m_depthStencilBuffer);
> + if (m_attrs.antialias) {
> + glDeleteRenderbuffers(1, &m_multisampleColorBuffer);
> + if (m_attrs.stencil || m_attrs.depth)
> + glDeleteRenderbuffers(1, &m_multisampleDepthStencilBuffer);
> + glDeleteFramebuffers(1, &m_multisampleFBO);
> + } else if (m_attrs.stencil || m_attrs.depth)
> + glDeleteRenderbuffers(1, &m_depthStencilBuffer);
> glDeleteFramebuffers(1, &m_fbo);
> }
> }
This is becoming rather unreadable... can we refactor to use early returns?
Looks to me that with early returns this can shrink to a single condition level
from 3.
More information about the webkit-reviews
mailing list