[webkit-reviews] review granted: [Bug 51908] Use GC3D types in WebGLRenderingContext and related WebGL classes : [Attachment 78765] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jan 13 11:05:13 PST 2011
Kenneth Russell <kbr at google.com> has granted Zhenyao Mo <zmo at google.com>'s
request for review:
Bug 51908: Use GC3D types in WebGLRenderingContext and related WebGL classes
https://bugs.webkit.org/show_bug.cgi?id=51908
Attachment 78765: Patch
https://bugs.webkit.org/attachment.cgi?id=78765&action=review
------- Additional Comments from Kenneth Russell <kbr at google.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=78765&action=review
Thanks for doing this tedious cleanup. It will make the code more maintainable.
The only high-level issue is that I think GC3Dboolean should be typedefed to
bool rather than unsigned char. Using 0 instead of false loses a significant
amount of information and it's difficult to make the reverse transition,
because some platforms will complain about converting 0/1 to a bool and some
won't. There are probably ten or so places in this patch where this affects the
code.
> Source/WebCore/html/canvas/WebGLBuffer.cpp:131
Should these CheckedInt instances use GC3Dintptr as their template parameter?
Theoretically they are supposed to handle 64-bit values on 64-bit platforms.
> Source/WebCore/html/canvas/WebGLBuffer.cpp:132
> + if (!checkedArrayMax.valid() || checkedArrayMax.value() >
static_cast<int32_t>(array->byteLength()) || !checkedBufferMax.valid() ||
checkedBufferMax.value() > m_byteLength)
Should this static_cast to int32_t use one of the GC3D types, again like
GC3Dintptr?
> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:1910
> + return WebGLGetInfo(static_cast<unsigned
long>(m_renderbufferBinding->getInternalFormat()));
Might be a good idea to add a FIXME here even though you've already filed the
cleanup bug to get rid of this cast to unsigned long.
> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:1932
> + return WebGLGetInfo(static_cast<unsigned
long>(m_renderbufferBinding->getInternalFormat()));
Here too.
> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:2194
> + return
WebGLGetInfo(static_cast<bool>(m_vertexAttribState[index].enabled));
FIXME here and below?
More information about the webkit-reviews
mailing list