[Chromium] GL_EXT_occlusion_query_boolean and GL_CHROMIUM_command_buffer_query support.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2012 18:27:42 +0000 (18:27 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 19 Mar 2012 18:27:42 +0000 (18:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80988

Patch by David Reveman <reveman@chromium.org> on 2012-03-19
Reviewed by Adrienne Walker.

Source/Platform:

Add EXT_occlusion_query API to WebGraphicsContext3D.

* chromium/public/WebGraphicsContext3D.h:
(WebGraphicsContext3D):

Source/WebCore:

Expose EXT_occlusion_query API to WebKit compositor. Add
GL_EXT_occlusion_query_boolean and GL_CHROMIUM_command_buffer_query
enums.

* platform/graphics/chromium/Extensions3DChromium.h:
(Extensions3DChromium):

Source/WebKit/chromium:

Expose EXT_occlusion_query API to WebKit compositor.

* src/Extensions3DChromium.cpp:
(WebCore::Extensions3DChromium::createQueryEXT):
(WebCore):
(WebCore::Extensions3DChromium::deleteQueryEXT):
(WebCore::Extensions3DChromium::isQueryEXT):
(WebCore::Extensions3DChromium::beginQueryEXT):
(WebCore::Extensions3DChromium::endQueryEXT):
(WebCore::Extensions3DChromium::getQueryivEXT):
(WebCore::Extensions3DChromium::getQueryObjectuivEXT):
* src/GraphicsContext3DChromium.cpp:
(WebCore):
* src/GraphicsContext3DPrivate.h:
(GraphicsContext3DPrivate):
* tests/FakeWebGraphicsContext3D.h:
(WebKit::FakeWebGraphicsContext3D::createQueryEXT):
(WebKit::FakeWebGraphicsContext3D::deleteQueryEXT):
(WebKit::FakeWebGraphicsContext3D::isQueryEXT):
(WebKit::FakeWebGraphicsContext3D::beginQueryEXT):
(WebKit::FakeWebGraphicsContext3D::endQueryEXT):
(WebKit::FakeWebGraphicsContext3D::getQueryivEXT):
(WebKit::FakeWebGraphicsContext3D::getQueryObjectuivEXT):
(FakeWebGraphicsContext3D):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111207 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/Platform/ChangeLog
Source/Platform/chromium/public/WebGraphicsContext3D.h
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/Extensions3DChromium.cpp
Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
Source/WebKit/chromium/src/GraphicsContext3DPrivate.h
Source/WebKit/chromium/tests/FakeWebGraphicsContext3D.h

index 8eb711aaf61373438dd5e8e08d56f6b6955ac822..b119213da83f6de9513ab1399e2364e061cc17d3 100644 (file)
@@ -1,3 +1,15 @@
+2012-03-19  David Reveman  <reveman@chromium.org>
+
+        [Chromium] GL_EXT_occlusion_query_boolean and GL_CHROMIUM_command_buffer_query support.
+        https://bugs.webkit.org/show_bug.cgi?id=80988
+
+        Reviewed by Adrienne Walker.
+
+        Add EXT_occlusion_query API to WebGraphicsContext3D.
+
+        * chromium/public/WebGraphicsContext3D.h:
+        (WebGraphicsContext3D):
+
 2012-03-08  James Robinson  <jamesr@chromium.org>
 
         Use an explicit attribute to signal that a context prefers to use a discrete GPU
index 274c2794c1811208b153291f9b6ad16dcbd414bf..ea438dee6d040df2815afb9749663e94fa4b40b8 100644 (file)
@@ -398,6 +398,14 @@ public:
     virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat,
                                  WGC3Dint width, WGC3Dint height) { }
 
+    // GL_EXT_occlusion_query
+    virtual WebGLId createQueryEXT() = 0;
+    virtual void deleteQueryEXT(WebGLId query) = 0;
+    virtual WGC3Dboolean isQueryEXT(WebGLId query) = 0;
+    virtual void beginQueryEXT(WGC3Denum target, WebGLId query) = 0;
+    virtual void endQueryEXT(WGC3Denum target) = 0;
+    virtual void getQueryivEXT(WGC3Denum target, WGC3Denum pname, WGC3Dint* params) = 0;
+    virtual void getQueryObjectuivEXT(WebGLId query, WGC3Denum pname, WGC3Duint* params) = 0;
 
 #if WEBKIT_USING_SKIA
     GrGLInterface* createGrGLInterface();
index 6804e612317abf4d2c1b6f39048c2495f9e74112..564f0d5ad117f9611f99cd8c16ab25d988ff1d09 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-19  David Reveman  <reveman@chromium.org>
+
+        [Chromium] GL_EXT_occlusion_query_boolean and GL_CHROMIUM_command_buffer_query support.
+        https://bugs.webkit.org/show_bug.cgi?id=80988
+
+        Reviewed by Adrienne Walker.
+
+        Expose EXT_occlusion_query API to WebKit compositor. Add
+        GL_EXT_occlusion_query_boolean and GL_CHROMIUM_command_buffer_query
+        enums.
+
+        * platform/graphics/chromium/Extensions3DChromium.h:
+        (Extensions3DChromium):
+
 2012-03-19  Mike Lawther  <mikelawther@chromium.org>
 
         CSS3 calc: make mask images work with mixed percent/absolute
index 53322f0f25ed407a25e6b62327e871289d18bd5a..428219a2e84b01f6d1cae89581a94afb2eee8118 100644 (file)
@@ -46,8 +46,10 @@ public:
     //   GL_CHROMIUM_rate_limit_offscreen_context
     //   GL_CHROMIUM_paint_framebuffer_canvas
     //   GL_CHROMIUM_iosurface (Mac OS X specific)
+    //   GL_CHROMIUM_command_buffer_query
     //   GL_ANGLE_texture_usage
     //   GL_EXT_texture_storage
+    //   GL_EXT_occlusion_query_boolean
 
     // Extensions3D methods.
     virtual bool supports(const String&);
@@ -75,7 +77,17 @@ public:
         GL_FRAMEBUFFER_ATTACHMENT_ANGLE = 0x93A3,
 
         // GL_EXT_texture_storage
-        BGRA8_EXT = 0x93A1
+        BGRA8_EXT = 0x93A1,
+
+        // GL_EXT_occlusion_query_boolean
+        ANY_SAMPLES_PASSED_EXT = 0x8C2F,
+        ANY_SAMPLES_PASSED_CONSERVATIVE_EXT = 0x8D6A,
+        CURRENT_QUERY_EXT = 0x8865,
+        QUERY_RESULT_EXT = 0x8866,
+        QUERY_RESULT_AVAILABLE_EXT = 0x8867,
+
+        // GL_CHROMIUM_command_buffer_query
+        COMMANDS_ISSUED_CHROMIUM = 0x84F2
     };
 
     // GL_CHROMIUM_post_sub_buffer
