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

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

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index e785c06dfc53d2423487e8af18cf389fe9095aa8..b59d331fb942ba28d352a9bbbaa911b6d3c9b93b 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -973,18 +973,35 @@ void Element::scrollFrameTo(const ScrollToOptions& scrollToOptions)
viewport->setScrollPosition(DoublePoint(scaledLeft, scaledTop), ProgrammaticScroll, scrollBehavior);
}
-void Element::incrementProxyCount()
+bool Element::hasCompositorProxy() const
{
- if (ensureElementRareData().incrementProxyCount() == 1)
+ return hasRareData() && elementRareData()->proxiedPropertyCounts();
+}
+
+void Element::incrementProxiedPropertyCounts(uint32_t mutableProperties)
+{
+ const bool hadProxy = hasCompositorProxy();
esprehn 2015/12/02 03:28:49 no const on local primitive values
Ian Vollick 2015/12/03 17:54:43 Done.
+ ensureElementRareData().incrementProxiedPropertyCounts(mutableProperties);
esprehn 2015/12/02 03:28:48 you'd normally write this the other way, you'd wri
Ian Vollick 2015/12/03 17:54:43 That looks much better. Done.
+ if (!hadProxy && hasCompositorProxy())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy));
}
-void Element::decrementProxyCount()
+void Element::decrementProxiedPropertyCounts(uint32_t mutableProperties)
{
- if (ensureElementRareData().decrementProxyCount() == 0)
+ ASSERT(hasRareData());
+ const bool hadProxy = hasCompositorProxy();
esprehn 2015/12/02 03:28:49 remove const, but if you're decrementing you must
Ian Vollick 2015/12/03 17:54:43 Done.
+ elementRareData()->decrementProxiedPropertyCounts(mutableProperties);
+ if (hadProxy && !hasCompositorProxy())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy));
}
+uint32_t Element::compositorMutableProperties() const
+{
+ if (!hasCompositorProxy())
+ return WebCompositorMutablePropertyNone;
+ return elementRareData()->proxiedPropertyCounts()->proxiedProperties();
+}
+
bool Element::hasNonEmptyLayoutSize() const
{
document().updateLayoutIgnorePendingStylesheets();
@@ -1686,9 +1703,6 @@ PassRefPtr<ComputedStyle> Element::styleForLayoutObject()
style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTransform));
}
- if (hasRareData() && elementRareData()->proxyCount() > 0)
- style->setHasCompositorProxy(true);
-
document().didRecalculateStyleForElement();
return style.release();
}

Powered by Google App Engine
This is Rietveld 408576698