[webkit-reviews] review denied: [Bug 91976] [WebGL] Initial size of canvas can be larger than MAX_VIEWPORT_DIMS. : [Attachment 154061] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 24 11:30:21 PDT 2012


Kenneth Russell <kbr at google.com> has denied Nayan Kumar K
<nayankk at motorola.com>'s request for review:
Bug 91976: [WebGL] Initial size of canvas can be larger than MAX_VIEWPORT_DIMS.
https://bugs.webkit.org/show_bug.cgi?id=91976

Attachment 154061: Patch
https://bugs.webkit.org/attachment.cgi?id=154061&action=review

------- Additional Comments from Kenneth Russell <kbr at google.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=154061&action=review


Thanks for the patch! It looks great except for the same logic being duplicated
three times. Please refactor that and submit a new patch, and I'll gladly r+
it.

> Source/WebCore/html/canvas/WebGLRenderingContext.cpp:451
> +    m_drawingBuffer = DrawingBuffer::create(m_context.get(),
IntSize(clamp(canvas()->width(), 1, m_maxViewportDims[0]),
clamp(canvas()->height(), 1, m_maxViewportDims[1])), preserve, alpha);

Could you please add a private helper method "IntSize clampedCanvasSize()"
which returns the canvas' width and height clamped to m_maxViewportDims? Then
you can call it here, in initializeNewContext and markContextChanged.


More information about the webkit-reviews mailing list