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

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: fix rebase error. 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d54240953a41d9654d01dadb43402f3721bc3ebc..61151db94f3a35cfa29ca5a83bcc15397100f908 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -974,18 +974,36 @@ 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::incrementCompositorProxiedProperties(uint32_t mutableProperties)
+{
+ ElementRareData& rareData = ensureElementRareData();
+ if (!rareData.proxiedPropertyCounts())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy));
+ rareData.incrementCompositorProxiedProperties(mutableProperties);
}
-void Element::decrementProxyCount()
+void Element::decrementCompositorProxiedProperties(uint32_t mutableProperties)
{
- if (ensureElementRareData().decrementProxyCount() == 0)
+ ElementRareData& rareData = *elementRareData();
+ rareData.decrementCompositorProxiedProperties(mutableProperties);
+ if (!rareData.proxiedPropertyCounts())
setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::CompositorProxy));
}
+uint32_t Element::compositorMutableProperties() const
+{
+ if (!hasRareData())
+ return WebCompositorMutablePropertyNone;
+ if (CompositorProxiedPropertySet* set = elementRareData()->proxiedPropertyCounts())
+ return set->proxiedProperties();
+ return WebCompositorMutablePropertyNone;
+}
+
bool Element::hasNonEmptyLayoutSize() const
{
document().updateLayoutIgnorePendingStylesheets();
@@ -1687,9 +1705,6 @@ PassRefPtr<ComputedStyle> Element::styleForLayoutObject()
style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTransform));
}
- if (hasRareData() && elementRareData()->proxyCount() > 0)
- style->setHasCompositorProxy(true);
-
document().didRecalculateStyleForElement();
return style.release();
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698