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

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: s/WebMutable/WebCompositorMutable/g Created 5 years, 1 month 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 2351061beffa6fe31b4f88515be7642791eec300..fe161c8e022bbab6367c99ef43fa88e1ea10090e 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();
+ ensureElementRareData().incrementProxiedPropertyCounts(mutableProperties);
+ if (!hadProxy && hasCompositorProxy())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy));
chrishtr 2015/11/24 16:22:50 Incrementing a count can cause a style recalc? Tha
Ian Vollick 2015/11/25 18:28:45 Yes, it's like saying that you "will change" a pro
}
-void Element::decrementProxyCount()
+void Element::decrementProxiedPropertyCounts(uint32_t mutableProperties)
{
- if (ensureElementRareData().decrementProxyCount() == 0)
+ ASSERT(hasRareData());
+ const bool hadProxy = hasCompositorProxy();
+ elementRareData()->decrementProxiedPropertyCounts(mutableProperties);
+ if (hadProxy && !hasCompositorProxy())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy));
}
+uint32_t Element::mutableProperties() 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