@@ -120,6 +132,15 @@ public:
     // GL_EXT_texture_storage
     void texStorage2DEXT(unsigned target, int levels, unsigned internalformat, int width, int height);
 
+    // GL_EXT_occlusion_query
+    Platform3DObject createQueryEXT();
+    void deleteQueryEXT(Platform3DObject);
+    GC3Dboolean isQueryEXT(Platform3DObject);
+    void beginQueryEXT(GC3Denum, Platform3DObject);
+    void endQueryEXT(GC3Denum);
+    void getQueryivEXT(GC3Denum, GC3Denum, GC3Dint*);
+    void getQueryObjectuivEXT(Platform3DObject, GC3Denum, GC3Duint*);
+
 private:
     // Instances of this class are strictly owned by the GraphicsContext3D implementation and do not
     // need to be instantiated by any other code.
index 38528a487c9b9ee4c73a798543c78f85e3468fa3..69daa4379d61771761b6f4b3392a053391ff51ff 100644 (file)
@@ -1,3 +1,35 @@
+2012-03-19  David Reveman  <reveman@chromium.org>
+
+        [Chromium] GL_EXT_occlusion_query_boolean and GL_CHROMIUM_command_buffer_query support.
+        https://bugs.webkit.org/show_bug.cgi?id=80988
+
+        Reviewed by Adrienne Walker.
+
+        Expose EXT_occlusion_query API to WebKit compositor.
+
+        * src/Extensions3DChromium.cpp:
+        (WebCore::Extensions3DChromium::createQueryEXT):
+        (WebCore):
+        (WebCore::Extensions3DChromium::deleteQueryEXT):
+        (WebCore::Extensions3DChromium::isQueryEXT):
+        (WebCore::Extensions3DChromium::beginQueryEXT):
+        (WebCore::Extensions3DChromium::endQueryEXT):
+        (WebCore::Extensions3DChromium::getQueryivEXT):
+        (WebCore::Extensions3DChromium::getQueryObjectuivEXT):
+        * src/GraphicsContext3DChromium.cpp:
+        (WebCore):
+        * src/GraphicsContext3DPrivate.h:
+        (GraphicsContext3DPrivate):
+        * tests/FakeWebGraphicsContext3D.h:
+        (WebKit::FakeWebGraphicsContext3D::createQueryEXT):
+        (WebKit::FakeWebGraphicsContext3D::deleteQueryEXT):
+        (WebKit::FakeWebGraphicsContext3D::isQueryEXT):
+        (WebKit::FakeWebGraphicsContext3D::beginQueryEXT):
+        (WebKit::FakeWebGraphicsContext3D::endQueryEXT):
+        (WebKit::FakeWebGraphicsContext3D::getQueryivEXT):
+        (WebKit::FakeWebGraphicsContext3D::getQueryObjectuivEXT):
+        (FakeWebGraphicsContext3D):
+
 2012-03-19  Dana Jansens  <danakj@chromium.org>
 
         [chromium] Unit test fix, save the sharedQuadState while the quads hold a pointer to it
