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

Unified Diff: third_party/WebKit/Source/core/paint/ObjectPaintProperties.h

Issue 2584653002: Force subtree paint property updates on local border box changes (Closed)
Patch Set: fix bugs Created 4 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 | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
index a85f4ab2df70505ba856ed0b085898c24b1dfa0d..0ebda5153a25a396b311c3b3191a6db8b06ee482 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
@@ -124,25 +124,51 @@ class CORE_EXPORT ObjectPaintProperties {
const PropertyTreeStateWithOffset* localBorderBoxProperties() const {
return m_localBorderBoxProperties.get();
}
- void updateLocalBorderBoxProperties(
+ // True if local border box changes, false otherwise.
+ bool updateLocalBorderBoxProperties(
LayoutPoint& paintOffset,
const TransformPaintPropertyNode* transform,
const ClipPaintPropertyNode* clip,
const EffectPaintPropertyNode* effect,
const ScrollPaintPropertyNode* scroll) {
- if (m_localBorderBoxProperties) {
+ if (!m_localBorderBoxProperties) {
+ m_localBorderBoxProperties = WTF::wrapUnique(
+ new ObjectPaintProperties::PropertyTreeStateWithOffset(
+ paintOffset, PropertyTreeState(transform, clip, effect, scroll)));
+ return true;
+ }
+ bool changed = false;
+ if (m_localBorderBoxProperties->paintOffset != paintOffset) {
m_localBorderBoxProperties->paintOffset = paintOffset;
+ changed = true;
+ }
+ const auto& borderBoxState = m_localBorderBoxProperties->propertyTreeState;
+ if (borderBoxState.transform() != transform) {
m_localBorderBoxProperties->propertyTreeState.setTransform(transform);
+ changed = true;
+ }
+ if (borderBoxState.clip() != clip) {
m_localBorderBoxProperties->propertyTreeState.setClip(clip);
+ changed = true;
+ }
+ if (borderBoxState.effect() != effect) {
m_localBorderBoxProperties->propertyTreeState.setEffect(effect);
+ changed = true;
+ }
+ if (borderBoxState.scroll() != scroll) {
m_localBorderBoxProperties->propertyTreeState.setScroll(scroll);
- } else {
- m_localBorderBoxProperties = WTF::wrapUnique(
- new ObjectPaintProperties::PropertyTreeStateWithOffset(
- paintOffset, PropertyTreeState(transform, clip, effect, scroll)));
+ changed = true;
}
+ return changed;
+ }
+ // True if an existing property was deleted, false otherwise.
+ bool clearLocalBorderBoxProperties() {
+ if (m_localBorderBoxProperties) {
+ m_localBorderBoxProperties = nullptr;
+ return true;
+ }
+ return false;
}
- void clearLocalBorderBoxProperties() { m_localBorderBoxProperties = nullptr; }
// This is the complete set of property nodes and paint offset that can be
// used to paint the contents of this object. It is similar to
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698