Looking at http://www.webkit.org/blog-files/leaves/ with the MiniBrowser (Qt, WK2), the leaves are missing the opacity fade out animation, making them disappear abruptly.
GTK has the same behavior.
Created attachment 137889 [details] Very compact version of falling leaves exposing the problem It seems that when rendering in layers having opacity, forcing the intermediate surface rendering to take place (in TextureMapperLayer::paintRecursive) - something goes wrong with either the transformation matrix, clipping, gl surface rendering or the like (I am still learning - so it might be obvious to others). The included example shows how only a *part* of the fading rectangle (id = "nodeContainer" in the example) is visible when opacity < 1. Digging further.
I'm pretty sure that the issue comes from the behavior of glClear, that is affected by glScissor.
Created attachment 139261 [details] Patch
Comment on attachment 139261 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=139261&action=review This looks good to me. I have one concern below. The fact that the clip stack is now duplicated between the BitmapTexture and the shared TextureMapperGL state (framebuffer for the entire scene), suggests to me that perhaps there could be an abstraction to encapsulate each framebuffer and its associated clip stack. There would be an instance for the entire scene and one for each BitmapTexture. > Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp:541 > + m_clipStack.clear(); > + m_clipStack.current().stencilIndex = 1; > + m_clipStack.current().scissorBox = IntRect(IntPoint::zero(), m_textureSize); > + m_clipStack.apply(); > + GL_CMD(glClearColor(0, 0, 0, 0)); > + GL_CMD(glClear(GL_COLOR_BUFFER_BIT)); Will this fail if TextureMapperGL::beginClip was never called from the WebKit layer? That's what enables the scissor test. Now you are removing the call to ::beginClip here and just applying the clip stack directly. It seems like you also need to enable the scissor test here as well. Perhaps that should just happen the first time you need to apply a scissorred clip. You might also need to somehow handle disabling the scissor test when rebinding TextureMapperGL's main framebuffer.
Created attachment 139285 [details] Patch
I've simplified things a bit, by making SCISSOR_TEST always be on, and sharing a bit more code inside ClipStack.
Created attachment 139289 [details] Patch
Comment on attachment 139289 [details] Patch Great!
Comment on attachment 139289 [details] Patch Clearing flags on attachment: 139289 Committed r115574: <http://trac.webkit.org/changeset/115574>
All reviewed patches have been landed. Closing bug.