diff options
author | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-14 16:58:28 +0000 |
---|---|---|
committer | reveman@google.com <reveman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-14 16:58:28 +0000 |
commit | 1097c3a19c55d647abf165b057b639c01fbd0044 (patch) | |
tree | 31975b53be93f62669b993dd73e4a0a5b3a36645 /webkit | |
parent | 16fc2b8b8eb1cb0c6b272c5f8d4ede58f44b340b (diff) | |
download | chromium_src-1097c3a19c55d647abf165b057b639c01fbd0044.zip chromium_src-1097c3a19c55d647abf165b057b639c01fbd0044.tar.gz chromium_src-1097c3a19c55d647abf165b057b639c01fbd0044.tar.bz2 |
WebKit support for EXT_occlusion_query.
BUG=117768
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9693045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
4 files changed, 59 insertions, 0 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc index a1f735b..f729b92 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc @@ -1556,6 +1556,24 @@ DELEGATE_TO_GL_5(texImageIOSurface2DCHROMIUM, TexImageIOSurface2DCHROMIUM, DELEGATE_TO_GL_5(texStorage2DEXT, TexStorage2DEXT, WGC3Denum, WGC3Dint, WGC3Duint, WGC3Dint, WGC3Dint) +WebGLId WebGraphicsContext3DInProcessCommandBufferImpl::createQueryEXT() { + GLuint o; + gl_->GenQueriesEXT(1, &o); + return o; +} + +void WebGraphicsContext3DInProcessCommandBufferImpl:: + deleteQueryEXT(WebGLId query) { + gl_->DeleteQueriesEXT(1, &query); +} + +DELEGATE_TO_GL_1R(isQueryEXT, IsQueryEXT, WebGLId, WGC3Dboolean) +DELEGATE_TO_GL_2(beginQueryEXT, BeginQueryEXT, WGC3Denum, WebGLId) +DELEGATE_TO_GL_1(endQueryEXT, EndQueryEXT, WGC3Denum) +DELEGATE_TO_GL_3(getQueryivEXT, GetQueryivEXT, WGC3Denum, WGC3Denum, WGC3Dint*) +DELEGATE_TO_GL_3(getQueryObjectuivEXT, GetQueryObjectuivEXT, + WebGLId, WGC3Denum, WGC3Duint*) + #if WEBKIT_USING_SKIA GrGLInterface* WebGraphicsContext3DInProcessCommandBufferImpl:: onCreateGrGLInterface() { diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h index fcce88b..ea69865 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h @@ -461,6 +461,16 @@ class WebGraphicsContext3DInProcessCommandBufferImpl WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat, WGC3Dint width, WGC3Dint height); + virtual WebGLId createQueryEXT(); + virtual void deleteQueryEXT(WebGLId query); + virtual WGC3Dboolean isQueryEXT(WebGLId query); + virtual void beginQueryEXT(WGC3Denum target, WebGLId query); + virtual void endQueryEXT(WGC3Denum target); + virtual void getQueryivEXT( + WGC3Denum target, WGC3Denum pname, WGC3Dint* params); + virtual void getQueryObjectuivEXT( + WebGLId query, WGC3Denum pname, WGC3Duint* params); + protected: #if WEBKIT_USING_SKIA virtual GrGLInterface* onCreateGrGLInterface(); diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc index 5b39a84..25b4559 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.cc +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.cc @@ -1635,6 +1635,27 @@ void WebGraphicsContext3DInProcessImpl::texImageIOSurface2DCHROMIUM( DELEGATE_TO_GL_5(texStorage2DEXT, TexStorage2DEXT, WGC3Denum, WGC3Dint, WGC3Duint, WGC3Dint, WGC3Dint) +WebGLId WebGraphicsContext3DInProcessImpl::createQueryEXT() +{ + makeContextCurrent(); + GLuint o = 0; + glGenQueriesARB(1, &o); + return o; +} + +void WebGraphicsContext3DInProcessImpl::deleteQueryEXT(WebGLId query) +{ + makeContextCurrent(); + glDeleteQueriesARB(1, &query); +} + +DELEGATE_TO_GL_1R(isQueryEXT, IsQueryARB, WebGLId, WGC3Dboolean) +DELEGATE_TO_GL_2(beginQueryEXT, BeginQueryARB, WGC3Denum, WebGLId) +DELEGATE_TO_GL_1(endQueryEXT, EndQueryARB, WGC3Denum) +DELEGATE_TO_GL_3(getQueryivEXT, GetQueryivARB, WGC3Denum, WGC3Denum, WGC3Dint*) +DELEGATE_TO_GL_3(getQueryObjectuivEXT, GetQueryObjectuivARB, + WebGLId, WGC3Denum, WGC3Duint*) + #if WEBKIT_USING_SKIA GrGLInterface* WebGraphicsContext3DInProcessImpl::onCreateGrGLInterface() { return gfx::CreateInProcessSkiaGLBinding(); diff --git a/webkit/gpu/webgraphicscontext3d_in_process_impl.h b/webkit/gpu/webgraphicscontext3d_in_process_impl.h index 37d9e15e..a26a6ba 100644 --- a/webkit/gpu/webgraphicscontext3d_in_process_impl.h +++ b/webkit/gpu/webgraphicscontext3d_in_process_impl.h @@ -458,6 +458,16 @@ class WebGraphicsContext3DInProcessImpl : public WebGraphicsContext3D { WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat, WGC3Dint width, WGC3Dint height); + virtual WebGLId createQueryEXT(); + virtual void deleteQueryEXT(WebGLId query); + virtual WGC3Dboolean isQueryEXT(WebGLId query); + virtual void beginQueryEXT(WGC3Denum target, WebGLId query); + virtual void endQueryEXT(WGC3Denum target); + virtual void getQueryivEXT( + WGC3Denum target, WGC3Denum pname, WGC3Dint* params); + virtual void getQueryObjectuivEXT( + WebGLId query, WGC3Denum pname, WGC3Duint* params); + protected: #if WEBKIT_USING_SKIA virtual GrGLInterface* onCreateGrGLInterface(); |