Changeset 76874 in webkit


Ignore:
Timestamp:
Jan 27, 2011 5:26:12 PM (13 years ago)
Author:
zmo@google.com
Message:

2011-01-27 Zhenyao Mo <zmo@google.com>

Reviewed by Kenneth Russell.

texSubImage2D's format/type needs to match the internalformat/type from the previous texImage2D call
https://bugs.webkit.org/show_bug.cgi?id=53054

  • fast/canvas/webgl/tex-sub-image-2d-bad-args-expected.txt: Added.
  • fast/canvas/webgl/tex-sub-image-2d-bad-args.html: Added.

2011-01-27 Zhenyao Mo <zmo@google.com>

Reviewed by Kenneth Russell.

texSubImage2D's format/type needs to match the internalformat/type from the previous texImage2D call
https://bugs.webkit.org/show_bug.cgi?id=53054

Test: fast/canvas/webgl/tex-sub-image-2d-bad-args.html

  • html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::texSubImage2DBase): Check format/type match.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76868 r76874  
     12011-01-27  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        texSubImage2D's format/type needs to match the internalformat/type from the previous texImage2D call
     6        https://bugs.webkit.org/show_bug.cgi?id=53054
     7
     8        * fast/canvas/webgl/tex-sub-image-2d-bad-args-expected.txt: Added.
     9        * fast/canvas/webgl/tex-sub-image-2d-bad-args.html: Added.
     10
    1112011-01-27  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r76873 r76874  
     12011-01-27  Zhenyao Mo  <zmo@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        texSubImage2D's format/type needs to match the internalformat/type from the previous texImage2D call
     6        https://bugs.webkit.org/show_bug.cgi?id=53054
     7
     8        Test: fast/canvas/webgl/tex-sub-image-2d-bad-args.html
     9
     10        * html/canvas/WebGLRenderingContext.cpp:
     11        (WebCore::WebGLRenderingContext::texSubImage2DBase): Check format/type match.
     12
    1132011-01-27  Yi Shen  <yi.4.shen@nokia.com>, Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
    214
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r76814 r76874  
    30793079    if (isContextLost())
    30803080        return;
    3081     if (!validateTexFuncFormatAndType(format, type))
    3082         return;
    3083     if (!validateTextureBinding(target, true))
    3084         return;
    3085     if (!validateSize(xoffset, yoffset) || !validateSize(width, height))
    3086         return;
     3081    if (!validateTexFuncParameters(target, level, format, width, height, 0, format, type))
     3082        return;
     3083    if (!validateSize(xoffset, yoffset))
     3084        return;
     3085    WebGLTexture* tex = validateTextureBinding(target, true);
     3086    if (!tex)
     3087        return;
     3088    if (xoffset + width > tex->getWidth(target, level) || yoffset + height > tex->getHeight(target, level)) {
     3089        m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
     3090        return;
     3091    }
     3092    if (tex->getInternalFormat(target, level) != format || tex->getType(target, level) != type) {
     3093        m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
     3094        return;
     3095    }
    30873096    m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
    30883097    cleanupAfterGraphicsCall(false);
Note: See TracChangeset for help on using the changeset viewer.