index 73397bd2b16a7cccfa182ba12768da0c7a5876db..6b56cca0c981d0c01e43cbc08b5bc0414fca1743 100644 (file)
@@ -160,6 +160,41 @@ void Extensions3DChromium::texStorage2DEXT(unsigned int target, int levels, unsi
     m_private->texStorage2DEXT(target, levels, internalFormat, width, height);
 }
 
+Platform3DObject Extensions3DChromium::createQueryEXT()
+{
+    return m_private->createQueryEXT();
+}
+
+void Extensions3DChromium::deleteQueryEXT(Platform3DObject query)
+{
+    m_private->deleteQueryEXT(query);
+}
+
+GC3Dboolean Extensions3DChromium::isQueryEXT(Platform3DObject query)
+{
+    return m_private->isQueryEXT(query);
+}
+
+void Extensions3DChromium::beginQueryEXT(GC3Denum target, Platform3DObject query)
+{
+    m_private->beginQueryEXT(target, query);
+}
+
+void Extensions3DChromium::endQueryEXT(GC3Denum target)
+{
+    m_private->endQueryEXT(target);
+}
+
+void Extensions3DChromium::getQueryivEXT(GC3Denum target, GC3Denum pname, GC3Dint* params)
+{
+    m_private->getQueryivEXT(target, pname, params);
+}
+
+void Extensions3DChromium::getQueryObjectuivEXT(Platform3DObject query, GC3Denum pname, GC3Duint* params)
+{
+    m_private->getQueryObjectuivEXT(query, pname, params);
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(WEBGL)
index 0d0c0c8369be4765530ab2e923af1098a2b6b24a..75e97a9d995ce292c8819694843c1312704bfe8f 100644 (file)
@@ -889,6 +889,14 @@ DELEGATE_TO_IMPL_1R(getTranslatedShaderSourceANGLE, Platform3DObject, String)
 DELEGATE_TO_IMPL_5(texImageIOSurface2DCHROMIUM, GC3Denum, GC3Dint, GC3Dint, GC3Duint, GC3Duint)
 DELEGATE_TO_IMPL_5(texStorage2DEXT, GC3Denum, GC3Dint, GC3Duint, GC3Dint, GC3Dint)
 
+DELEGATE_TO_IMPL_R(createQueryEXT, Platform3DObject)
+DELEGATE_TO_IMPL_1(deleteQueryEXT, Platform3DObject)
+DELEGATE_TO_IMPL_1R(isQueryEXT, Platform3DObject, GC3Dboolean)
+DELEGATE_TO_IMPL_2(beginQueryEXT, GC3Denum, Platform3DObject)
+DELEGATE_TO_IMPL_1(endQueryEXT, GC3Denum)
+DELEGATE_TO_IMPL_3(getQueryivEXT, GC3Denum, GC3Denum, GC3Dint*)
+DELEGATE_TO_IMPL_3(getQueryObjectuivEXT, Platform3DObject, GC3Denum, GC3Duint*)
+
 //----------------------------------------------------------------------
 // GraphicsContext3D
 //
index be9db4287db6efa3285fccb854fea3483ad15b6c..29bb6ef520b01f02080b90791c6bd5e58eddbc43 100644 (file)
@@ -307,6 +307,15 @@ public:
     // GL_EXT_texture_storage
     void texStorage2DEXT(GC3Denum target, GC3Dint levels, GC3Duint internalformat, GC3Dint width, GC3Dint height);
 
+    // GL_EXT_occlusion_query
+    Platform3DObject createQueryEXT();
+    void deleteQueryEXT(Platform3DObject);
+    GC3Dboolean isQueryEXT(Platform3DObject);
+    void beginQueryEXT(GC3Denum, Platform3DObject);
+    void endQueryEXT(GC3Denum);
+    void getQueryivEXT(GC3Denum, GC3Denum, GC3Dint*);
+    void getQueryObjectuivEXT(Platform3DObject, GC3Denum, GC3Duint*);
+
 private:
     GraphicsContext3DPrivate(PassOwnPtr<WebKit::WebGraphicsContext3D>, bool preserveDrawingBuffer);
 
index 268dc1da35dba3535544e09381ca507d34cc8073..2c161a8b8d8a0857ebf7bb8a793088d238e9e5a9 100644 (file)
@@ -255,6 +255,14 @@ public:
     virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat,
                                  WGC3Dint width, WGC3Dint height) { }
 
+    virtual WebGLId createQueryEXT() { return 1; }
+    virtual void deleteQueryEXT(WebGLId) { }
+    virtual GC3Dboolean isQueryEXT(WebGLId) { return true; }
+    virtual void beginQueryEXT(GC3Denum, WebGLId) { }
+    virtual void endQueryEXT(GC3Denum) { }
+    virtual void getQueryivEXT(GC3Denum, GC3Denum, GC3Dint*) { }
+    virtual void getQueryObjectuivEXT(WebGLId, GC3Denum, GC3Duint*) { }
+
 protected:
     Attributes m_attrs;
 };