diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-14 18:04:49 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-14 18:04:49 +0000 |
commit | 2f143d485600728b7037d3a71920ab74abe07eb5 (patch) | |
tree | fc5d0d7ce1295d5741ed80a96843d5d08df5fd7c /cc | |
parent | 0e2f4256b4bdc921a738c0285470aa1943885b33 (diff) | |
download | chromium_src-2f143d485600728b7037d3a71920ab74abe07eb5.zip chromium_src-2f143d485600728b7037d3a71920ab74abe07eb5.tar.gz chromium_src-2f143d485600728b7037d3a71920ab74abe07eb5.tar.bz2 |
Implement EXT_draw_buffers WebGL extention support in command buffer.
A few things:
1) I only hooked up with desktop GL backend, i.e., GL_ARB_draw_buffers. Will add GLES support later.
2) Probably we need to do something to enable this for Pepper3D also? If yes, will do so in a seperate CL.
3) I didn't add the wordarounds for Mac/Linux driver bugs. Will do so in a seperate CL.
BUG=180397
TEST=gpu_unittests, webgl conformance tests
Review URL: https://codereview.chromium.org/12545014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/fake_web_graphics_context_3d.h | 3 | ||||
-rw-r--r-- | cc/test/test_web_graphics_context_3d.cc | 33 |
2 files changed, 22 insertions, 14 deletions
diff --git a/cc/fake_web_graphics_context_3d.h b/cc/fake_web_graphics_context_3d.h index 42a3151..b3970b6 100644 --- a/cc/fake_web_graphics_context_3d.h +++ b/cc/fake_web_graphics_context_3d.h @@ -582,6 +582,9 @@ class CC_EXPORT FakeWebGraphicsContext3D : virtual void loseContextCHROMIUM(WebKit::WGC3Denum current, WebKit::WGC3Denum other); + + virtual void drawBuffersEXT(WebKit::WGC3Dsizei m, + const WebKit::WGC3Denum* bufs) {} }; } // namespace cc diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc index b4a2c7e..e09a866 100644 --- a/cc/test/test_web_graphics_context_3d.cc +++ b/cc/test/test_web_graphics_context_3d.cc @@ -13,7 +13,12 @@ #include "third_party/khronos/GLES2/gl2ext.h" using WebKit::WGC3Dboolean; +using WebKit::WGC3Dchar; using WebKit::WGC3Denum; +using WebKit::WGC3Dint; +using WebKit::WGC3Dsizei; +using WebKit::WGC3Dsizeiptr; +using WebKit::WGC3Duint; using WebKit::WebGLId; using WebKit::WebGraphicsContext3D; @@ -121,14 +126,14 @@ WebKit::WebString TestWebGraphicsContext3D::getString(WGC3Denum name) { return WebKit::WebString::fromUTF8(string.c_str()); } -WebKit::WGC3Dint TestWebGraphicsContext3D::getUniformLocation( +WGC3Dint TestWebGraphicsContext3D::getUniformLocation( WebGLId program, - const WebKit::WGC3Dchar* name) { + const WGC3Dchar* name) { return 0; } -WebKit::WGC3Dsizeiptr TestWebGraphicsContext3D::getVertexAttribOffset( - WebKit::WGC3Duint index, +WGC3Dsizeiptr TestWebGraphicsContext3D::getVertexAttribOffset( + WGC3Duint index, WGC3Denum pname) { return 0; } @@ -172,7 +177,7 @@ WebGLId TestWebGraphicsContext3D::createBuffer() { return kBufferId | context_id_ << 16; } -void TestWebGraphicsContext3D::deleteBuffer(WebKit::WebGLId id) { +void TestWebGraphicsContext3D::deleteBuffer(WebGLId id) { EXPECT_EQ(kBufferId | context_id_ << 16, id); } @@ -180,7 +185,7 @@ WebGLId TestWebGraphicsContext3D::createFramebuffer() { return kFramebufferId | context_id_ << 16; } -void TestWebGraphicsContext3D::deleteFramebuffer(WebKit::WebGLId id) { +void TestWebGraphicsContext3D::deleteFramebuffer(WebGLId id) { EXPECT_EQ(kFramebufferId | context_id_ << 16, id); } @@ -188,7 +193,7 @@ WebGLId TestWebGraphicsContext3D::createProgram() { return kProgramId | context_id_ << 16; } -void TestWebGraphicsContext3D::deleteProgram(WebKit::WebGLId id) { +void TestWebGraphicsContext3D::deleteProgram(WebGLId id) { EXPECT_EQ(kProgramId | context_id_ << 16, id); } @@ -196,7 +201,7 @@ WebGLId TestWebGraphicsContext3D::createRenderbuffer() { return kRenderbufferId | context_id_ << 16; } -void TestWebGraphicsContext3D::deleteRenderbuffer(WebKit::WebGLId id) { +void TestWebGraphicsContext3D::deleteRenderbuffer(WebGLId id) { EXPECT_EQ(kRenderbufferId | context_id_ << 16, id); } @@ -204,7 +209,7 @@ WebGLId TestWebGraphicsContext3D::createShader(WGC3Denum) { return kShaderId | context_id_ << 16; } -void TestWebGraphicsContext3D::deleteShader(WebKit::WebGLId id) { +void TestWebGraphicsContext3D::deleteShader(WebGLId id) { EXPECT_EQ(kShaderId | context_id_ << 16, id); } @@ -271,7 +276,7 @@ void TestWebGraphicsContext3D::bindTexture( used_textures_.insert(texture_id); } -void TestWebGraphicsContext3D::endQueryEXT(WebKit::WGC3Denum target) { +void TestWebGraphicsContext3D::endQueryEXT(WGC3Denum target) { if (times_end_query_succeeds_ >= 0) { if (!times_end_query_succeeds_) { loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, @@ -282,9 +287,9 @@ void TestWebGraphicsContext3D::endQueryEXT(WebKit::WGC3Denum target) { } void TestWebGraphicsContext3D::getQueryObjectuivEXT( - WebKit::WebGLId query, - WebKit::WGC3Denum pname, - WebKit::WGC3Duint* params) { + WebGLId query, + WGC3Denum pname, + WGC3Duint* params) { // If the context is lost, behave as if result is available. if (pname == GL_QUERY_RESULT_AVAILABLE_EXT) *params = 1; @@ -308,7 +313,7 @@ void TestWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current, shared_contexts_.clear(); } -WebKit::WebGLId TestWebGraphicsContext3D::NextTextureId() { +WebGLId TestWebGraphicsContext3D::NextTextureId() { WebGLId texture_id = next_texture_id_++; DCHECK(texture_id < (1 << 16)); texture_id |= context_id_ << 16; |