Chromium Code Reviews| 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 1212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1223 | 1223 |
| 1224 // This conditional handles situations where non-rooted (and hence non-compo sited) frames are | 1224 // This conditional handles situations where non-rooted (and hence non-compo sited) frames are |
| 1225 // painted, such as SVG images. | 1225 // painted, such as SVG images. |
| 1226 if (!paintInvalidationContainer.isPaintInvalidationContainer()) | 1226 if (!paintInvalidationContainer.isPaintInvalidationContainer()) |
| 1227 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn tRect(dirtyRect)); | 1227 invalidatePaintRectangleOnWindow(paintInvalidationContainer, enclosingIn tRect(dirtyRect)); |
| 1228 | 1228 |
| 1229 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio nContainer.isPaintInvalidationContainer()) | 1229 if (paintInvalidationContainer.view()->usesCompositing() && paintInvalidatio nContainer.isPaintInvalidationContainer()) |
| 1230 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR ect, invalidationReason, *this); | 1230 paintInvalidationContainer.setBackingNeedsPaintInvalidationInRect(dirtyR ect, invalidationReason, *this); |
| 1231 } | 1231 } |
| 1232 | 1232 |
| 1233 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClient& displayI temClient) const | 1233 void LayoutObject::invalidateDisplayItemClient(const DisplayItemClient& client, PaintInvalidationReason reason) const |
| 1234 { | 1234 { |
| 1235 if (PaintLayer* paintingLayer = this->paintingLayer()) { | 1235 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set. |
| 1236 paintingLayer->setNeedsRepaint(); | 1236 // Don't set the flag here because getting enclosingSelfPaintLayer has cost and the caller can use |
| 1237 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost. | |
| 1238 client.setDisplayItemsUncached(); | |
| 1237 | 1239 |
| 1238 #if !ENABLE(ASSERT) | 1240 if (FrameView* frameView = this->frameView()) |
| 1239 // This is a fast path when we don't need to inform the GraphicsLayer ab out this paint invalidation. | 1241 frameView->trackObjectPaintInvalidation(client, reason); |
| 1240 FrameView* frameView = this->frameView(); | |
| 1241 if (!frameView || !frameView->isTrackingPaintInvalidations()) { | |
|
chrishtr
2016/06/13 20:18:52
Why is this conditional no longer needed?
Xianzhu
2016/06/13 20:52:01
This was an optimization to avoid execution of lin
| |
| 1242 displayItemClient.setDisplayItemsUncached(); | |
| 1243 return; | |
| 1244 } | |
| 1245 #endif | |
| 1246 // This is valid because we want to invalidate the client in the display item list of the current backing. | |
| 1247 DisableCompositingQueryAsserts disabler; | |
| 1248 if (const PaintLayer* paintInvalidationLayer = paintingLayer->enclosingL ayerForPaintInvalidationCrossingFrameBoundaries()) | |
| 1249 paintInvalidationLayer->layoutObject()->invalidateDisplayItemClientO nBacking(displayItemClient, PaintInvalidationFull); | |
| 1250 } | |
| 1251 } | 1242 } |
| 1252 | 1243 |
| 1253 void LayoutObject::setPaintingLayerNeedsRepaint() const | 1244 void LayoutObject::invalidateDisplayItemClientWithPaintInvalidationState(const P aintInvalidationState& paintInvalidationState, const DisplayItemClient& client, PaintInvalidationReason reason) const |
| 1245 { | |
| 1246 paintInvalidationState.paintingLayer().setNeedsRepaint(); | |
| 1247 invalidateDisplayItemClient(client, reason); | |
| 1248 } | |
| 1249 | |
| 1250 void LayoutObject::slowSetPaintingLayerNeedsRepaint() const | |
| 1254 { | 1251 { |
| 1255 if (PaintLayer* paintingLayer = this->paintingLayer()) | 1252 if (PaintLayer* paintingLayer = this->paintingLayer()) |
| 1256 paintingLayer->setNeedsRepaint(); | 1253 paintingLayer->setNeedsRepaint(); |
| 1257 } | 1254 } |
| 1258 | 1255 |
| 1259 void LayoutObject::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer, PaintInvalidationReason invalidationReason) const | 1256 void LayoutObject::invalidateDisplayItemClients(PaintInvalidationReason reason) const |
| 1260 { | 1257 { |
| 1261 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set. | 1258 invalidateDisplayItemClient(*this, reason); |
| 1262 // Don't set the flag here because getting enclosingSelfPaintLayer has cost and the caller can use | |
| 1263 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost. | |
| 1264 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); | |
| 1265 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*this, inval idationReason, this); | |
| 1266 } | 1259 } |
| 1267 | 1260 |
| 1268 void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const LayoutBoxModelObject& paintInvalidationContainer, const PaintInvalidationState& paintInvalidationState, PaintInvalidationReason invalidationReason) const | 1261 void LayoutObject::invalidateDisplayItemClientsWithPaintInvalidationState(const PaintInvalidationState& paintInvalidationState, PaintInvalidationReason reason) const |
| 1269 { | 1262 { |
| 1270 paintInvalidationState.paintingLayer().setNeedsRepaint(); | 1263 paintInvalidationState.paintingLayer().setNeedsRepaint(); |
| 1271 invalidateDisplayItemClients(paintInvalidationContainer, invalidationReason) ; | 1264 invalidateDisplayItemClients(reason); |
| 1272 } | 1265 } |
| 1273 | 1266 |
| 1274 | |
| 1275 bool LayoutObject::compositedScrollsWithRespectTo(const LayoutBoxModelObject& pa intInvalidationContainer) const | 1267 bool LayoutObject::compositedScrollsWithRespectTo(const LayoutBoxModelObject& pa intInvalidationContainer) const |
| 1276 { | 1268 { |
| 1277 return paintInvalidationContainer.usesCompositedScrolling() && this != &pain tInvalidationContainer; | 1269 return paintInvalidationContainer.usesCompositedScrolling() && this != &pain tInvalidationContainer; |
| 1278 } | 1270 } |
| 1279 | 1271 |
| 1280 const LayoutBoxModelObject* LayoutObject::invalidatePaintRectangleInternal(const LayoutRect& dirtyRect) const | 1272 void LayoutObject::invalidatePaintRectangle(const LayoutRect& dirtyRect) const |
| 1281 { | 1273 { |
| 1282 RELEASE_ASSERT(isRooted()); | 1274 RELEASE_ASSERT(isRooted()); |
| 1283 | 1275 |
| 1284 if (dirtyRect.isEmpty()) | 1276 if (dirtyRect.isEmpty()) |
| 1285 return nullptr; | 1277 return; |
| 1286 | 1278 |
| 1287 if (view()->document().printing()) | 1279 if (view()->document().printing()) |
| 1288 return nullptr; // Don't invalidate paints if we're printing. | 1280 return; // Don't invalidate paints if we're printing. |
| 1289 | 1281 |
| 1290 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn validation(); | 1282 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn validation(); |
| 1291 LayoutRect dirtyRectOnBacking = dirtyRect; | 1283 LayoutRect dirtyRectOnBacking = dirtyRect; |
| 1292 PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContai ner, dirtyRectOnBacking); | 1284 PaintLayer::mapRectToPaintInvalidationBacking(*this, paintInvalidationContai ner, dirtyRectOnBacking); |
| 1293 | 1285 |
| 1294 // Composited scrolling should not be included in the bounds of composited-s crolled items. | 1286 // Composited scrolling should not be included in the bounds of composited-s crolled items. |
| 1295 if (compositedScrollsWithRespectTo(paintInvalidationContainer)) { | 1287 if (compositedScrollsWithRespectTo(paintInvalidationContainer)) { |
| 1296 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset()); | 1288 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol ledContentOffset()); |
| 1297 dirtyRectOnBacking.move(inverseOffset); | 1289 dirtyRectOnBacking.move(inverseOffset); |
| 1298 } | 1290 } |
| 1299 | 1291 |
| 1300 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking , PaintInvalidationRectangle); | 1292 invalidatePaintUsingContainer(paintInvalidationContainer, dirtyRectOnBacking , PaintInvalidationRectangle); |
| 1301 return &paintInvalidationContainer; | |
| 1302 } | |
| 1303 | 1293 |
| 1304 void LayoutObject::invalidatePaintRectangle(const LayoutRect& rect) const | 1294 slowSetPaintingLayerNeedsRepaint(); |
| 1305 { | 1295 invalidateDisplayItemClients(PaintInvalidationRectangle); |
| 1306 setPaintingLayerNeedsRepaint(); | |
| 1307 const LayoutBoxModelObject* paintInvalidationContainer = invalidatePaintRect angleInternal(rect); | |
| 1308 if (paintInvalidationContainer) | |
| 1309 invalidateDisplayItemClients(*paintInvalidationContainer, PaintInvalidat ionRectangle); | |
|
chrishtr
2016/06/13 20:18:52
Why is it ok to skip invalidating the DisplayItemC
Xianzhu
2016/06/13 20:52:01
The original condition was to handle unrooted subt
| |
| 1310 } | |
| 1311 | |
| 1312 void LayoutObject::invalidatePaintRectangleNotInvalidatingDisplayItemClients(con st LayoutRect& r) const | |
| 1313 { | |
| 1314 invalidatePaintRectangleInternal(r); | |
| 1315 } | 1296 } |
| 1316 | 1297 |
| 1317 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv alidationState) | 1298 void LayoutObject::invalidateTreeIfNeeded(const PaintInvalidationState& paintInv alidationState) |
| 1318 { | 1299 { |
| 1319 ASSERT(!needsLayout()); | 1300 ASSERT(!needsLayout()); |
| 1320 | 1301 |
| 1321 // If we didn't need paint invalidation then our children don't need as well . | 1302 // If we didn't need paint invalidation then our children don't need as well . |
| 1322 // Skip walking down the tree as everything should be fine below us. | 1303 // Skip walking down the tree as everything should be fine below us. |
| 1323 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) | 1304 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) |
| 1324 return; | 1305 return; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1407 newSelectionRect.move(inverseOffset); | 1388 newSelectionRect.move(inverseOffset); |
| 1408 } | 1389 } |
| 1409 } | 1390 } |
| 1410 | 1391 |
| 1411 setPreviousSelectionRectForPaintInvalidation(newSelectionRect); | 1392 setPreviousSelectionRectForPaintInvalidation(newSelectionRect); |
| 1412 | 1393 |
| 1413 // TODO(wangxianzhu): Combine the following two conditions when removing Lay outView::doingFullPaintInvalidation(). | 1394 // TODO(wangxianzhu): Combine the following two conditions when removing Lay outView::doingFullPaintInvalidation(). |
| 1414 if (!fullInvalidation) | 1395 if (!fullInvalidation) |
| 1415 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelect ion, oldSelectionRect, newSelectionRect); | 1396 fullyInvalidatePaint(paintInvalidationContainer, PaintInvalidationSelect ion, oldSelectionRect, newSelectionRect); |
| 1416 if (shouldInvalidateSelection()) | 1397 if (shouldInvalidateSelection()) |
| 1417 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidation Container, paintInvalidationState, PaintInvalidationSelection); | 1398 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidation State, PaintInvalidationSelection); |
| 1418 } | 1399 } |
| 1419 | 1400 |
| 1420 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid ationState& paintInvalidationState) | 1401 PaintInvalidationReason LayoutObject::invalidatePaintIfNeeded(const PaintInvalid ationState& paintInvalidationState) |
| 1421 { | 1402 { |
| 1422 ASSERT(&paintInvalidationState.currentObject() == this); | 1403 ASSERT(&paintInvalidationState.currentObject() == this); |
| 1423 | 1404 |
| 1424 if (styleRef().hasOutline()) { | 1405 if (styleRef().hasOutline()) { |
| 1425 PaintLayer& layer = paintInvalidationState.paintingLayer(); | 1406 PaintLayer& layer = paintInvalidationState.paintingLayer(); |
| 1426 if (layer.layoutObject() != this) | 1407 if (layer.layoutObject() != this) |
| 1427 layer.setNeedsPaintPhaseDescendantOutlines(); | 1408 layer.setNeedsPaintPhaseDescendantOutlines(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1471 invalidationReason = PaintInvalidationBackgroundObscurationChange; | 1452 invalidationReason = PaintInvalidationBackgroundObscurationChange; |
| 1472 m_bitfields.setLastBoxDecorationBackgroundObscured(boxDecorationBackgroundOb scured); | 1453 m_bitfields.setLastBoxDecorationBackgroundObscured(boxDecorationBackgroundOb scured); |
| 1473 | 1454 |
| 1474 if (invalidationReason == PaintInvalidationNone) { | 1455 if (invalidationReason == PaintInvalidationNone) { |
| 1475 // TODO(trchen): Currently we don't keep track of paint offset of layout objects. | 1456 // TODO(trchen): Currently we don't keep track of paint offset of layout objects. |
| 1476 // There are corner cases that the display items need to be invalidated for paint offset | 1457 // There are corner cases that the display items need to be invalidated for paint offset |
| 1477 // mutation, but incurs no pixel difference (i.e. bounds stay the same) so no rect-based | 1458 // mutation, but incurs no pixel difference (i.e. bounds stay the same) so no rect-based |
| 1478 // invalidation is issued. See crbug.com/508383 and crbug.com/515977. | 1459 // invalidation is issued. See crbug.com/508383 and crbug.com/515977. |
| 1479 // This is a workaround to force display items to update paint offset. | 1460 // This is a workaround to force display items to update paint offset. |
| 1480 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && paint InvalidationState.forcedSubtreeInvalidationCheckingWithinContainer()) | 1461 if (!RuntimeEnabledFeatures::slimmingPaintInvalidationEnabled() && paint InvalidationState.forcedSubtreeInvalidationCheckingWithinContainer()) |
| 1481 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalida tionContainer, paintInvalidationState, invalidationReason); | 1462 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalida tionState, invalidationReason); |
| 1482 | 1463 |
| 1483 return invalidationReason; | 1464 return invalidationReason; |
| 1484 } | 1465 } |
| 1485 | 1466 |
| 1486 if (invalidationReason == PaintInvalidationIncremental) | 1467 if (invalidationReason == PaintInvalidationIncremental) |
| 1487 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB ounds, newLocation); | 1468 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB ounds, newLocation); |
| 1488 else | 1469 else |
| 1489 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, old Bounds, newBounds); | 1470 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, old Bounds, newBounds); |
| 1490 | 1471 |
| 1491 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidationCont ainer, paintInvalidationState, invalidationReason); | 1472 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidationStat e, invalidationReason); |
| 1492 return invalidationReason; | 1473 return invalidationReason; |
| 1493 } | 1474 } |
| 1494 | 1475 |
| 1495 PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const PaintInva lidationState& paintInvalidationState, | 1476 PaintInvalidationReason LayoutObject::getPaintInvalidationReason(const PaintInva lidationState& paintInvalidationState, |
| 1496 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalida tionBacking, | 1477 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalida tionBacking, |
| 1497 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalida tionBacking) const | 1478 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalida tionBacking) const |
| 1498 { | 1479 { |
| 1499 if (paintInvalidationState.forcedSubtreeFullInvalidationWithinContainer()) | 1480 if (paintInvalidationState.forcedSubtreeFullInvalidationWithinContainer()) |
| 1500 return PaintInvalidationSubtree; | 1481 return PaintInvalidationSubtree; |
| 1501 | 1482 |
| (...skipping 2066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3568 | 3549 |
| 3569 // If a paint invalidation container is not a stacking context, | 3550 // If a paint invalidation container is not a stacking context, |
| 3570 // some of its descendants may belong to the parent container. | 3551 // some of its descendants may belong to the parent container. |
| 3571 findNonCompositedDescendantLayerToTraverse(*descendant, functor); | 3552 findNonCompositedDescendantLayerToTraverse(*descendant, functor); |
| 3572 descendant = descendant->nextInPreOrderAfterChildren(&object); | 3553 descendant = descendant->nextInPreOrderAfterChildren(&object); |
| 3573 } | 3554 } |
| 3574 } | 3555 } |
| 3575 | 3556 |
| 3576 } // unnamed namespace | 3557 } // unnamed namespace |
| 3577 | 3558 |
| 3578 void LayoutObject::invalidateDisplayItemClientsIncludingNonCompositingDescendant s(const LayoutBoxModelObject* paintInvalidationContainer, PaintInvalidationReaso n paintInvalidationReason) const | 3559 void LayoutObject::invalidateDisplayItemClientsIncludingNonCompositingDescendant s(PaintInvalidationReason reason) const |
| 3579 { | 3560 { |
| 3580 // This is valid because we want to invalidate the client in the display ite m list of the current backing. | 3561 // This is valid because we want to invalidate the client in the display ite m list of the current backing. |
| 3581 DisableCompositingQueryAsserts disabler; | 3562 DisableCompositingQueryAsserts disabler; |
| 3582 if (!paintInvalidationContainer) { | |
| 3583 paintInvalidationContainer = enclosingCompositedContainer(); | |
| 3584 if (!paintInvalidationContainer) | |
| 3585 return; | |
| 3586 } | |
| 3587 | 3563 |
| 3588 traverseNonCompositingDescendants(const_cast<LayoutObject&>(*this), [&paintI nvalidationContainer, paintInvalidationReason](LayoutObject& object) { | 3564 slowSetPaintingLayerNeedsRepaint(); |
| 3589 if (object.hasLayer()) | 3565 traverseNonCompositingDescendants(const_cast<LayoutObject&>(*this), [reason] (LayoutObject& object) { |
| 3566 if (object.hasLayer() && toLayoutBoxModelObject(object).hasSelfPaintingL ayer()) | |
| 3590 toLayoutBoxModelObject(object).layer()->setNeedsRepaint(); | 3567 toLayoutBoxModelObject(object).layer()->setNeedsRepaint(); |
| 3591 object.invalidateDisplayItemClients(*paintInvalidationContainer, paintIn validationReason); | 3568 object.invalidateDisplayItemClients(reason); |
| 3592 }); | 3569 }); |
| 3593 } | 3570 } |
| 3594 | 3571 |
| 3595 void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBo xModelObject& paintInvalidationContainer, PaintInvalidationReason reason) | 3572 void LayoutObject::invalidatePaintOfPreviousPaintInvalidationRect(const LayoutBo xModelObject& paintInvalidationContainer, PaintInvalidationReason reason) |
| 3596 { | 3573 { |
| 3597 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set. | 3574 // It's caller's responsibility to ensure enclosingSelfPaintingLayer's needs Repaint is set. |
| 3598 // Don't set the flag here because getting enclosingSelfPaintLayer has cost and the caller can use | 3575 // Don't set the flag here because getting enclosingSelfPaintLayer has cost and the caller can use |
| 3599 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost. | 3576 // various ways (e.g. PaintInvalidatinState::enclosingSelfPaintingLayer()) t o reduce the cost. |
| 3600 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); | 3577 ASSERT(!paintingLayer() || paintingLayer()->needsRepaint()); |
| 3601 | 3578 |
| 3602 // These disablers are valid because we want to use the current compositing/ invalidation status. | 3579 // These disablers are valid because we want to use the current compositing/ invalidation status. |
| 3603 DisablePaintInvalidationStateAsserts invalidationDisabler; | 3580 DisablePaintInvalidationStateAsserts invalidationDisabler; |
| 3604 DisableCompositingQueryAsserts compositingDisabler; | 3581 DisableCompositingQueryAsserts compositingDisabler; |
| 3605 | 3582 |
| 3606 LayoutRect invalidationRect = previousPaintInvalidationRect(); | 3583 LayoutRect invalidationRect = previousPaintInvalidationRect(); |
| 3607 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, reason); | 3584 invalidatePaintUsingContainer(paintInvalidationContainer, invalidationRect, reason); |
| 3608 invalidateDisplayItemClients(paintInvalidationContainer, reason); | 3585 invalidateDisplayItemClients(reason); |
| 3609 | 3586 |
| 3610 // This method may be used to invalidate paint of an object changing paint i nvalidation container. | 3587 // This method may be used to invalidate paint of an object changing paint i nvalidation container. |
| 3611 // Clear previous paint invalidation rect on the original paint invalidation container to avoid | 3588 // Clear previous paint invalidation rect on the original paint invalidation container to avoid |
| 3612 // under-invalidation if the new paint invalidation rect on the new paint in validation container | 3589 // under-invalidation if the new paint invalidation rect on the new paint in validation container |
| 3613 // happens to be the same as the old one. | 3590 // happens to be the same as the old one. |
| 3614 clearPreviousPaintInvalidationRects(); | 3591 clearPreviousPaintInvalidationRects(); |
| 3615 } | 3592 } |
| 3616 | 3593 |
| 3617 void LayoutObject::invalidatePaintIncludingNonCompositingDescendants() | 3594 void LayoutObject::invalidatePaintIncludingNonCompositingDescendants() |
| 3618 { | 3595 { |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 3629 { | 3606 { |
| 3630 // Clear first because PaintInvalidationSubtree overrides other full paint i nvalidation reasons. | 3607 // Clear first because PaintInvalidationSubtree overrides other full paint i nvalidation reasons. |
| 3631 clearShouldDoFullPaintInvalidation(); | 3608 clearShouldDoFullPaintInvalidation(); |
| 3632 setShouldDoFullPaintInvalidation(PaintInvalidationSubtree); | 3609 setShouldDoFullPaintInvalidation(PaintInvalidationSubtree); |
| 3633 } | 3610 } |
| 3634 | 3611 |
| 3635 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendantsIntern al(const LayoutBoxModelObject& paintInvalidationContainer) | 3612 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendantsIntern al(const LayoutBoxModelObject& paintInvalidationContainer) |
| 3636 { | 3613 { |
| 3637 invalidatePaintOfPreviousPaintInvalidationRect(paintInvalidationContainer, P aintInvalidationSubtree); | 3614 invalidatePaintOfPreviousPaintInvalidationRect(paintInvalidationContainer, P aintInvalidationSubtree); |
| 3638 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { | 3615 for (LayoutObject* child = slowFirstChild(); child; child = child->nextSibli ng()) { |
| 3639 if (child->hasLayer()) | |
| 3640 toLayoutBoxModelObject(child)->layer()->setNeedsRepaint(); | |
| 3641 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel fPaintingLayer()) | 3616 if (!child->hasLayer() || !toLayoutBoxModelObject(child)->layer()->isSel fPaintingLayer()) |
| 3642 child->invalidatePaintIncludingNonSelfPaintingLayerDescendantsIntern al(paintInvalidationContainer); | 3617 child->invalidatePaintIncludingNonSelfPaintingLayerDescendantsIntern al(paintInvalidationContainer); |
| 3643 } | 3618 } |
| 3644 } | 3619 } |
| 3645 | 3620 |
| 3646 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer) | 3621 void LayoutObject::invalidatePaintIncludingNonSelfPaintingLayerDescendants(const LayoutBoxModelObject& paintInvalidationContainer) |
| 3647 { | 3622 { |
| 3648 setPaintingLayerNeedsRepaint(); | 3623 slowSetPaintingLayerNeedsRepaint(); |
| 3649 invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(paintInvalid ationContainer); | 3624 invalidatePaintIncludingNonSelfPaintingLayerDescendantsInternal(paintInvalid ationContainer); |
| 3650 } | 3625 } |
| 3651 | 3626 |
| 3652 void LayoutObject::setIsBackgroundAttachmentFixedObject(bool isBackgroundAttachm entFixedObject) | 3627 void LayoutObject::setIsBackgroundAttachmentFixedObject(bool isBackgroundAttachm entFixedObject) |
| 3653 { | 3628 { |
| 3654 ASSERT(frameView()); | 3629 ASSERT(frameView()); |
| 3655 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen tFixedObject) | 3630 if (m_bitfields.isBackgroundAttachmentFixedObject() == isBackgroundAttachmen tFixedObject) |
| 3656 return; | 3631 return; |
| 3657 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed Object); | 3632 m_bitfields.setIsBackgroundAttachmentFixedObject(isBackgroundAttachmentFixed Object); |
| 3658 if (isBackgroundAttachmentFixedObject) | 3633 if (isBackgroundAttachmentFixedObject) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3714 const blink::LayoutObject* root = object1; | 3689 const blink::LayoutObject* root = object1; |
| 3715 while (root->parent()) | 3690 while (root->parent()) |
| 3716 root = root->parent(); | 3691 root = root->parent(); |
| 3717 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3692 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3718 } else { | 3693 } else { |
| 3719 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3694 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3720 } | 3695 } |
| 3721 } | 3696 } |
| 3722 | 3697 |
| 3723 #endif | 3698 #endif |
| OLD | NEW |