Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(702)

Unified Diff: Source/core/dom/Element.cpp

Issue 1060973003: compositor-worker: Force elements to grow a layer when a CompositorProxy is created. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tot-merge Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html ('k') | Source/core/dom/StyleChangeReason.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 6712b26eaea464b181676f95364932ab4253517e..cfebcb0116abd5dd312801a01d6f3143d65dfd16 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -951,12 +951,14 @@ void Element::scrollFrameTo(const ScrollToOptions& scrollToOptions)
void Element::incrementProxyCount()
{
- ensureElementRareData().incrementProxyCount();
+ if (ensureElementRareData().incrementProxyCount() == 1)
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy));
}
void Element::decrementProxyCount()
{
- ensureElementRareData().decrementProxyCount();
+ if (ensureElementRareData().decrementProxyCount() == 0)
+ setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy));
}
IntRect Element::boundsInViewportSpace()
@@ -1651,6 +1653,9 @@ PassRefPtr<ComputedStyle> Element::styleForLayoutObject()
style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTransform) || inlineStyle->hasProperty(CSSPropertyWebkitTransform));
}
+ if (hasRareData() && elementRareData()->proxyCount() > 0)
+ style->setHasCompositorProxy(true);
+
document().didRecalculateStyleForElement();
return style.release();
}
« no previous file with comments | « LayoutTests/fast/dom/CompositorProxy/proxy-forces-layer.html ('k') | Source/core/dom/StyleChangeReason.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698