[chromium] Adding support for GL_EXT_discard_framebuffer.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 02:25:55 +0000 (02:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Mar 2012 02:25:55 +0000 (02:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81383

Patch by Michal Mocny <mmocny@google.com> on 2012-03-19
Reviewed by James Robinson.

Source/Platform:

* chromium/public/WebGraphicsContext3D.h:
(WebGraphicsContext3D):
(WebKit::WebGraphicsContext3D::discardFramebufferEXT):
(WebKit::WebGraphicsContext3D::ensureFramebufferCHROMIUM):

Source/WebCore:

* platform/graphics/chromium/Extensions3DChromium.h:

Source/WebKit/chromium:

* src/Extensions3DChromium.cpp:
(WebCore::Extensions3DChromium::discardFramebufferEXT):
(WebCore):
(WebCore::Extensions3DChromium::ensureFramebufferCHROMIUM):
* src/GraphicsContext3DChromium.cpp:
(WebCore):
* src/GraphicsContext3DPrivate.h:
(GraphicsContext3DPrivate):
* tests/FakeWebGraphicsContext3D.h:
(WebKit::FakeWebGraphicsContext3D::discardFramebufferEXT):
(WebKit::FakeWebGraphicsContext3D::ensureFramebufferCHROMIUM):
(FakeWebGraphicsContext3D):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111312 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 7a76083cf19661cae3be9fa72b193c7ba451f3e4..7f42e44840e46844da6d846b496a82b333cb7753 100644 (file)
@@ -1,3 +1,15 @@
+2012-03-19  Michal Mocny  <mmocny@google.com>
+
+        [chromium] Adding support for GL_EXT_discard_framebuffer.
+        https://bugs.webkit.org/show_bug.cgi?id=81383
+
+        Reviewed by James Robinson.
+
+        * chromium/public/WebGraphicsContext3D.h:
+        (WebGraphicsContext3D):
+        (WebKit::WebGraphicsContext3D::discardFramebufferEXT):
+        (WebKit::WebGraphicsContext3D::ensureFramebufferCHROMIUM):
+
 2012-03-19  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r111207.
index f16447d67d0bcdfc93c6183a79763b6279458052..2acd620a1d3c4cb8ed25356623f0024f33b97c60 100644 (file)
@@ -160,6 +160,11 @@ public:
     // GL_CHROMIUM_gpu_memory_manager - sets callback to observe changes to memory allocation limits.
     virtual void setMemoryAllocationChangedCallbackCHROMIUM(WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback) { }
 
+    // GL_EXT_discard_framebuffer - discard/ensure existance of surface backbuffer.
+    // FIXME: make these pure virtual once they are implemented by clients.
+    virtual void discardFramebufferEXT(WGC3Denum target, WGC3Dsizei numAttachments, const WGC3Denum* attachments) { }
+    virtual void ensureFramebufferCHROMIUM() { }
+
     // Query whether it is built on top of compliant GLES2 implementation.
     virtual bool isGLES2Compliant() = 0;
 
index 4df78f7227364cede2fd1b88691c7dece9e21fd0..ef499e8a1a4671e89acaa0f74fab0b71fb6993cd 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-19  Michal Mocny  <mmocny@google.com>
+
+        [chromium] Adding support for GL_EXT_discard_framebuffer.
+        https://bugs.webkit.org/show_bug.cgi?id=81383
+
+        Reviewed by James Robinson.
+
+        * platform/graphics/chromium/Extensions3DChromium.h:
+
 2012-03-19  Adam Klein  <adamk@chromium.org>
 
         Refactor ContainerNode::replaceChild to match other mutation methods and share code
index 6549597aad5548352f6e20aa6eba6972bc88fcb7..66200c1633f430d353c7bf227f886c38f098da0a 100644 (file)
@@ -90,6 +90,10 @@ public:
     // GL_CHROMIUM_set_visibility
     void setVisibilityCHROMIUM(bool);
 
+    // GL_EXT_discard_framebuffer
+    virtual void discardFramebufferEXT(GC3Denum target, GC3Dsizei numAttachments, const GC3Denum* attachments);
+    virtual void ensureFramebufferCHROMIUM();
+
     // GL_CHROMIUM_gpu_memory_manager
     struct GpuMemoryAllocationCHROMIUM {
         size_t gpuResourceSizeInBytes;
index ebd465474edc53f3a37333469e90685cb9a1a922..28ec011f900e6fcf35e65b83f38cef8dab4010f1 100644 (file)
@@ -1,3 +1,23 @@
+2012-03-19  Michal Mocny  <mmocny@google.com>
+
+        [chromium] Adding support for GL_EXT_discard_framebuffer.
+        https://bugs.webkit.org/show_bug.cgi?id=81383
+
+        Reviewed by James Robinson.
+
+        * src/Extensions3DChromium.cpp:
+        (WebCore::Extensions3DChromium::discardFramebufferEXT):
+        (WebCore):
+        (WebCore::Extensions3DChromium::ensureFramebufferCHROMIUM):
+        * src/GraphicsContext3DChromium.cpp:
+        (WebCore):
+        * src/GraphicsContext3DPrivate.h:
+        (GraphicsContext3DPrivate):
+        * tests/FakeWebGraphicsContext3D.h:
+        (WebKit::FakeWebGraphicsContext3D::discardFramebufferEXT):
+        (WebKit::FakeWebGraphicsContext3D::ensureFramebufferCHROMIUM):
+        (FakeWebGraphicsContext3D):
+
 2012-03-19  Ian Vollick  <vollick@chromium.org>
 
         [chromium] Times in the cc should be expressed in seconds.
index 73397bd2b16a7cccfa182ba12768da0c7a5876db..4a6251e9fd2edf4aa908f43abeaf6c2e5ef2eeb5 100644 (file)
@@ -107,6 +107,16 @@ void Extensions3DChromium::setVisibilityCHROMIUM(bool visibility)
     m_private->setVisibilityCHROMIUM(visibility);
 }
 
+void Extensions3DChromium::discardFramebufferEXT(GC3Denum target, GC3Dsizei numAttachments, const GC3Denum* attachments)
+{
+    m_private->discardFramebufferEXT(target, numAttachments, attachments);
+}
+
+void Extensions3DChromium::ensureFramebufferCHROMIUM()
+{
+    m_private->ensureFramebufferCHROMIUM();
+}
+
 void Extensions3DChromium::setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<GpuMemoryAllocationChangedCallbackCHROMIUM> callback)
 {
     m_private->setGpuMemoryAllocationChangedCallbackCHROMIUM(callback);
index 02c783e713f2c493d3b7a8883c4faa234c21c02e..ba659c291413a9520beab4d3e6147b6e7d969054 100644 (file)
@@ -879,6 +879,9 @@ DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*)
 
 DELEGATE_TO_IMPL_1(setVisibilityCHROMIUM, bool);
 
+DELEGATE_TO_IMPL_3(discardFramebufferEXT, GC3Denum, GC3Dsizei, const GC3Denum*);
+DELEGATE_TO_IMPL(ensureFramebufferCHROMIUM);
+
 DELEGATE_TO_IMPL_10(blitFramebufferCHROMIUM, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dbitfield, GC3Denum)
 DELEGATE_TO_IMPL_5(renderbufferStorageMultisampleCHROMIUM, GC3Denum, GC3Dsizei, GC3Denum, GC3Dsizei, GC3Dsizei)
 
index be9db4287db6efa3285fccb854fea3483ad15b6c..fe0aa83fb4a4a2865228a9531c06daf16e7cfce2 100644 (file)
@@ -282,6 +282,10 @@ public:
     // GL_CHROMIUM_set_visibility
     void setVisibilityCHROMIUM(bool);
 
+    // GL_EXT_discard_framebuffer
+    virtual void discardFramebufferEXT(GC3Denum target, GC3Dsizei numAttachments, const GC3Denum* attachments);
+    virtual void ensureFramebufferCHROMIUM();
+
     // GL_CHROMIUM_gpu_memory_manager
     void setGpuMemoryAllocationChangedCallbackCHROMIUM(PassOwnPtr<Extensions3DChromium::GpuMemoryAllocationChangedCallbackCHROMIUM>);
 
index 268dc1da35dba3535544e09381ca507d34cc8073..805824b24d5e0404f487a88f6cbca7cfd76e45c7 100644 (file)
@@ -63,6 +63,9 @@ public:
 
     virtual void setVisibilityCHROMIUM(bool visible) { }
 
+    virtual void discardFramebufferEXT(WGC3Denum target, WGC3Dsizei numAttachments, const WGC3Denum* attachments) { }
+    virtual void ensureFramebufferCHROMIUM() { }
+
     virtual void setMemoryAllocationChangedCallbackCHROMIUM(WebGraphicsMemoryAllocationChangedCallbackCHROMIUM* callback) { }
 
     virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); }