WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Not for review: reimplemented isolation with logic added in RenderLayerCompositor
isolationRLCProto.patch (text/plain), 9.19 KB, created by
Mihai Tica
on 2014-02-28 06:45:42 PST
(
hide
)
Description:
Not for review: reimplemented isolation with logic added in RenderLayerCompositor
Filename:
MIME Type:
Creator:
Mihai Tica
Created:
2014-02-28 06:45:42 PST
Size:
9.19 KB
patch
obsolete
>diff --git a/LayoutTests/css3/compositing/blend-mode-body-background.html b/LayoutTests/css3/compositing/blend-mode-body-background.html >new file mode 100644 >index 0000000..31ec266 >--- /dev/null >+++ b/LayoutTests/css3/compositing/blend-mode-body-background.html >@@ -0,0 +1,18 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<style> >+ div { >+ margin: 20px; >+ width: 60px; >+ height: 60px; >+ -webkit-mix-blend-mode: difference; >+ background: red; >+ } >+ body { >+ background: blue; >+ } >+</style> >+<body> >+ <div class="parent"></div> >+</body> >diff --git a/LayoutTests/fast/repaint/blend-mode-isolate-stacking-context.html b/LayoutTests/fast/repaint/blend-mode-isolate-stacking-context.html >new file mode 100644 >index 0000000..ffb7126 >--- /dev/null >+++ b/LayoutTests/fast/repaint/blend-mode-isolate-stacking-context.html >@@ -0,0 +1,101 @@ >+<!DOCTYPE HTML> >+<html> >+<head> >+<style> >+ div { >+ margin: 20px; >+ width: 60px; >+ height: 60px; >+ } >+ >+ .container { >+ border-width: 1px; >+ border-style: dashed; >+ width: 700px; >+ height: 120px; >+ } >+ >+ .parent { >+ background: #0F0; >+ } >+ >+ .child { >+ background: #00F; >+ } >+ >+ .stacking { >+ position: relative; >+ z-index: 0; >+ } >+ >+ .stacking2 { >+ opacity: 0.99; >+ } >+ >+ .blender { >+ -webkit-mix-blend-mode: difference; >+ } >+ >+ .blender2 { >+ -webkit-mix-blend-mode: screen; >+ } >+</style> >+<script src="resources/text-based-repaint.js" type="text/javascript"></script> >+<!-- Repaint test to ensure that setting a blend mode dynamically triggers this operation >+ only with the contents of the nearest ancestor stacking context. --> >+<body onload="runRepaintTest()"> >+ <div class="container"> >+ <p>Test if setting blend mode creates isolation.</p> >+ <div class="parent stacking"> >+ <div id="first" class="child"></div> >+ </div> >+ </div> >+ >+ <div class="container"> >+ <p>Test if unsetting blend mode removes isolation.</p> >+ <div class="parent stacking"> >+ <div id="second" class="child blender"></div> >+ </div> >+ </div> >+ >+ <div class="container"> >+ <p>FAIL: Test if setting a parent's stacking context correctly creates isolation. Fix <a href="https://bugs.webkit.org/show_bug.cgi?id=129480">this</a> to make it work.</p> >+ <div id="third" class="parent"> >+ <div class="child blender"></div> >+ </div> >+ </div> >+ >+ <div class="container"> >+ <p>Test if unsetting a parent's stacking context correctly removes isolation.</p> >+ <div id="fourth" class="parent stacking"> >+ <div class="child blender"></div> >+ </div> >+ </div> >+ >+ <div class="container"> >+ <p>Test if switching a blend mode preserves isolation.</p> >+ <div class="parent stacking"> >+ <div id="fifth" class="child blender"></div> >+ </div> >+ </div> >+ >+ <div class="container"> >+ <p>Test if switching the property that causes the parent to create a stacking context preserves isolation.</p> >+ <div id="sixth" class="parent stacking"> >+ <div class="child blender"></div> >+ </div> >+ </div> >+ <script> >+ function repaintTest() { >+ document.getElementById('first').className = "child blender"; >+ document.getElementById('second').className = "child"; >+ >+ document.getElementById('third').className = "parent stacking"; >+ document.getElementById('fourth').className = "parent"; >+ >+ document.getElementById('fifth').className = "child blender2"; >+ >+ document.getElementById('sixth').className = "parent stacking2"; >+ } >+ </script> >+</body> >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index 91a90eb..3f7cab0 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -186,7 +186,6 @@ RenderLayer::RenderLayer(RenderLayerModelObject& rendererLayerModelObject) > #if ENABLE(CSS_COMPOSITING) > , m_blendMode(BlendModeNormal) > , m_isolatesBlending(false) >- , m_updateParentStackingContextShouldIsolateBlendingDirty(false) > #endif > , m_renderer(rendererLayerModelObject) > , m_parent(0) >@@ -803,13 +802,8 @@ void RenderLayer::positionNewlyCreatedOverflowControls() > > #if ENABLE(CSS_COMPOSITING) > >-void RenderLayer::updateBlendMode(const RenderStyle* oldStyle) >+void RenderLayer::updateBlendMode() > { >- m_updateParentStackingContextShouldIsolateBlendingDirty = false; >- >- if ((!oldStyle && renderer().style().hasBlendMode()) || (oldStyle && oldStyle->hasBlendMode() != renderer().style().hasBlendMode())) >- m_updateParentStackingContextShouldIsolateBlendingDirty = true; >- > BlendMode newBlendMode = renderer().style().blendMode(); > if (newBlendMode != m_blendMode) { > m_blendMode = newBlendMode; >@@ -818,24 +812,17 @@ void RenderLayer::updateBlendMode(const RenderStyle* oldStyle) > } > } > >-void RenderLayer::updateParentStackingContextShouldIsolateBlending() >+void RenderLayer::updateAncestorStackingContextIsolatesBlending() > { >- if (!m_updateParentStackingContextShouldIsolateBlendingDirty) >+ if (!hasBlendMode()) > return; > >- if (isComposited()) { >- m_updateParentStackingContextShouldIsolateBlendingDirty = false; >- return; >- } >- >- for (auto ancestor = parent(); ancestor && !ancestor->isComposited() && !ancestor->isRootLayer(); ancestor = ancestor->parent()) { >+ for (auto ancestor = parent(); ancestor && !ancestor->isComposited() && !ancestor->renderer().isRoot(); ancestor = ancestor->parent()) { > if (ancestor->isStackingContext()) { >- ancestor->m_isolatesBlending = renderer().style().hasBlendMode(); >- break; >+ ancestor->m_isolatesBlending = true; >+ return; > } > } >- >- m_updateParentStackingContextShouldIsolateBlendingDirty = false; > } > > #endif >@@ -6542,7 +6529,7 @@ void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle > updateDescendantDependentFlags(); > updateTransform(); > #if ENABLE(CSS_COMPOSITING) >- updateBlendMode(oldStyle); >+ updateBlendMode(); > #endif > #if ENABLE(CSS_FILTERS) > updateOrRemoveFilterClients(); >diff --git a/Source/WebCore/rendering/RenderLayer.h b/Source/WebCore/rendering/RenderLayer.h >index 1a14b28..5419791 100644 >--- a/Source/WebCore/rendering/RenderLayer.h >+++ b/Source/WebCore/rendering/RenderLayer.h >@@ -503,7 +503,7 @@ public: > void updateTransform(); > > #if ENABLE(CSS_COMPOSITING) >- void updateBlendMode(const RenderStyle*); >+ void updateBlendMode(); > void updateParentStackingContextShouldIsolateBlending(); > #endif > >@@ -794,6 +794,19 @@ public: > #endif > } > >+ void setIsolatesBlending(bool isolatesBlending) >+ { >+#if ENABLE(CSS_COMPOSITING) >+ m_isolatesBlending = isolatesBlending; >+#else >+ UNUSED_PARAM(isolatesBlending); >+#endif >+ } >+ >+#if ENABLE(CSS_COMPOSITING) >+ void updateAncestorStackingContextIsolatesBlending(); >+#endif >+ > bool isComposited() const { return m_backing != 0; } > bool hasCompositingDescendant() const { return m_hasCompositingDescendant; } > bool hasCompositedMask() const; >@@ -1245,7 +1258,6 @@ private: > #if ENABLE(CSS_COMPOSITING) > BlendMode m_blendMode : 5; > bool m_isolatesBlending : 1; >- bool m_updateParentStackingContextShouldIsolateBlendingDirty : 1; > #endif > > RenderLayerModelObject& m_renderer; >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index feba842..f777e7e 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -1047,10 +1047,6 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor > layer.updateDescendantDependentFlags(); > layer.updateLayerListsIfNeeded(); > >-#if ENABLE(CSS_COMPOSITING) >- layer.updateParentStackingContextShouldIsolateBlending(); >-#endif >- > if (layer.isFlowThreadCollectingGraphicsLayersUnderRegions()) { > RenderFlowThread& flowThread = toRenderFlowThread(layer.renderer()); > layer.setHasCompositingDescendant(flowThread.hasCompositingRegionDescendant()); >@@ -1068,6 +1064,7 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor > > // Clear the flag > layer.setHasCompositingDescendant(false); >+ layer.setIsolatesBlending(false); > > RenderLayer::IndirectCompositingReason compositingReason = compositingState.m_subtreeIsCompositing ? RenderLayer::IndirectCompositingForStacking : RenderLayer::NoIndirectCompositingReason; > >@@ -1188,6 +1185,10 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor > if (childState.m_subtreeHasBlending || layer.hasBlendMode()) > compositingState.m_subtreeHasBlending = true; > >+#if ENABLE(CSS_COMPOSITING) >+ layer.updateAncestorStackingContextIsolatesBlending(); >+#endif >+ > // Now check for reasons to become composited that depend on the state of descendant layers. > RenderLayer::IndirectCompositingReason indirectCompositingReason; > if (!willBeComposited && canBeComposited(layer)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 129307
:
225147
|
225457
|
226015
|
226033
|
226124
|
227071
|
227167