Changeset 248448 in webkit


Ignore:
Timestamp:
Aug 8, 2019 4:25:08 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Short-cut WebGLRenderingContext::getParameter() for ALPHA_BITS when alpha channel is disabled
https://bugs.webkit.org/show_bug.cgi?id=200499

Source/WebCore:

Patch by Chris Lord <Chris Lord> on 2019-08-08
Reviewed by Darin Adler.

This patch adds a shortcut when a framebuffer isn't bound on WebGL
canvases when retrieving ALPHA_BITS.

No new tests, covered by existing tests.

  • html/canvas/WebGLRenderingContext.cpp:

(WebCore::WebGLRenderingContext::getParameter):
Return 0 for ALPHA_BITS if canvas has no alpha component.

  • html/canvas/WebGL2RenderingContext.cpp:

(WebCore::WebGLRenderingContext::getParameter):
Return 0 for ALPHA_BITS if canvas has no alpha component.

LayoutTests:

Patch by Chris Lord <chrislord.net@gmail.com> on 2019-08-08
Reviewed by Darin Adler.

  • platform/ios-simulator/webgl/2.0.0/conformance/context/context-attributes-alpha-depth-stencil-antialias-expected.txt:

1 more passing test.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248434 r248448  
     12019-08-08  Chris Lord  <chrislord.net@gmail.com>
     2
     3        Short-cut WebGLRenderingContext::getParameter() for ALPHA_BITS when alpha channel is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=200499
     5
     6        Reviewed by Darin Adler.
     7
     8        * platform/ios-simulator/webgl/2.0.0/conformance/context/context-attributes-alpha-depth-stencil-antialias-expected.txt:
     9        1 more passing test.
     10
    1112019-08-08  Devin Rousso  <drousso@apple.com>
    212
  • trunk/LayoutTests/platform/ios-simulator/webgl/2.0.0/conformance/context/context-attributes-alpha-depth-stencil-antialias-expected.txt

    r236236 r248448  
    2020[ 17: PASS ] getError was expected value: NO_ERROR : should be no errors
    2121[ 18: PASS ] gl = getWebGL(1, 1, { alpha: false, depth: false, stencil: false, antialias: false }, [ 0, 0, 0, 0 ], 1, 0) is non-null.
    22 [ 19: FAIL ] gl.getParameter(gl.ALPHA_BITS) == 0 should be true. Was false.
     22[ 19: PASS ] gl.getParameter(gl.ALPHA_BITS) == 0 is true
    2323[ 20: PASS ] gl.getParameter(gl.RED_BITS) >= 8 is true
    2424[ 21: PASS ] gl.getParameter(gl.GREEN_BITS) >= 8 is true
     
    105105[ 102: PASS ] redChannels[0] != 255 && redChannels[0] != 0 is contextAttribs.antialias
    106106[ 103: PASS ] successfullyParsed is true
    107 [ FAIL ] 2 failures reported
     107[ FAIL ] 1 failures reported
    108108
  • trunk/Source/WebCore/ChangeLog

    r248447 r248448  
     12019-08-08  Chris Lord  <clord@igalia.com>
     2
     3        Short-cut WebGLRenderingContext::getParameter() for ALPHA_BITS when alpha channel is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=200499
     5
     6        Reviewed by Darin Adler.
     7
     8        This patch adds a shortcut when a framebuffer isn't bound on WebGL
     9        canvases when retrieving ALPHA_BITS.
     10
     11        No new tests, covered by existing tests.
     12
     13        * html/canvas/WebGLRenderingContext.cpp:
     14        (WebCore::WebGLRenderingContext::getParameter):
     15        Return 0 for ALPHA_BITS if canvas has no alpha component.
     16        * html/canvas/WebGL2RenderingContext.cpp:
     17        (WebCore::WebGLRenderingContext::getParameter):
     18        Return 0 for ALPHA_BITS if canvas has no alpha component.
     19
    1202019-08-08  Chris Dumez  <cdumez@apple.com>
    221
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

    r243887 r248448  
    17721772        return getWebGLFloatArrayParameter(pname);
    17731773    case GraphicsContext3D::ALPHA_BITS:
     1774        if (!m_framebufferBinding && !m_attributes.alpha)
     1775            return 0;
    17741776        return getIntParameter(pname);
    17751777    case GraphicsContext3D::ARRAY_BUFFER_BINDING:
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp

    r243887 r248448  
    422422        return getWebGLFloatArrayParameter(pname);
    423423    case GraphicsContext3D::ALPHA_BITS:
     424        if (!m_framebufferBinding && !m_attributes.alpha)
     425            return 0;
    424426        return getIntParameter(pname);
    425427    case GraphicsContext3D::ARRAY_BUFFER_BINDING:
Note: See TracChangeset for help on using the changeset viewer.