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->spannerPlaceholder() : current->parent()) { | |
mstensho (USE GERRIT)
2016/05/09 08:20:42
To make it look slightly less special, we could ju
Xianzhu
2016/05/09 17:14:20
Done.
| |
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 |
1256 void LayoutObject::setPaintingLayerNeedsRepaint() const | |
1257 { | |
1258 if (PaintLayer* paintingLayer = this->paintingLayer()) | |
1259 paintingLayer->setNeedsRepaint(); | |
1260 } | |
1261 | |
1245 #if ENABLE(ASSERT) | 1262 #if ENABLE(ASSERT) |
1246 static void assertEnclosingSelfPaintingLayerHasSetNeedsRepaint(const LayoutObjec t& layoutObject) | 1263 void LayoutObject::assertPaintingLayerHasSetNeedsRepaint() const |
1247 { | 1264 { |
1248 PaintLayer* enclosingSelfPaintingLayer = nullptr; | 1265 PaintLayer* paintingLayer = this->paintingLayer(); |
1249 const LayoutObject* curr = &layoutObject; | 1266 ASSERT(!paintingLayer || paintingLayer->needsRepaint()); |
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 } | 1267 } |
1261 #endif | 1268 #endif |
1262 | 1269 |
1263 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const | 1270 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const |
1264 { | 1271 { |
1265 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set. | 1272 // 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 | 1273 // 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. | 1274 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost. |
1268 #if ENABLE(ASSERT) | 1275 #if ENABLE(ASSERT) |
1269 assertEnclosingSelfPaintingLayerHasSetNeedsRepaint(*this); | 1276 assertPaintingLayerHasSetNeedsRepaint(); |
mstensho (USE GERRIT)
2016/05/09 08:20:42
Might consider just doing ASSERT(!paintingLayer()
Xianzhu
2016/05/09 17:14:20
Acknowledged. Done.
| |
1270 #endif | 1277 #endif |
1271 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this, inval idationReason); | 1278 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this, inval idationReason); |
1272 } | 1279 } |
1273 | 1280 |
1274 void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState& paintInvalidationState, PaintInvalidationReason invalidationReason) const | 1281 void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState& paintInvalidationState, PaintInvalidationReason invalidationReason) const |
1275 { | 1282 { |
1276 paintInvalidationState.enclosingSelfPaintingLayer(*this).setNeedsRepaint(); | 1283 paintInvalidationState.paintingLayer().setNeedsRepaint(); |
1277 invalidateDisplayItemClients(paintInvalidationContainer, invalidationReason) ; | 1284 invalidateDisplayItemClients(paintInvalidationContainer, invalidationReason) ; |
1278 } | 1285 } |
1279 | 1286 |
1280 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const LayoutRect& dirtyRect) const | 1287 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const LayoutRect& dirtyRect) const |
1281 { | 1288 { |
1282 RELEASE_ASSERT(isRooted()); | 1289 RELEASE_ASSERT(isRooted()); |
1283 | 1290 |
1284 if (dirtyRect.isEmpty()) | 1291 if (dirtyRect.isEmpty()) |
1285 return nullptr; | 1292 return nullptr; |
1286 | 1293 |
1287 if (view()->document().printing()) | 1294 if (view()->document().printing()) |
1288 return nullptr; // Don't invalidate paints if we're printing. | 1295 return nullptr; // Don't invalidate paints if we're printing. |
1289 | 1296 |
1290 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn validation(); | 1297 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn validation(); |
1291 LayoutRect dirtyRectOnBacking = dirtyRect; | 1298 LayoutRect dirtyRectOnBacking = dirtyRect; |
1292 PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContai ner, dirtyRectOnBacking); | 1299 PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContai ner, dirtyRectOnBacking); |
1293 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking , PaintInvalidationRectangle); | 1300 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking , PaintInvalidationRectangle); |
1294 return &paintInvalidationContainer; | 1301 return &paintInvalidationContainer; |
1295 } | 1302 } |
1296 | 1303 |
1297 void LayoutObject::invalidatePaintRectangle(const LayoutRect& rect) const | 1304 void LayoutObject::invalidatePaintRectangle(const LayoutRect& rect) const |
1298 { | 1305 { |
1299 if (PaintLayer* enclosingLayer = this->enclosingLayer()) | 1306 setPaintingLayerNeedsRepaint(); |
1300 enclosingLayer->setNeedsRepaint(); | |
1301 const LayoutBoxModelObject* paintInvalidationContainer = invalidatePaintRect angleInternal(rect); | 1307 const LayoutBoxModelObject* paintInvalidationContainer = invalidatePaintRect angleInternal(rect); |
1302 if (paintInvalidationContainer) | 1308 if (paintInvalidationContainer) |
1303 invalidateDisplayItemClients(*paintInvalidationContainer, PaintInvalidat ionRectangle); | 1309 invalidateDisplayItemClients(*paintInvalidationContainer, PaintInvalidat ionRectangle); |
1304 } | 1310 } |
1305 | 1311 |
1306 void LayoutObject::invalidatePaintRectangleNotInvalidatingDisplayItemClients(con st LayoutRect& r) const | 1312 void LayoutObject::invalidatePaintRectangleNotInvalidatingDisplayItemClients(con st LayoutRect& r) const |
1307 { | 1313 { |
1308 invalidatePaintRectangleInternal(r); | 1314 invalidatePaintRectangleInternal(r); |
1309 } | 1315 } |
1310 | 1316 |
(...skipping 12 matching lines...) Expand all Loading... | |
1323 | 1329 |
1324 if (reason == PaintInvalidationDelayedFull) | 1330 if (reason == PaintInvalidationDelayedFull) |
1325 newPaintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | 1331 newPaintInvalidationState.pushDelayedPaintInvalidationTarget(*this); |
1326 | 1332 |
1327 newPaintInvalidationState.updateForChildren(); | 1333 newPaintInvalidationState.updateForChildren(); |
1328 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 1334 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
1329 } | 1335 } |
1330 | 1336 |
1331 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat e& childPaintInvalidationState) | 1337 void LayoutObject::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationStat e& childPaintInvalidationState) |
1332 { | 1338 { |
1333 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) | 1339 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { |
1340 // Column spanners are invalidated through their placeholders. | |
1341 // See LayoutMultiColumnSpannerPlaceholder::invalidatePaintOfSubtreesIfN eeded(). | |
1342 if (child->isColumnSpanAll()) | |
1343 continue; | |
1334 child->invalidateTreeIfNeeded(childPaintInvalidationState); | 1344 child->invalidateTreeIfNeeded(childPaintInvalidationState); |
1345 } | |
1335 } | 1346 } |
1336 | 1347 |
1337 static PassOwnPtr<TracedValue> jsonObjectForOldAndNewRects(const LayoutRect& old Rect, const LayoutPoint& oldLocation, const LayoutRect& newRect, const LayoutPoi nt& newLocation) | 1348 static PassOwnPtr<TracedValue> jsonObjectForOldAndNewRects(const LayoutRect& old Rect, const LayoutPoint& oldLocation, const LayoutRect& newRect, const LayoutPoi nt& newLocation) |
1338 { | 1349 { |
1339 OwnPtr<TracedValue> value = TracedValue::create(); | 1350 OwnPtr<TracedValue> value = TracedValue::create(); |
1340 addJsonObjectForRect(value.get(), "oldRect", oldRect); | 1351 addJsonObjectForRect(value.get(), "oldRect", oldRect); |
1341 addJsonObjectForPoint(value.get(), "oldLocation", oldLocation); | 1352 addJsonObjectForPoint(value.get(), "oldLocation", oldLocation); |
1342 addJsonObjectForRect(value.get(), "newRect", newRect); | 1353 addJsonObjectForRect(value.get(), "newRect", newRect); |
1343 addJsonObjectForPoint(value.get(), "newLocation", newLocation); | 1354 addJsonObjectForPoint(value.get(), "newLocation", newLocation); |
1344 return value.release(); | 1355 return value.release(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1403 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelect ion, oldSelectionRect, newSelectionRect); | 1414 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelect ion, oldSelectionRect, newSelectionRect); |
1404 if (shouldInvalidateSelection()) | 1415 if (shouldInvalidateSelection()) |
1405 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidation Container, paintInvalidationState, PaintInvalidationSelection); | 1416 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidation Container, paintInvalidationState, PaintInvalidationSelection); |
1406 } | 1417 } |
1407 | 1418 |
1408 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid ationState& paintInvalidationState) | 1419 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid ationState& paintInvalidationState) |
1409 { | 1420 { |
1410 ASSERT(&paintInvalidationState.currentObject() == this); | 1421 ASSERT(&paintInvalidationState.currentObject() == this); |
1411 | 1422 |
1412 if (styleRef().hasOutline()) { | 1423 if (styleRef().hasOutline()) { |
1413 PaintLayer& layer = paintInvalidationState.enclosingSelfPaintingLayer(*t his); | 1424 PaintLayer& layer = paintInvalidationState.paintingLayer(); |
1414 if (layer.layoutObject() != this) | 1425 if (layer.layoutObject() != this) |
1415 layer.setNeedsPaintPhaseDescendantOutlines(); | 1426 layer.setNeedsPaintPhaseDescendantOutlines(); |
1416 } | 1427 } |
1417 | 1428 |
1418 LayoutView* v = view(); | 1429 LayoutView* v = view(); |
1419 if (v->document().printing()) | 1430 if (v->document().printing()) |
1420 return PaintInvalidationNone; // Don't invalidate paints if we're printi ng. | 1431 return PaintInvalidationNone; // Don't invalidate paints if we're printi ng. |
1421 | 1432 |
1422 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt ate.paintInvalidationContainer(); | 1433 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt ate.paintInvalidationContainer(); |
1423 ASSERT(paintInvalidationContainer == containerForPaintInvalidation()); | 1434 ASSERT(paintInvalidationContainer == containerForPaintInvalidation()); |
(...skipping 2130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3554 } | 3565 } |
3555 } | 3566 } |
3556 | 3567 |
3557 } // unnamed namespace | 3568 } // unnamed namespace |
3558 | 3569 |
3559 void LayoutObject::invalidateDisplayItemClientsIncludingNonCompositingDescendant s(const LayoutBoxModelObject* paintInvalidationContainer, PaintInvalidationReaso n paintInvalidationReason) const | 3570 void LayoutObject::invalidateDisplayItemClientsIncludingNonCompositingDescendant s(const LayoutBoxModelObject* paintInvalidationContainer, PaintInvalidationReaso n paintInvalidationReason) const |
3560 { | 3571 { |
3561 // This is valid because we want to invalidate the client in the display ite m list of the current backing. | 3572 // This is valid because we want to invalidate the client in the display ite m list of the current backing. |
3562 DisableCompositingQueryAsserts disabler; | 3573 DisableCompositingQueryAsserts disabler; |
3563 if (!paintInvalidationContainer) { | 3574 if (!paintInvalidationContainer) { |
3564 // Not using enclosingCompositedContainer() directly because this object may be in an orphaned subtree. | 3575 paintInvalidationContainer = enclosingCompositedContainer(); |
3565 PaintLayer* enclosingLayer = this->enclosingLayer(); | 3576 if (!paintInvalidationContainer) |
3566 if (!enclosingLayer) | |
3567 return; | 3577 return; |
3568 const PaintLayer* paintInvalidationLayer = enclosingLayer->enclosingLaye rForPaintInvalidationCrossingFrameBoundaries(); | |
3569 if (!paintInvalidationLayer) | |
3570 return; | |
3571 paintInvalidationContainer = paintInvalidationLayer->layoutObject(); | |
3572 } | 3578 } |
3573 | 3579 |
3574 traverseNonCompositingDescendants(const_cast<LayoutObject&>(*this), [&paintI nvalidationContainer, paintInvalidationReason](LayoutObject& object) { | 3580 traverseNonCompositingDescendants(const_cast<LayoutObject&>(*this), [&paintI nvalidationContainer, paintInvalidationReason](LayoutObject& object) { |
3575 if (object.hasLayer()) | 3581 if (object.hasLayer()) |
3576 toLayoutBoxModelObject(object).layer()->setNeedsRepaint(); | 3582 toLayoutBoxModelObject(object).layer()->setNeedsRepaint(); |
3577 object.invalidateDisplayItemClients(*paintInvalidationContainer, paintIn validationReason); | 3583 object.invalidateDisplayItemClients(*paintInvalidationContainer, paintIn validationReason); |
3578 }); | 3584 }); |
3579 } | 3585 } |
3580 | 3586 |
3581 void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBo xModelObject& paintInvalidationContainer, PaintInvalidationReason reason) | 3587 void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBo xModelObject& paintInvalidationContainer, PaintInvalidationReason reason) |
3582 { | 3588 { |
3583 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set. | 3589 // 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 | 3590 // 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. | 3591 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost. |
3586 #if ENABLE(ASSERT) | 3592 #if ENABLE(ASSERT) |
3587 assertEnclosingSelfPaintingLayerHasSetNeedsRepaint(*this); | 3593 assertPaintingLayerHasSetNeedsRepaint(); |
3588 #endif | 3594 #endif |
3589 | 3595 |
3590 // These disablers are valid because we want to use the current compositing/ invalidation status. | 3596 // These disablers are valid because we want to use the current compositing/ invalidation status. |
3591 DisablePaintInvalidationStateAsserts invalidationDisabler; | 3597 DisablePaintInvalidationStateAsserts invalidationDisabler; |
3592 DisableCompositingQueryAsserts compositingDisabler; | 3598 DisableCompositingQueryAsserts compositingDisabler; |
3593 | 3599 |
3594 LayoutRect invalidationRect = previousPaintInvalidationRect(); | 3600 LayoutRect invalidationRect = previousPaintInvalidationRect(); |
3595 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida tionContainer); | 3601 adjustInvalidationRectForCompositedScrolling(invalidationRect, paintInvalida tionContainer); |
3596 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, reason); | 3602 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, reason); |
3597 invalidateDisplayItemClients(paintInvalidationContainer, reason); | 3603 invalidateDisplayItemClients(paintInvalidationContainer, reason); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3630 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { | 3636 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { |
3631 if (child->hasLayer()) | 3637 if (child->hasLayer()) |
3632 toLayoutBoxModelObject(child)->layer()->setNeedsRepaint(); | 3638 toLayoutBoxModelObject(child)->layer()->setNeedsRepaint(); |
3633 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel fPaintingLayer()) | 3639 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel fPaintingLayer()) |
3634 child->invalidatePaintIncludingNonSelfPaintingLayerDescendantsIntern al(paintInvalidationContainer); | 3640 child->invalidatePaintIncludingNonSelfPaintingLayerDescendantsIntern al(paintInvalidationContainer); |
3635 } | 3641 } |
3636 } | 3642 } |
3637 | 3643 |
3638 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer) | 3644 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer) |
3639 { | 3645 { |
3640 if (PaintLayer* enclosingLayer = this->enclosingLayer()) | 3646 setPaintingLayerNeedsRepaint(); |
3641 enclosingLayer->setNeedsRepaint(); | |
3642 invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(paintInvalid ationContainer); | 3647 invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(paintInvalid ationContainer); |
3643 } | 3648 } |
3644 | 3649 |
3645 void LayoutObject::setIsBackgroundAttachmentFixedObject(bool isBackgroundAttachm entFixedObject) | 3650 void LayoutObject::setIsBackgroundAttachmentFixedObject(bool isBackgroundAttachm entFixedObject) |
3646 { | 3651 { |
3647 ASSERT(frameView()); | 3652 ASSERT(frameView()); |
3648 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen tFixedObject) | 3653 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen tFixedObject) |
3649 return; | 3654 return; |
3650 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed Object); | 3655 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed Object); |
3651 if (isBackgroundAttachmentFixedObject) | 3656 if (isBackgroundAttachmentFixedObject) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3706 const blink::LayoutObject* root = object1; | 3711 const blink::LayoutObject* root = object1; |
3707 while (root->parent()) | 3712 while (root->parent()) |
3708 root = root->parent(); | 3713 root = root->parent(); |
3709 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3714 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3710 } else { | 3715 } else { |
3711 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3716 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3712 } | 3717 } |
3713 } | 3718 } |
3714 | 3719 |
3715 #endif | 3720 #endif |
OLD | NEW |