OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 , m_node(node) | 227 , m_node(node) |
228 , m_parent(nullptr) | 228 , m_parent(nullptr) |
229 , m_previous(nullptr) | 229 , m_previous(nullptr) |
230 , m_next(nullptr) | 230 , m_next(nullptr) |
231 #if ENABLE(ASSERT) | 231 #if ENABLE(ASSERT) |
232 , m_hasAXObject(false) | 232 , m_hasAXObject(false) |
233 , m_setNeedsLayoutForbidden(false) | 233 , m_setNeedsLayoutForbidden(false) |
234 #endif | 234 #endif |
235 , m_bitfields(node) | 235 , m_bitfields(node) |
236 { | 236 { |
237 // TODO(wangxianzhu): Move this into initialization list when we enable the
feature by default. | |
238 if (RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()) | |
239 m_previousPositionFromPaintInvalidationBacking = uninitializedPaintOffse
t(); | |
240 InstanceCounters::incrementCounter(InstanceCounters::LayoutObjectCounter); | 237 InstanceCounters::incrementCounter(InstanceCounters::LayoutObjectCounter); |
241 if (m_node) | 238 if (m_node) |
242 frameView()->incrementLayoutObjectCount(); | 239 frameView()->incrementLayoutObjectCount(); |
243 } | 240 } |
244 | 241 |
245 LayoutObject::~LayoutObject() | 242 LayoutObject::~LayoutObject() |
246 { | 243 { |
247 ASSERT(!m_hasAXObject); | 244 ASSERT(!m_hasAXObject); |
248 InstanceCounters::decrementCounter(InstanceCounters::LayoutObjectCounter); | 245 InstanceCounters::decrementCounter(InstanceCounters::LayoutObjectCounter); |
249 } | 246 } |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 return IntSize(); | 1117 return IntSize(); |
1121 } | 1118 } |
1122 | 1119 |
1123 LayoutRect LayoutObject::invalidatePaintRectangle(const LayoutRect& dirtyRect, D
isplayItemClient* displayItemClient) const | 1120 LayoutRect LayoutObject::invalidatePaintRectangle(const LayoutRect& dirtyRect, D
isplayItemClient* displayItemClient) const |
1124 { | 1121 { |
1125 return ObjectPaintInvalidator(*this).invalidatePaintRectangle(dirtyRect, dis
playItemClient); | 1122 return ObjectPaintInvalidator(*this).invalidatePaintRectangle(dirtyRect, dis
playItemClient); |
1126 } | 1123 } |
1127 | 1124 |
1128 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv
alidationState) | 1125 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv
alidationState) |
1129 { | 1126 { |
| 1127 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
1130 ensureIsReadyForPaintInvalidation(); | 1128 ensureIsReadyForPaintInvalidation(); |
1131 | 1129 |
1132 // If we didn't need paint invalidation then our children don't need as well
. | 1130 // If we didn't need paint invalidation then our children don't need as well
. |
1133 // Skip walking down the tree as everything should be fine below us. | 1131 // Skip walking down the tree as everything should be fine below us. |
1134 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) | 1132 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) |
1135 return; | 1133 return; |
1136 | 1134 |
1137 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); | 1135 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); |
1138 | 1136 |
1139 if (mayNeedPaintInvalidationSubtree()) | 1137 if (mayNeedPaintInvalidationSubtree()) |
1140 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); | 1138 newPaintInvalidationState.setForceSubtreeInvalidationCheckingWithinConta
iner(); |
1141 | 1139 |
1142 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); | 1140 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); |
1143 clearPaintInvalidationFlags(); | 1141 clearPaintInvalidationFlags(); |
1144 | 1142 |
1145 newPaintInvalidationState.updateForChildren(reason); | 1143 newPaintInvalidationState.updateForChildren(reason); |
1146 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 1144 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
1147 } | 1145 } |
1148 | 1146 |
1149 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) | 1147 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) |
1150 { | 1148 { |
| 1149 DCHECK(!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
| 1150 |
1151 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 1151 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
1152 // Column spanners are invalidated through their placeholders. | 1152 // Column spanners are invalidated through their placeholders. |
1153 // See LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfN
eeded(). | 1153 // See LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfN
eeded(). |
1154 if (child->isColumnSpanAll()) | 1154 if (child->isColumnSpanAll()) |
1155 continue; | 1155 continue; |
1156 child->invalidateTreeIfNeeded(childPaintInvalidationState); | 1156 child->invalidateTreeIfNeeded(childPaintInvalidationState); |
1157 } | 1157 } |
1158 } | 1158 } |
1159 | 1159 |
1160 LayoutRect LayoutObject::selectionRectInViewCoordinates() const | 1160 LayoutRect LayoutObject::selectionRectInViewCoordinates() const |
(...skipping 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3217 return; | 3217 return; |
3218 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed
Object); | 3218 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed
Object); |
3219 if (isBackgroundAttachmentFixedObject) | 3219 if (isBackgroundAttachmentFixedObject) |
3220 frameView()->addBackgroundAttachmentFixedObject(this); | 3220 frameView()->addBackgroundAttachmentFixedObject(this); |
3221 else | 3221 else |
3222 frameView()->removeBackgroundAttachmentFixedObject(this); | 3222 frameView()->removeBackgroundAttachmentFixedObject(this); |
3223 } | 3223 } |
3224 | 3224 |
3225 const ObjectPaintProperties* LayoutObject::objectPaintProperties() const | 3225 const ObjectPaintProperties* LayoutObject::objectPaintProperties() const |
3226 { | 3226 { |
3227 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3227 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
3228 return objectPaintPropertiesMap().get(this); | 3228 return objectPaintPropertiesMap().get(this); |
3229 } | 3229 } |
3230 | 3230 |
3231 ObjectPaintProperties& LayoutObject::ensureObjectPaintProperties() | 3231 ObjectPaintProperties& LayoutObject::ensureObjectPaintProperties() |
3232 { | 3232 { |
3233 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 3233 DCHECK(RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled()); |
3234 auto addResult = objectPaintPropertiesMap().add(this, nullptr); | 3234 auto addResult = objectPaintPropertiesMap().add(this, nullptr); |
3235 if (addResult.isNewEntry) | 3235 if (addResult.isNewEntry) |
3236 addResult.storedValue->value = ObjectPaintProperties::create(); | 3236 addResult.storedValue->value = ObjectPaintProperties::create(); |
3237 | 3237 |
3238 return *addResult.storedValue->value; | 3238 return *addResult.storedValue->value; |
3239 } | 3239 } |
3240 | 3240 |
3241 } // namespace blink | 3241 } // namespace blink |
3242 | 3242 |
3243 #ifndef NDEBUG | 3243 #ifndef NDEBUG |
(...skipping 25 matching lines...) Expand all Loading... |
3269 const blink::LayoutObject* root = object1; | 3269 const blink::LayoutObject* root = object1; |
3270 while (root->parent()) | 3270 while (root->parent()) |
3271 root = root->parent(); | 3271 root = root->parent(); |
3272 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3272 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3273 } else { | 3273 } else { |
3274 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3274 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3275 } | 3275 } |
3276 } | 3276 } |
3277 | 3277 |
3278 #endif | 3278 #endif |
OLD | NEW |