Layout Test css3/filters/custom/custom-filter-animation.html is failing
authorachicu@adobe.com <achicu@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 23:16:35 +0000 (23:16 +0000)
committerachicu@adobe.com <achicu@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 23:16:35 +0000 (23:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=91769

Reviewed by Dean Jackson.

Source/WebCore:

Mountain Lion added support for accelerated filter animations, but CSS Shaders are still
rendered in software mode. The setFilters method is using PlatformCALayer::filtersCanBeComposited to check
if the filters can be handled in hardwawre, so I've reused that in the createFilterAnimationsFromKeyframes
to check if the animations can also run in hardware.

Also the GraphicsContext3D doesn't update its own internal m_boundFBO when a framebuffer is deleted,
so I've added that to the FECustomFilter. Otherwise, if the next framebuffer is created using the same
identifier, bindFramebuffer will just return without calling the glBindFramebuffer because of this optimization.

The documentation for glDeleteFramebuffer says that the bound framebuffer is unbound before deleting it.
This is not reproduceable from WebGL, because WebGLRenderingContext::deleteFramebuffer
already knows to unbind the framebuffer when needed. However, I'm also adding that in GraphicsContext3DOpenGLCommon.cpp
and efl/GraphicsContext3DPrivate.cpp, to make sure that m_boundFBO is not used for other purposes.

No new tests, this patch fixes a failing test.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes):
* platform/graphics/efl/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::deleteFramebuffer):
* platform/graphics/filters/FECustomFilter.cpp:
(WebCore::FECustomFilter::deleteRenderBuffers):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::deleteFramebuffer):

LayoutTests:

The test should be passing on Mountain Lion now, so I'm removing it from the list.

* platform/mac/TestExpectations:

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

LayoutTests/ChangeLog
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp
Source/WebCore/platform/graphics/filters/FECustomFilter.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp

index add7622..9ac2c53 100644 (file)
@@ -1,3 +1,14 @@
+2012-08-14  Alexandru Chiculita  <achicu@adobe.com>
+
+        Layout Test css3/filters/custom/custom-filter-animation.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=91769
+
+        Reviewed by Dean Jackson.
+
+        The test should be passing on Mountain Lion now, so I'm removing it from the list.
+
+        * platform/mac/TestExpectations:
+
 2012-08-14  Mike West  <mkwst@chromium.org>
 
         Tighten up parsing the 'script-nonce' CSP directive value.
index 43135c8..eab4e26 100644 (file)
@@ -337,9 +337,6 @@ BUGWK91505 : platform/mac/plugins/root-object-premature-delete-crash.html = CRAS
 // [Mac] REGRESSION (r122651): fast/text/descent-clip-in-scaled-page.html fails
 BUGWK91552 : fast/text/descent-clip-in-scaled-page.html = IMAGE
 
-// Layout Test css3/filters/custom/custom-filter-animation.html is failing
-BUGWK84813 : css3/filters/custom/custom-filter-animation.html = TEXT
-
 // Needs rebaseline after https://bugs.webkit.org/show_bug.cig?id=91969
 BUGWK91969 : fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html = TEXT
 BUGWK91969 : fast/dom/HTMLProgressElement/progress-writing-mode.html = TEXT
index 5940659..b51c5b3 100644 (file)
@@ -1,3 +1,35 @@
+2012-08-14  Alexandru Chiculita  <achicu@adobe.com>
+
+        Layout Test css3/filters/custom/custom-filter-animation.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=91769
+
+        Reviewed by Dean Jackson.
+
+        Mountain Lion added support for accelerated filter animations, but CSS Shaders are still
+        rendered in software mode. The setFilters method is using PlatformCALayer::filtersCanBeComposited to check
+        if the filters can be handled in hardwawre, so I've reused that in the createFilterAnimationsFromKeyframes
+        to check if the animations can also run in hardware.
+
+        Also the GraphicsContext3D doesn't update its own internal m_boundFBO when a framebuffer is deleted,
+        so I've added that to the FECustomFilter. Otherwise, if the next framebuffer is created using the same
+        identifier, bindFramebuffer will just return without calling the glBindFramebuffer because of this optimization.
+
+        The documentation for glDeleteFramebuffer says that the bound framebuffer is unbound before deleting it.
+        This is not reproduceable from WebGL, because WebGLRenderingContext::deleteFramebuffer
+        already knows to unbind the framebuffer when needed. However, I'm also adding that in GraphicsContext3DOpenGLCommon.cpp
+        and efl/GraphicsContext3DPrivate.cpp, to make sure that m_boundFBO is not used for other purposes.
+
+        No new tests, this patch fixes a failing test.
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes):
+        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
+        (WebCore::GraphicsContext3DPrivate::deleteFramebuffer):
+        * platform/graphics/filters/FECustomFilter.cpp:
+        (WebCore::FECustomFilter::deleteRenderBuffers):
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        (WebCore::GraphicsContext3D::deleteFramebuffer):
+
 2012-08-14  Adam Barth  <abarth@webkit.org>
 
         Delete Frame::domWindow() and Frame::existingDOMWindow()
index e3a565d..dcdb586 100644 (file)
@@ -1957,6 +1957,10 @@ bool GraphicsLayerCA::createFilterAnimationsFromKeyframes(const KeyframeValueLis
         return false;
         
     const FilterOperations* operations = static_cast<const FilterAnimationValue*>(valueList.at(listIndex))->value();
+    // Make sure the platform layer didn't fallback to using software filter compositing instead.
+    if (!PlatformCALayer::filtersCanBeComposited(*operations))
+        return false;
+
     int numAnimations = operations->size();
 
     // FIXME: We can't currently hardware animate shadows.
index 345507f..78e6fb1 100644 (file)
@@ -1081,6 +1081,11 @@ void GraphicsContext3DPrivate::deleteBuffer(Platform3DObject buffer)
 void GraphicsContext3DPrivate::deleteFramebuffer(Platform3DObject framebuffer)
 {
     makeContextCurrent();
+    if (framebuffer == m_boundFBO) {
+        // Make sure the framebuffer is not going to be used for drawing
+        // operations after it gets deleted.
+        bindFramebuffer(FRAMEBUFFER, 0);
+    }
     m_api->glDeleteFramebuffers(1, &framebuffer);
 }
 
index 39fa831..a2ece05 100644 (file)
@@ -108,6 +108,9 @@ void FECustomFilter::deleteRenderBuffers()
         return;
     m_context->makeContextCurrent();
     if (m_frameBuffer) {
+        // Make sure to unbind any framebuffer from the context first, otherwise
+        // some platforms might refuse to bind the same buffer id again.
+        m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0);
         m_context->deleteFramebuffer(m_frameBuffer);
         m_frameBuffer = 0;
     }
index 1a0a262..e0c2d6e 100644 (file)
@@ -1322,6 +1322,11 @@ void GraphicsContext3D::deleteBuffer(Platform3DObject buffer)
 void GraphicsContext3D::deleteFramebuffer(Platform3DObject framebuffer)
 {
     makeContextCurrent();
+    if (framebuffer == m_boundFBO) {
+        // Make sure the framebuffer is not going to be used for drawing
+        // operations after it gets deleted.
+        bindFramebuffer(FRAMEBUFFER, 0);
+    }
     glDeleteFramebuffersEXT(1, &framebuffer);
 }