[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>
Wed, 21 Mar 2012 20:08:49 +0000 (20:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Mar 2012 20:08:49 +0000 (20:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80988

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

Source/Platform:

Add EXT_occlusion_query API to WebGraphicsContext3D.

* chromium/public/WebGraphicsContext3D.h:
(WebGraphicsContext3D):
(WebKit::WebGraphicsContext3D::createQueryEXT):
(WebKit::WebGraphicsContext3D::deleteQueryEXT):
(WebKit::WebGraphicsContext3D::isQueryEXT):
(WebKit::WebGraphicsContext3D::beginQueryEXT):
(WebKit::WebGraphicsContext3D::endQueryEXT):
(WebKit::WebGraphicsContext3D::getQueryivEXT):
(WebKit::WebGraphicsContext3D::getQueryObjectuivEXT):

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@111597 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 7f42e44840e46844da6d846b496a82b333cb7753..27d38e2e251d92029b5fdea03e2f481b29d0a91a 100644 (file)
@@ -1,3 +1,22 @@
+2012-03-21  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):
+        (WebKit::WebGraphicsContext3D::createQueryEXT):
+        (WebKit::WebGraphicsContext3D::deleteQueryEXT):
+        (WebKit::WebGraphicsContext3D::isQueryEXT):
+        (WebKit::WebGraphicsContext3D::beginQueryEXT):
+        (WebKit::WebGraphicsContext3D::endQueryEXT):
+        (WebKit::WebGraphicsContext3D::getQueryivEXT):
+        (WebKit::WebGraphicsContext3D::getQueryObjectuivEXT):
+
 2012-03-19  Michal Mocny  <mmocny@google.com>
 
         [chromium] Adding support for GL_EXT_discard_framebuffer.
index 2acd620a1d3c4cb8ed25356623f0024f33b97c60..beed9e585fb662c3a334752da0c3210ce13d5409 100644 (file)
@@ -407,6 +407,14 @@ public:
     virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint internalformat,
                                  WGC3Dint width, WGC3Dint height) { }
 
+    // GL_EXT_occlusion_query
+    virtual WebGLId createQueryEXT() { return 0; }
+    virtual void deleteQueryEXT(WebGLId query) { }
+    virtual WGC3Dboolean isQueryEXT(WebGLId query) { return false; }
+    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) { }
 
 #if WEBKIT_USING_SKIA
     GrGLInterface* createGrGLInterface();
index 9098cfa2da6ba0e1007158c15540b42c0511a96d..b68cb081625f8ebe0d391bfb8ae3d0082fc3e4a4 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-21  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-21  Tony Chang  <tony@chromium.org>
 
         compute the sign of flexibility for new flexbox
index 66200c1633f430d353c7bf227f886c38f098da0a..92821360baa96d492bdafa7f2ecd575183d8e953 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
@@ -135,6 +147,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 4b38196f26f869e203dc063331ef2e8053a43734..ab9cf5ffbcf38bd72dca5ed6073d564f85bfa196 100644 (file)
@@ -1,3 +1,35 @@
+2012-03-21  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-21  Tommy Widenflycht  <tommyw@google.com>
 
         [chromium] MediaStream API (JSEP): Enhancing WebMediaHints and WebICEOptions
index 4a6251e9fd2edf4aa908f43abeaf6c2e5ef2eeb5..84ad0f78a323c7eed44ec010c5d0eb0a52e89e54 100644 (file)
@@ -170,6 +170,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 ba659c291413a9520beab4d3e6147b6e7d969054..3f76630b73954b9da8effc7be3edf6d6f30c667b 100644 (file)
@@ -892,6 +892,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 6f08095df6ed730b4f0f6a6ac38c61472d209845..52e9807652442e26a7af1a299dff75bcc01e2650 100644 (file)
@@ -311,6 +311,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 805824b24d5e0404f487a88f6cbca7cfd76e45c7..966f14214fb321cede4385a011085ffa84495836 100644 (file)
@@ -258,6 +258,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;
 };