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

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

Issue 2538273002: Use a create-or-update pattern for faster local border box property updates (Closed)
Patch Set: 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 cd4e15aebdc9120826e7be08d13577e73a36377e..20e954906b13cfcedeb04616962ffe5eff21496e 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
@@ -124,9 +124,23 @@ class CORE_EXPORT ObjectPaintProperties {
const PropertyTreeStateWithOffset* localBorderBoxProperties() const {
return m_localBorderBoxProperties.get();
}
- void setLocalBorderBoxProperties(
- std::unique_ptr<PropertyTreeStateWithOffset> properties) {
- m_localBorderBoxProperties = std::move(properties);
+ void updateLocalBorderBoxProperties(
+ LayoutPoint& paintOffset,
+ const TransformPaintPropertyNode* transform,
+ const ClipPaintPropertyNode* clip,
+ const EffectPaintPropertyNode* effect,
+ const ScrollPaintPropertyNode* scroll) {
+ if (m_localBorderBoxProperties) {
+ m_localBorderBoxProperties->paintOffset = paintOffset;
+ m_localBorderBoxProperties->propertyTreeState.setTransform(transform);
+ m_localBorderBoxProperties->propertyTreeState.setClip(clip);
+ m_localBorderBoxProperties->propertyTreeState.setEffect(effect);
+ m_localBorderBoxProperties->propertyTreeState.setScroll(scroll);
+ } else {
+ m_localBorderBoxProperties =
+ wrapUnique(new ObjectPaintProperties::PropertyTreeStateWithOffset(
+ paintOffset, PropertyTreeState(transform, clip, effect, scroll)));
+ }
}
// This is the complete set of property nodes and paint offset that can be
« 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