Commit d687633b authored by eric@webkit.org's avatar eric@webkit.org

2010-05-20 Zhenyao Mo <zmo@google.com>

        Reviewed by Dimitri Glazkov.

        Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
        https://bugs.webkit.org/show_bug.cgi?id=39077

        * fast/canvas/webgl/framebuffer-object-attachment-expected.txt: Add the test cases for color renderbuffer creation and attachment to framebuffer.
        * fast/canvas/webgl/framebuffer-object-attachment.html: Ditto.
2010-05-20  Zhenyao Mo  <zmo@google.com>

        Reviewed by Dimitri Glazkov.

        Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
        https://bugs.webkit.org/show_bug.cgi?id=39077

        * platform/graphics/mac/GraphicsContext3DMac.cpp:
        (WebCore::GraphicsContext3D::renderbufferStorage): Mapping the enums.
2010-05-20  Zhenyao Mo  <zmo@google.com>

        Reviewed by Dimitri Glazkov.

        Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
        https://bugs.webkit.org/show_bug.cgi?id=39077

        * src/WebGraphicsContext3DDefaultImpl.cpp:
        (WebKit::WebGraphicsContext3DDefaultImpl::renderbufferStorage): Mapping the enums.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 55bf8727
2010-05-20 Zhenyao Mo <zmo@google.com>
Reviewed by Dimitri Glazkov.
Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
https://bugs.webkit.org/show_bug.cgi?id=39077
* fast/canvas/webgl/framebuffer-object-attachment-expected.txt: Add the test cases for color renderbuffer creation and attachment to framebuffer.
* fast/canvas/webgl/framebuffer-object-attachment.html: Ditto.
2010-05-20 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
......@@ -73,6 +73,21 @@ PASS gl.getError() is gl.NO_ERROR
PASS gl.getError() is gl.INVALID_OPERATION
PASS gl.getError() is gl.NO_ERROR
PASS gl.getError() is gl.NO_ERROR
Attach color renderbuffer with internalformat == RGBA4
PASS colorBuffer = gl.createRenderbuffer() is non-null.
PASS gl.getError() is gl.NO_ERROR
PASS fbo = gl.createFramebuffer() is non-null.
PASS gl.getError() is gl.NO_ERROR
Attach color renderbuffer with internalformat == RGB5_A1
PASS colorBuffer = gl.createRenderbuffer() is non-null.
PASS gl.getError() is gl.NO_ERROR
PASS fbo = gl.createFramebuffer() is non-null.
PASS gl.getError() is gl.NO_ERROR
Attach color renderbuffer with internalformat == RGB565
PASS colorBuffer = gl.createRenderbuffer() is non-null.
PASS gl.getError() is gl.NO_ERROR
PASS fbo = gl.createFramebuffer() is non-null.
PASS gl.getError() is gl.NO_ERROR
PASS successfullyParsed is true
TEST COMPLETE
......
......@@ -15,6 +15,7 @@ var fbo;
var depthBuffer;
var stencilBuffer;
var depthStencilBuffer;
var colorBuffer;
var width = 2;
var height = 2;
......@@ -43,6 +44,15 @@ function testAttachments(attachment0, buffer0, attachment1, buffer1, isConflicte
}
}
function testColorRenderbuffer(internalformat)
{
shouldBeNonNull("colorBuffer = gl.createRenderbuffer()");
gl.bindRenderbuffer(gl.RENDERBUFFER, colorBuffer);
gl.renderbufferStorage(gl.RENDERBUFFER, internalformat, width, height);
shouldBe("gl.getError()", "gl.NO_ERROR");
testAttachment(gl.COLOR_ATTACHMENT0, colorBuffer, false);
}
description("Test framebuffer object attachment behaviors");
debug("Create renderbuffers");
......@@ -92,6 +102,15 @@ testAttachments(gl.DEPTH_ATTACHMENT, depthBuffer, gl.DEPTH_STENCIL_ATTACHMENT, d
debug("Attach depthStencil, then stencil, causing conflict");
testAttachments(gl.DEPTH_STENCIL_ATTACHMENT, depthStencilBuffer, gl.STENCIL_ATTACHMENT, stencilBuffer, true);
debug("Attach color renderbuffer with internalformat == RGBA4");
testColorRenderbuffer(gl.RGBA4);
debug("Attach color renderbuffer with internalformat == RGB5_A1");
testColorRenderbuffer(gl.RGB5_A1);
debug("Attach color renderbuffer with internalformat == RGB565");
testColorRenderbuffer(gl.RGB565);
successfullyParsed = true;
</script>
......
2010-05-20 Zhenyao Mo <zmo@google.com>
Reviewed by Dimitri Glazkov.
Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
https://bugs.webkit.org/show_bug.cgi?id=39077
* platform/graphics/mac/GraphicsContext3DMac.cpp:
(WebCore::GraphicsContext3D::renderbufferStorage): Mapping the enums.
2010-05-20 Dan Bernstein <mitz@apple.com>
Reviewed by Dave Hyatt.
......@@ -840,10 +840,21 @@ void GraphicsContext3D::releaseShaderCompiler()
void GraphicsContext3D::renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height)
{
ensureContext(m_contextObj);
if (internalformat == DEPTH_STENCIL)
switch (internalformat) {
case DEPTH_STENCIL:
internalformat = GL_DEPTH24_STENCIL8_EXT;
else if (internalformat == DEPTH_COMPONENT16)
break;
case DEPTH_COMPONENT16:
internalformat = GL_DEPTH_COMPONENT;
break;
case RGBA4:
case RGB5_A1:
internalformat = GL_RGBA;
break;
case RGB565:
internalformat = GL_RGB;
break;
}
::glRenderbufferStorageEXT(target, internalformat, width, height);
}
......
2010-05-20 Zhenyao Mo <zmo@google.com>
Reviewed by Dimitri Glazkov.
Map RGBA4/RGB5_A1 to RGBA and RGB565 to RGB in RenderbufferStorage
https://bugs.webkit.org/show_bug.cgi?id=39077
* src/WebGraphicsContext3DDefaultImpl.cpp:
(WebKit::WebGraphicsContext3DDefaultImpl::renderbufferStorage): Mapping the enums.
2010-05-20 Abhishek Arya <inferno@chromium.org>
Reviewed by Adam Barth.
......
......@@ -1215,10 +1215,21 @@ void WebGraphicsContext3DDefaultImpl::renderbufferStorage(unsigned long target,
unsigned long height)
{
makeContextCurrent();
if (internalformat == GL_DEPTH_STENCIL)
switch (internalformat) {
case GL_DEPTH_STENCIL:
internalformat = GL_DEPTH24_STENCIL8_EXT;
else if (internalformat == GL_DEPTH_COMPONENT16)
break;
case GL_DEPTH_COMPONENT16:
internalformat = GL_DEPTH_COMPONENT;
break;
case GL_RGBA4:
case GL_RGB5_A1:
internalformat = GL_RGBA;
break;
case 0x8D62: // GL_RGB565
internalformat = GL_RGB;
break;
}
glRenderbufferStorageEXT(target, internalformat, width, height);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment