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 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 | 1196 |
1197 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv
alidationState) | 1197 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv
alidationState) |
1198 { | 1198 { |
1199 ASSERT(!needsLayout()); | 1199 ASSERT(!needsLayout()); |
1200 | 1200 |
1201 // If we didn't need paint invalidation then our children don't need as well
. | 1201 // If we didn't need paint invalidation then our children don't need as well
. |
1202 // Skip walking down the tree as everything should be fine below us. | 1202 // Skip walking down the tree as everything should be fine below us. |
1203 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) | 1203 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) |
1204 return; | 1204 return; |
1205 | 1205 |
1206 PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationSt
ate, paintInvalidationState.paintInvalidationContainer()); | 1206 invalidatePaintIfNeeded(paintInvalidationState, paintInvalidationState.paint
InvalidationContainer()); |
1207 if (reason != PaintInvalidationDelayedFull) { | 1207 clearPaintInvalidationState(paintInvalidationState); |
1208 clearPaintInvalidationState(paintInvalidationState); | |
1209 } else { | |
1210 // Mark this object as needing paint invalidation again in the next fram
e, due to the request for delayed paint invalidation. | |
1211 setShouldDoFullPaintInvalidation(); | |
1212 } | |
1213 | |
1214 invalidatePaintOfSubtreesIfNeeded(paintInvalidationState); | 1208 invalidatePaintOfSubtreesIfNeeded(paintInvalidationState); |
1215 } | 1209 } |
1216 | 1210 |
1217 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) | 1211 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) |
1218 { | 1212 { |
1219 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 1213 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
1220 if (!child->isOutOfFlowPositioned()) | 1214 if (!child->isOutOfFlowPositioned()) |
1221 child->invalidateTreeIfNeeded(childPaintInvalidationState); | 1215 child->invalidateTreeIfNeeded(childPaintInvalidationState); |
1222 } | 1216 } |
1223 } | 1217 } |
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3116 { | 3110 { |
3117 // Only full invalidation reasons are allowed. | 3111 // Only full invalidation reasons are allowed. |
3118 ASSERT(isFullPaintInvalidationReason(reason)); | 3112 ASSERT(isFullPaintInvalidationReason(reason)); |
3119 | 3113 |
3120 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone) { | 3114 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone) { |
3121 if (reason == PaintInvalidationFull) | 3115 if (reason == PaintInvalidationFull) |
3122 reason = documentLifecycleBasedPaintInvalidationReason(document().li
fecycle()); | 3116 reason = documentLifecycleBasedPaintInvalidationReason(document().li
fecycle()); |
3123 m_bitfields.setFullPaintInvalidationReason(reason); | 3117 m_bitfields.setFullPaintInvalidationReason(reason); |
3124 } | 3118 } |
3125 | 3119 |
| 3120 ASSERT(document().lifecycle().state() != DocumentLifecycle::InPaintInvalidat
ion); |
3126 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is
called outside of FrameView::updateLayoutAndStyleForPainting(). | 3121 frame()->page()->animator().scheduleVisualUpdate(); // In case that this is
called outside of FrameView::updateLayoutAndStyleForPainting(). |
3127 markContainerChainForPaintInvalidation(); | 3122 markContainerChainForPaintInvalidation(); |
3128 } | 3123 } |
3129 | 3124 |
3130 void LayoutObject::setMayNeedPaintInvalidation() | 3125 void LayoutObject::setMayNeedPaintInvalidation() |
3131 { | 3126 { |
3132 if (mayNeedPaintInvalidation()) | 3127 if (mayNeedPaintInvalidation()) |
3133 return; | 3128 return; |
3134 m_bitfields.setMayNeedPaintInvalidation(true); | 3129 m_bitfields.setMayNeedPaintInvalidation(true); |
3135 // Make sure our parent is marked as needing invalidation. | 3130 // Make sure our parent is marked as needing invalidation. |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 { | 3226 { |
3232 if (object1) { | 3227 if (object1) { |
3233 const blink::LayoutObject* root = object1; | 3228 const blink::LayoutObject* root = object1; |
3234 while (root->parent()) | 3229 while (root->parent()) |
3235 root = root->parent(); | 3230 root = root->parent(); |
3236 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3231 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3237 } | 3232 } |
3238 } | 3233 } |
3239 | 3234 |
3240 #endif | 3235 #endif |
OLD | NEW |