| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 { | 617 { |
| 618 for (const LayoutObject* current = this; current; current = current->parent(
)) { | 618 for (const LayoutObject* current = this; current; current = current->parent(
)) { |
| 619 if (current->hasLayer()) | 619 if (current->hasLayer()) |
| 620 return toLayoutBoxModelObject(current)->layer(); | 620 return toLayoutBoxModelObject(current)->layer(); |
| 621 } | 621 } |
| 622 // FIXME: we should get rid of detached layout subtrees, at which point this
code should | 622 // FIXME: we should get rid of detached layout subtrees, at which point this
code should |
| 623 // not be reached. crbug.com/411429 | 623 // not be reached. crbug.com/411429 |
| 624 return nullptr; | 624 return nullptr; |
| 625 } | 625 } |
| 626 | 626 |
| 627 PaintLayer* LayoutObject::paintingLayer() const |
| 628 { |
| 629 for (const LayoutObject* current = this; current; current = current->isColum
nSpanAll() ? current->containingBlock() : current->parent()) { |
| 630 if (current->hasLayer()) |
| 631 return toLayoutBoxModelObject(current)->layer()->enclosingSelfPainti
ngLayer(); |
| 632 } |
| 633 return nullptr; |
| 634 } |
| 635 |
| 627 bool LayoutObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign
ment& alignX, const ScrollAlignment& alignY, ScrollType scrollType, bool makeVis
ibleInVisualViewport) | 636 bool LayoutObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign
ment& alignX, const ScrollAlignment& alignY, ScrollType scrollType, bool makeVis
ibleInVisualViewport) |
| 628 { | 637 { |
| 629 LayoutBox* enclosingBox = this->enclosingBox(); | 638 LayoutBox* enclosingBox = this->enclosingBox(); |
| 630 if (!enclosingBox) | 639 if (!enclosingBox) |
| 631 return false; | 640 return false; |
| 632 | 641 |
| 633 enclosingBox->scrollRectToVisible(rect, alignX, alignY, scrollType, makeVisi
bleInVisualViewport); | 642 enclosingBox->scrollRectToVisible(rect, alignX, alignY, scrollType, makeVisi
bleInVisualViewport); |
| 634 return true; | 643 return true; |
| 635 } | 644 } |
| 636 | 645 |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 ASSERT(layoutView); | 1105 ASSERT(layoutView); |
| 1097 return *layoutView; | 1106 return *layoutView; |
| 1098 } | 1107 } |
| 1099 | 1108 |
| 1100 const LayoutBoxModelObject* LayoutObject::enclosingCompositedContainer() const | 1109 const LayoutBoxModelObject* LayoutObject::enclosingCompositedContainer() const |
| 1101 { | 1110 { |
| 1102 LayoutBoxModelObject* container = nullptr; | 1111 LayoutBoxModelObject* container = nullptr; |
| 1103 // FIXME: CompositingState is not necessarily up to date for many callers of
this function. | 1112 // FIXME: CompositingState is not necessarily up to date for many callers of
this function. |
| 1104 DisableCompositingQueryAsserts disabler; | 1113 DisableCompositingQueryAsserts disabler; |
| 1105 | 1114 |
| 1106 if (PaintLayer* compositingLayer = enclosingLayer()->enclosingLayerForPaintI
nvalidationCrossingFrameBoundaries()) | 1115 if (PaintLayer* paintingLayer = this->paintingLayer()) { |
| 1107 container = compositingLayer->layoutObject(); | 1116 if (PaintLayer* compositingLayer = paintingLayer->enclosingLayerForPaint
InvalidationCrossingFrameBoundaries()) |
| 1117 container = compositingLayer->layoutObject(); |
| 1118 } |
| 1108 return container; | 1119 return container; |
| 1109 } | 1120 } |
| 1110 | 1121 |
| 1111 String LayoutObject::decoratedName() const | 1122 String LayoutObject::decoratedName() const |
| 1112 { | 1123 { |
| 1113 StringBuilder name; | 1124 StringBuilder name; |
| 1114 name.append(this->name()); | 1125 name.append(this->name()); |
| 1115 | 1126 |
| 1116 if (isAnonymous()) | 1127 if (isAnonymous()) |
| 1117 name.append(" (anonymous)"); | 1128 name.append(" (anonymous)"); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 // painted, such as SVG images. | 1237 // painted, such as SVG images. |
| 1227 if (!paintInvalidationContainer.isPaintInvalidationContainer()) | 1238 if (!paintInvalidationContainer.isPaintInvalidationContainer()) |
| 1228 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn
tRect(dirtyRect)); | 1239 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn
tRect(dirtyRect)); |
| 1229 | 1240 |
| 1230 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio
nContainer.isPaintInvalidationContainer()) | 1241 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio
nContainer.isPaintInvalidationContainer()) |
| 1231 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR
ect, invalidationReason, *this); | 1242 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR
ect, invalidationReason, *this); |
| 1232 } | 1243 } |
| 1233 | 1244 |
| 1234 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClient& displayI
temClient) const | 1245 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClient& displayI
temClient) const |
| 1235 { | 1246 { |
| 1236 if (PaintLayer* enclosingLayer = this->enclosingLayer()) { | 1247 if (PaintLayer* paintingLayer = this->paintingLayer()) { |
| 1237 // This is valid because we want to invalidate the client in the display
item list of the current backing. | 1248 // This is valid because we want to invalidate the client in the display
item list of the current backing. |
| 1238 DisableCompositingQueryAsserts disabler; | 1249 DisableCompositingQueryAsserts disabler; |
| 1239 if (const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosing
LayerForPaintInvalidationCrossingFrameBoundaries()) | 1250 if (const PaintLayer* paintInvalidationLayer = paintingLayer->enclosingL
ayerForPaintInvalidationCrossingFrameBoundaries()) |
| 1240 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO
nBacking(displayItemClient, PaintInvalidationFull); | 1251 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO
nBacking(displayItemClient, PaintInvalidationFull); |
| 1241 enclosingLayer->setNeedsRepaint(); | 1252 paintingLayer->setNeedsRepaint(); |
| 1242 } | 1253 } |
| 1243 } | 1254 } |
| 1244 | 1255 |
| 1245 #if ENABLE(ASSERT) | 1256 void LayoutObject::setPaintingLayerNeedsRepaint() const |
| 1246 static void assertEnclosingSelfPaintingLayerHasSetNeedsRepaint(const LayoutObjec
t& layoutObject) | |
| 1247 { | 1257 { |
| 1248 PaintLayer* enclosingSelfPaintingLayer = nullptr; | 1258 if (PaintLayer* paintingLayer = this->paintingLayer()) |
| 1249 const LayoutObject* curr = &layoutObject; | 1259 paintingLayer->setNeedsRepaint(); |
| 1250 while (curr) { | |
| 1251 if (curr->hasLayer() && toLayoutBoxModelObject(curr)->hasSelfPaintingLay
er()) { | |
| 1252 enclosingSelfPaintingLayer = toLayoutBoxModelObject(curr)->layer(); | |
| 1253 break; | |
| 1254 } | |
| 1255 // Multi-column spanner is painted by the layer of the multi-column cont
ainer instead of | |
| 1256 // its enclosing layer (the layer of the multi-column flow thread). | |
| 1257 curr = curr->isColumnSpanAll() ? curr->containingBlock() : curr->parent(
); | |
| 1258 } | |
| 1259 ASSERT(!enclosingSelfPaintingLayer || enclosingSelfPaintingLayer->needsRepai
nt()); | |
| 1260 } | 1260 } |
| 1261 #endif | |
| 1262 | 1261 |
| 1263 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer, PaintInvalidationReason invalidationReason) const | 1262 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain
tInvalidationContainer, PaintInvalidationReason invalidationReason) const |
| 1264 { | 1263 { |
| 1265 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs
Repaint is set. | 1264 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs
Repaint is set. |
| 1266 // Don't set the flag here because getting enclosingSelfPaintLayer has cost
and the caller can use | 1265 // Don't set the flag here because getting enclosingSelfPaintLayer has cost
and the caller can use |
| 1267 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t
o reduce the cost. | 1266 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t
o reduce the cost. |
| 1268 #if ENABLE(ASSERT) | 1267 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); |
| 1269 assertEnclosingSelfPaintingLayerHasSetNeedsRepaint(*this); | |
| 1270 #endif | |
| 1271 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this, inval
idationReason); | 1268 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this, inval
idationReason); |
| 1272 } | 1269 } |
| 1273 | 1270 |
| 1274 void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const
LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState&
paintInvalidationState, PaintInvalidationReason invalidationReason) const | 1271 void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const
LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState&
paintInvalidationState, PaintInvalidationReason invalidationReason) const |
| 1275 { | 1272 { |
| 1276 paintInvalidationState.enclosingSelfPaintingLayer(*this).setNeedsRepaint(); | 1273 paintInvalidationState.paintingLayer().setNeedsRepaint(); |
| 1277 invalidateDisplayItemClients(paintInvalidationContainer, invalidationReason)
; | 1274 invalidateDisplayItemClients(paintInvalidationContainer, invalidationReason)
; |
| 1278 } | 1275 } |
| 1279 | 1276 |
| 1280 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const
LayoutRect& dirtyRect) const | 1277 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const
LayoutRect& dirtyRect) const |
| 1281 { | 1278 { |
| 1282 RELEASE_ASSERT(isRooted()); | 1279 RELEASE_ASSERT(isRooted()); |
| 1283 | 1280 |
| 1284 if (dirtyRect.isEmpty()) | 1281 if (dirtyRect.isEmpty()) |
| 1285 return nullptr; | 1282 return nullptr; |
| 1286 | 1283 |
| 1287 if (view()->document().printing()) | 1284 if (view()->document().printing()) |
| 1288 return nullptr; // Don't invalidate paints if we're printing. | 1285 return nullptr; // Don't invalidate paints if we're printing. |
| 1289 | 1286 |
| 1290 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn
validation(); | 1287 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn
validation(); |
| 1291 LayoutRect dirtyRectOnBacking = dirtyRect; | 1288 LayoutRect dirtyRectOnBacking = dirtyRect; |
| 1292 PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContai
ner, dirtyRectOnBacking); | 1289 PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContai
ner, dirtyRectOnBacking); |
| 1293 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking
, PaintInvalidationRectangle); | 1290 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking
, PaintInvalidationRectangle); |
| 1294 return &paintInvalidationContainer; | 1291 return &paintInvalidationContainer; |
| 1295 } | 1292 } |
| 1296 | 1293 |
| 1297 void LayoutObject::invalidatePaintRectangle(const LayoutRect& rect) const | 1294 void LayoutObject::invalidatePaintRectangle(const LayoutRect& rect) const |
| 1298 { | 1295 { |
| 1299 if (PaintLayer* enclosingLayer = this->enclosingLayer()) | 1296 setPaintingLayerNeedsRepaint(); |
| 1300 enclosingLayer->setNeedsRepaint(); | |
| 1301 const LayoutBoxModelObject* paintInvalidationContainer = invalidatePaintRect
angleInternal(rect); | 1297 const LayoutBoxModelObject* paintInvalidationContainer = invalidatePaintRect
angleInternal(rect); |
| 1302 if (paintInvalidationContainer) | 1298 if (paintInvalidationContainer) |
| 1303 invalidateDisplayItemClients(*paintInvalidationContainer, PaintInvalidat
ionRectangle); | 1299 invalidateDisplayItemClients(*paintInvalidationContainer, PaintInvalidat
ionRectangle); |
| 1304 } | 1300 } |
| 1305 | 1301 |
| 1306 void LayoutObject::invalidatePaintRectangleNotInvalidatingDisplayItemClients(con
st LayoutRect& r) const | 1302 void LayoutObject::invalidatePaintRectangleNotInvalidatingDisplayItemClients(con
st LayoutRect& r) const |
| 1307 { | 1303 { |
| 1308 invalidatePaintRectangleInternal(r); | 1304 invalidatePaintRectangleInternal(r); |
| 1309 } | 1305 } |
| 1310 | 1306 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1323 | 1319 |
| 1324 if (reason == PaintInvalidationDelayedFull) | 1320 if (reason == PaintInvalidationDelayedFull) |
| 1325 newPaintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | 1321 newPaintInvalidationState.pushDelayedPaintInvalidationTarget(*this); |
| 1326 | 1322 |
| 1327 newPaintInvalidationState.updateForChildren(); | 1323 newPaintInvalidationState.updateForChildren(); |
| 1328 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 1324 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
| 1329 } | 1325 } |
| 1330 | 1326 |
| 1331 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) | 1327 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat
e& childPaintInvalidationState) |
| 1332 { | 1328 { |
| 1333 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) | 1329 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
| 1330 // Column spanners are invalidated through their placeholders. |
| 1331 // See LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfN
eeded(). |
| 1332 if (child->isColumnSpanAll()) |
| 1333 continue; |
| 1334 child->invalidateTreeIfNeeded(childPaintInvalidationState); | 1334 child->invalidateTreeIfNeeded(childPaintInvalidationState); |
| 1335 } |
| 1335 } | 1336 } |
| 1336 | 1337 |
| 1337 static PassOwnPtr<TracedValue> jsonObjectForOldAndNewRects(const LayoutRect& old
Rect, const LayoutPoint& oldLocation, const LayoutRect& newRect, const LayoutPoi
nt& newLocation) | 1338 static PassOwnPtr<TracedValue> jsonObjectForOldAndNewRects(const LayoutRect& old
Rect, const LayoutPoint& oldLocation, const LayoutRect& newRect, const LayoutPoi
nt& newLocation) |
| 1338 { | 1339 { |
| 1339 OwnPtr<TracedValue> value = TracedValue::create(); | 1340 OwnPtr<TracedValue> value = TracedValue::create(); |
| 1340 addJsonObjectForRect(value.get(), "oldRect", oldRect); | 1341 addJsonObjectForRect(value.get(), "oldRect", oldRect); |
| 1341 addJsonObjectForPoint(value.get(), "oldLocation", oldLocation); | 1342 addJsonObjectForPoint(value.get(), "oldLocation", oldLocation); |
| 1342 addJsonObjectForRect(value.get(), "newRect", newRect); | 1343 addJsonObjectForRect(value.get(), "newRect", newRect); |
| 1343 addJsonObjectForPoint(value.get(), "newLocation", newLocation); | 1344 addJsonObjectForPoint(value.get(), "newLocation", newLocation); |
| 1344 return value.release(); | 1345 return value.release(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelect
ion, oldSelectionRect, newSelectionRect); | 1404 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelect
ion, oldSelectionRect, newSelectionRect); |
| 1404 if (shouldInvalidateSelection()) | 1405 if (shouldInvalidateSelection()) |
| 1405 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidation
Container, paintInvalidationState, PaintInvalidationSelection); | 1406 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidation
Container, paintInvalidationState, PaintInvalidationSelection); |
| 1406 } | 1407 } |
| 1407 | 1408 |
| 1408 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid
ationState& paintInvalidationState) | 1409 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid
ationState& paintInvalidationState) |
| 1409 { | 1410 { |
| 1410 ASSERT(&paintInvalidationState.currentObject() == this); | 1411 ASSERT(&paintInvalidationState.currentObject() == this); |
| 1411 | 1412 |
| 1412 if (styleRef().hasOutline()) { | 1413 if (styleRef().hasOutline()) { |
| 1413 PaintLayer& layer = paintInvalidationState.enclosingSelfPaintingLayer(*t
his); | 1414 PaintLayer& layer = paintInvalidationState.paintingLayer(); |
| 1414 if (layer.layoutObject() != this) | 1415 if (layer.layoutObject() != this) |
| 1415 layer.setNeedsPaintPhaseDescendantOutlines(); | 1416 layer.setNeedsPaintPhaseDescendantOutlines(); |
| 1416 } | 1417 } |
| 1417 | 1418 |
| 1418 LayoutView* v = view(); | 1419 LayoutView* v = view(); |
| 1419 if (v->document().printing()) | 1420 if (v->document().printing()) |
| 1420 return PaintInvalidationNone; // Don't invalidate paints if we're printi
ng. | 1421 return PaintInvalidationNone; // Don't invalidate paints if we're printi
ng. |
| 1421 | 1422 |
| 1422 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt
ate.paintInvalidationContainer(); | 1423 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt
ate.paintInvalidationContainer(); |
| 1423 ASSERT(paintInvalidationContainer == containerForPaintInvalidation()); | 1424 ASSERT(paintInvalidationContainer == containerForPaintInvalidation()); |
| (...skipping 2130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3554 } | 3555 } |
| 3555 } | 3556 } |
| 3556 | 3557 |
| 3557 } // unnamed namespace | 3558 } // unnamed namespace |
| 3558 | 3559 |
| 3559 void LayoutObject::invalidateDisplayItemClientsIncludingNonCompositingDescendant
s(const LayoutBoxModelObject* paintInvalidationContainer, PaintInvalidationReaso
n paintInvalidationReason) const | 3560 void LayoutObject::invalidateDisplayItemClientsIncludingNonCompositingDescendant
s(const LayoutBoxModelObject* paintInvalidationContainer, PaintInvalidationReaso
n paintInvalidationReason) const |
| 3560 { | 3561 { |
| 3561 // This is valid because we want to invalidate the client in the display ite
m list of the current backing. | 3562 // This is valid because we want to invalidate the client in the display ite
m list of the current backing. |
| 3562 DisableCompositingQueryAsserts disabler; | 3563 DisableCompositingQueryAsserts disabler; |
| 3563 if (!paintInvalidationContainer) { | 3564 if (!paintInvalidationContainer) { |
| 3564 // Not using enclosingCompositedContainer() directly because this object
may be in an orphaned subtree. | 3565 paintInvalidationContainer = enclosingCompositedContainer(); |
| 3565 PaintLayer* enclosingLayer = this->enclosingLayer(); | 3566 if (!paintInvalidationContainer) |
| 3566 if (!enclosingLayer) | |
| 3567 return; | 3567 return; |
| 3568 const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosingLaye
rForPaintInvalidationCrossingFrameBoundaries(); | |
| 3569 if (!paintInvalidationLayer) | |
| 3570 return; | |
| 3571 paintInvalidationContainer = paintInvalidationLayer->layoutObject(); | |
| 3572 } | 3568 } |
| 3573 | 3569 |
| 3574 traverseNonCompositingDescendants(const_cast<LayoutObject&>(*this), [&paintI
nvalidationContainer, paintInvalidationReason](LayoutObject& object) { | 3570 traverseNonCompositingDescendants(const_cast<LayoutObject&>(*this), [&paintI
nvalidationContainer, paintInvalidationReason](LayoutObject& object) { |
| 3575 if (object.hasLayer()) | 3571 if (object.hasLayer()) |
| 3576 toLayoutBoxModelObject(object).layer()->setNeedsRepaint(); | 3572 toLayoutBoxModelObject(object).layer()->setNeedsRepaint(); |
| 3577 object.invalidateDisplayItemClients(*paintInvalidationContainer, paintIn
validationReason); | 3573 object.invalidateDisplayItemClients(*paintInvalidationContainer, paintIn
validationReason); |
| 3578 }); | 3574 }); |
| 3579 } | 3575 } |
| 3580 | 3576 |
| 3581 void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBo
xModelObject& paintInvalidationContainer, PaintInvalidationReason reason) | 3577 void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBo
xModelObject& paintInvalidationContainer, PaintInvalidationReason reason) |
| 3582 { | 3578 { |
| 3583 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs
Repaint is set. | 3579 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs
Repaint is set. |
| 3584 // Don't set the flag here because getting enclosingSelfPaintLayer has cost
and the caller can use | 3580 // Don't set the flag here because getting enclosingSelfPaintLayer has cost
and the caller can use |
| 3585 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t
o reduce the cost. | 3581 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t
o reduce the cost. |
| 3586 #if ENABLE(ASSERT) | 3582 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); |
| 3587 assertEnclosingSelfPaintingLayerHasSetNeedsRepaint(*this); | |
| 3588 #endif | |
| 3589 | 3583 |
| 3590 // These disablers are valid because we want to use the current compositing/
invalidation status. | 3584 // These disablers are valid because we want to use the current compositing/
invalidation status. |
| 3591 DisablePaintInvalidationStateAsserts invalidationDisabler; | 3585 DisablePaintInvalidationStateAsserts invalidationDisabler; |
| 3592 DisableCompositingQueryAsserts compositingDisabler; | 3586 DisableCompositingQueryAsserts compositingDisabler; |
| 3593 | 3587 |
| 3594 LayoutRect invalidationRect = previousPaintInvalidationRect(); | 3588 LayoutRect invalidationRect = previousPaintInvalidationRect(); |
| 3595 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida
tionContainer); | 3589 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida
tionContainer); |
| 3596 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
reason); | 3590 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect,
reason); |
| 3597 invalidateDisplayItemClients(paintInvalidationContainer, reason); | 3591 invalidateDisplayItemClients(paintInvalidationContainer, reason); |
| 3598 | 3592 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3630 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 3624 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
| 3631 if (child->hasLayer()) | 3625 if (child->hasLayer()) |
| 3632 toLayoutBoxModelObject(child)->layer()->setNeedsRepaint(); | 3626 toLayoutBoxModelObject(child)->layer()->setNeedsRepaint(); |
| 3633 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel
fPaintingLayer()) | 3627 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel
fPaintingLayer()) |
| 3634 child->invalidatePaintIncludingNonSelfPaintingLayerDescendantsIntern
al(paintInvalidationContainer); | 3628 child->invalidatePaintIncludingNonSelfPaintingLayerDescendantsIntern
al(paintInvalidationContainer); |
| 3635 } | 3629 } |
| 3636 } | 3630 } |
| 3637 | 3631 |
| 3638 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const
LayoutBoxModelObject& paintInvalidationContainer) | 3632 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const
LayoutBoxModelObject& paintInvalidationContainer) |
| 3639 { | 3633 { |
| 3640 if (PaintLayer* enclosingLayer = this->enclosingLayer()) | 3634 setPaintingLayerNeedsRepaint(); |
| 3641 enclosingLayer->setNeedsRepaint(); | |
| 3642 invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(paintInvalid
ationContainer); | 3635 invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(paintInvalid
ationContainer); |
| 3643 } | 3636 } |
| 3644 | 3637 |
| 3645 void LayoutObject::setIsBackgroundAttachmentFixedObject(bool isBackgroundAttachm
entFixedObject) | 3638 void LayoutObject::setIsBackgroundAttachmentFixedObject(bool isBackgroundAttachm
entFixedObject) |
| 3646 { | 3639 { |
| 3647 ASSERT(frameView()); | 3640 ASSERT(frameView()); |
| 3648 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen
tFixedObject) | 3641 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen
tFixedObject) |
| 3649 return; | 3642 return; |
| 3650 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed
Object); | 3643 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed
Object); |
| 3651 if (isBackgroundAttachmentFixedObject) | 3644 if (isBackgroundAttachmentFixedObject) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3706 const blink::LayoutObject* root = object1; | 3699 const blink::LayoutObject* root = object1; |
| 3707 while (root->parent()) | 3700 while (root->parent()) |
| 3708 root = root->parent(); | 3701 root = root->parent(); |
| 3709 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3702 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3710 } else { | 3703 } else { |
| 3711 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3704 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3712 } | 3705 } |
| 3713 } | 3706 } |
| 3714 | 3707 |
| 3715 #endif | 3708 #endif |
| OLD | NEW |