| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "core/layout/LayoutScrollbarPart.h" | 66 #include "core/layout/LayoutScrollbarPart.h" |
| 67 #include "core/layout/LayoutTableCaption.h" | 67 #include "core/layout/LayoutTableCaption.h" |
| 68 #include "core/layout/LayoutTableCell.h" | 68 #include "core/layout/LayoutTableCell.h" |
| 69 #include "core/layout/LayoutTableCol.h" | 69 #include "core/layout/LayoutTableCol.h" |
| 70 #include "core/layout/LayoutTableRow.h" | 70 #include "core/layout/LayoutTableRow.h" |
| 71 #include "core/layout/LayoutTheme.h" | 71 #include "core/layout/LayoutTheme.h" |
| 72 #include "core/layout/LayoutView.h" | 72 #include "core/layout/LayoutView.h" |
| 73 #include "core/layout/compositing/PaintLayerCompositor.h" | 73 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 74 #include "core/page/AutoscrollController.h" | 74 #include "core/page/AutoscrollController.h" |
| 75 #include "core/page/Page.h" | 75 #include "core/page/Page.h" |
| 76 #include "core/paint/LineBoxListPainter.h" |
| 76 #include "core/paint/ObjectPaintProperties.h" | 77 #include "core/paint/ObjectPaintProperties.h" |
| 77 #include "core/paint/ObjectPainter.h" | 78 #include "core/paint/ObjectPainter.h" |
| 78 #include "core/paint/PaintInfo.h" | 79 #include "core/paint/PaintInfo.h" |
| 79 #include "core/paint/PaintLayer.h" | 80 #include "core/paint/PaintLayer.h" |
| 80 #include "core/style/ContentData.h" | 81 #include "core/style/ContentData.h" |
| 81 #include "core/style/ShadowList.h" | 82 #include "core/style/ShadowList.h" |
| 82 #include "platform/HostWindow.h" | 83 #include "platform/HostWindow.h" |
| 83 #include "platform/RuntimeEnabledFeatures.h" | 84 #include "platform/RuntimeEnabledFeatures.h" |
| 84 #include "platform/TraceEvent.h" | 85 #include "platform/TraceEvent.h" |
| 85 #include "platform/TracedValue.h" | 86 #include "platform/TracedValue.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 , m_node(node) | 248 , m_node(node) |
| 248 , m_parent(nullptr) | 249 , m_parent(nullptr) |
| 249 , m_previous(nullptr) | 250 , m_previous(nullptr) |
| 250 , m_next(nullptr) | 251 , m_next(nullptr) |
| 251 #if ENABLE(ASSERT) | 252 #if ENABLE(ASSERT) |
| 252 , m_hasAXObject(false) | 253 , m_hasAXObject(false) |
| 253 , m_setNeedsLayoutForbidden(false) | 254 , m_setNeedsLayoutForbidden(false) |
| 254 #endif | 255 #endif |
| 255 , m_bitfields(node) | 256 , m_bitfields(node) |
| 256 { | 257 { |
| 257 // TODO(wangxianzhu): Move this into initialization list when we enable the
feature by default. | |
| 258 if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()) | |
| 259 m_previousPositionFromPaintInvalidationBacking = uninitializedPaintOffse
t(); | |
| 260 | |
| 261 #ifndef NDEBUG | 258 #ifndef NDEBUG |
| 262 layoutObjectCounter().increment(); | 259 layoutObjectCounter().increment(); |
| 263 #endif | 260 #endif |
| 264 InstanceCounters::incrementCounter(InstanceCounters::LayoutObjectCounter); | 261 InstanceCounters::incrementCounter(InstanceCounters::LayoutObjectCounter); |
| 265 } | 262 } |
| 266 | 263 |
| 267 LayoutObject::~LayoutObject() | 264 LayoutObject::~LayoutObject() |
| 268 { | 265 { |
| 269 ASSERT(!m_hasAXObject); | 266 ASSERT(!m_hasAXObject); |
| 270 #ifndef NDEBUG | 267 #ifndef NDEBUG |
| (...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1413 PaintLayer& layer = paintInvalidationState.enclosingSelfPaintingLayer(*t
his); | 1410 PaintLayer& layer = paintInvalidationState.enclosingSelfPaintingLayer(*t
his); |
| 1414 if (layer.layoutObject() != this) | 1411 if (layer.layoutObject() != this) |
| 1415 layer.setNeedsPaintPhaseDescendantOutlines(); | 1412 layer.setNeedsPaintPhaseDescendantOutlines(); |
| 1416 } | 1413 } |
| 1417 | 1414 |
| 1418 LayoutView* v = view(); | 1415 LayoutView* v = view(); |
| 1419 if (v->document().printing()) | 1416 if (v->document().printing()) |
| 1420 return PaintInvalidationNone; // Don't invalidate paints if we're printi
ng. | 1417 return PaintInvalidationNone; // Don't invalidate paints if we're printi
ng. |
| 1421 | 1418 |
| 1422 const LayoutRect oldBounds = previousPaintInvalidationRect(); | 1419 const LayoutRect oldBounds = previousPaintInvalidationRect(); |
| 1423 const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintOffsetC
achingEnabled() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking()
; | 1420 const LayoutPoint oldLocation = RuntimeEnabledFeatures::slimmingPaintV2Enabl
ed() ? LayoutPoint() : previousPositionFromPaintInvalidationBacking(); |
| 1424 LayoutRect newBounds = boundsRectForPaintInvalidation(paintInvalidationConta
iner, &paintInvalidationState); | 1421 LayoutRect newBounds = boundsRectForPaintInvalidation(paintInvalidationConta
iner, &paintInvalidationState); |
| 1425 LayoutPoint newLocation = RuntimeEnabledFeatures::slimmingPaintOffsetCaching
Enabled() ? LayoutPoint() : PaintLayer::positionFromPaintInvalidationBacking(thi
s, &paintInvalidationContainer, &paintInvalidationState); | 1422 LayoutPoint newLocation = RuntimeEnabledFeatures::slimmingPaintV2Enabled() ?
LayoutPoint() : PaintLayer::positionFromPaintInvalidationBacking(this, &paintIn
validationContainer, &paintInvalidationState); |
| 1426 | 1423 |
| 1427 // Composited scrolling should not be included in the bounds and position tr
acking, because the graphics layer backing the scroller | 1424 // Composited scrolling should not be included in the bounds and position tr
acking, because the graphics layer backing the scroller |
| 1428 // does not move on scroll. | 1425 // does not move on scroll. |
| 1429 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati
onContainer != this) { | 1426 if (paintInvalidationContainer.usesCompositedScrolling() && &paintInvalidati
onContainer != this) { |
| 1430 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol
ledContentOffset()); | 1427 LayoutSize inverseOffset(toLayoutBox(&paintInvalidationContainer)->scrol
ledContentOffset()); |
| 1431 newLocation.move(inverseOffset); | 1428 newLocation.move(inverseOffset); |
| 1432 newBounds.move(inverseOffset); | 1429 newBounds.move(inverseOffset); |
| 1433 } | 1430 } |
| 1434 | 1431 |
| 1435 setPreviousPaintInvalidationRect(newBounds); | 1432 setPreviousPaintInvalidationRect(newBounds); |
| 1436 if (!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled()) | 1433 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
| 1437 setPreviousPositionFromPaintInvalidationBacking(newLocation); | 1434 setPreviousPositionFromPaintInvalidationBacking(newLocation); |
| 1438 | 1435 |
| 1439 if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() &&
!paintInvalidationState.forcedSubtreeInvalidationWithinContainer()) { | 1436 if (!shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState() &&
!paintInvalidationState.forcedSubtreeInvalidationWithinContainer()) { |
| 1440 ASSERT(paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinC
ontainer()); | 1437 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
| 1438 || paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinC
ontainer()); |
| 1441 return PaintInvalidationNone; | 1439 return PaintInvalidationNone; |
| 1442 } | 1440 } |
| 1443 | 1441 |
| 1444 PaintInvalidationReason invalidationReason = paintInvalidationReason(paintIn
validationContainer, oldBounds, oldLocation, newBounds, newLocation); | 1442 PaintInvalidationReason invalidationReason = paintInvalidationReason(paintIn
validationContainer, oldBounds, oldLocation, newBounds, newLocation); |
| 1445 | 1443 |
| 1446 // We need to invalidate the selection before checking for whether we are do
ing a full invalidation. | 1444 // We need to invalidate the selection before checking for whether we are do
ing a full invalidation. |
| 1447 // This is because we need to update the old rect regardless. | 1445 // This is because we need to update the old rect regardless. |
| 1448 invalidateSelectionIfNeeded(paintInvalidationContainer, paintInvalidationSta
te, invalidationReason); | 1446 invalidateSelectionIfNeeded(paintInvalidationContainer, paintInvalidationSta
te, invalidationReason); |
| 1449 | 1447 |
| 1450 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject:
:invalidatePaintIfNeeded()", | 1448 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "LayoutObject:
:invalidatePaintIfNeeded()", |
| 1451 "object", this->debugName().ascii(), | 1449 "object", this->debugName().ascii(), |
| 1452 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n
ewLocation)); | 1450 "info", jsonObjectForOldAndNewRects(oldBounds, oldLocation, newBounds, n
ewLocation)); |
| 1453 | 1451 |
| 1454 bool boxDecorationBackgroundObscured = boxDecorationBackgroundIsKnownToBeObs
cured(); | 1452 bool boxDecorationBackgroundObscured = boxDecorationBackgroundIsKnownToBeObs
cured(); |
| 1455 if (!isFullPaintInvalidationReason(invalidationReason) && boxDecorationBackg
roundObscured != m_bitfields.lastBoxDecorationBackgroundObscured()) | 1453 if (!isFullPaintInvalidationReason(invalidationReason) && boxDecorationBackg
roundObscured != m_bitfields.lastBoxDecorationBackgroundObscured()) |
| 1456 invalidationReason = PaintInvalidationBackgroundObscurationChange; | 1454 invalidationReason = PaintInvalidationBackgroundObscurationChange; |
| 1457 m_bitfields.setLastBoxDecorationBackgroundObscured(boxDecorationBackgroundOb
scured); | 1455 m_bitfields.setLastBoxDecorationBackgroundObscured(boxDecorationBackgroundOb
scured); |
| 1458 | 1456 |
| 1459 if (invalidationReason == PaintInvalidationNone) { | 1457 if (invalidationReason == PaintInvalidationNone) { |
| 1460 // TODO(trchen): Currently we don't keep track of paint offset of layout
objects. | 1458 // TODO(trchen): Currently we don't keep track of paint offset of layout
objects. |
| 1461 // There are corner cases that the display items need to be invalidated
for paint offset | 1459 // There are corner cases that the display items need to be invalidated
for paint offset |
| 1462 // mutation, but incurs no pixel difference (i.e. bounds stay the same)
so no rect-based | 1460 // mutation, but incurs no pixel difference (i.e. bounds stay the same)
so no rect-based |
| 1463 // invalidation is issued. See crbug.com/508383 and crbug.com/515977. | 1461 // invalidation is issued. See crbug.com/508383 and crbug.com/515977. |
| 1464 // This is a workaround to force display items to update paint offset. | 1462 // This is a workaround to force display items to update paint offset. |
| 1465 if (!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && pain
tInvalidationState.forcedSubtreeInvalidationWithinContainer()) | 1463 if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled() && paintInvalidati
onState.forcedSubtreeInvalidationWithinContainer()) |
| 1466 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalida
tionContainer, paintInvalidationState, invalidationReason); | 1464 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalida
tionContainer, paintInvalidationState, invalidationReason); |
| 1467 | 1465 |
| 1468 return invalidationReason; | 1466 return invalidationReason; |
| 1469 } | 1467 } |
| 1470 | 1468 |
| 1471 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidationCont
ainer, paintInvalidationState, invalidationReason); | 1469 invalidateDisplayItemClientsWithPaintInvalidationState(paintInvalidationCont
ainer, paintInvalidationState, invalidationReason); |
| 1472 | 1470 |
| 1473 if (invalidationReason == PaintInvalidationIncremental) { | 1471 if (invalidationReason == PaintInvalidationIncremental) { |
| 1474 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB
ounds, newLocation); | 1472 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB
ounds, newLocation); |
| 1475 return invalidationReason; | 1473 return invalidationReason; |
| 1476 } | 1474 } |
| 1477 | 1475 |
| 1478 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun
ds, newBounds); | 1476 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun
ds, newBounds); |
| 1479 | 1477 |
| 1480 return invalidationReason; | 1478 return invalidationReason; |
| 1481 } | 1479 } |
| 1482 | 1480 |
| 1481 void LayoutObject::invalidatePaintIfNeededForSlimmingPaintV2(const PaintInfo& pa
intInfo, const LayoutPoint& paintOffset) |
| 1482 { |
| 1483 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 1484 |
| 1485 PaintController& paintController = paintInfo.context->paintController(); |
| 1486 |
| 1487 // In some cases, the caller doesn't have enough information to create paint
InvalidationState. |
| 1488 if (!paintInfo.paintInvalidationState) { |
| 1489 WTFLogAlways("No paint invalidation state for: %s\n", debugName().ascii(
).data()); |
| 1490 // TODO(wangxianzhu): What to do? |
| 1491 return; |
| 1492 } |
| 1493 |
| 1494 PaintInvalidationState& paintInvalidationState = *paintInfo.paintInvalidatio
nState; |
| 1495 |
| 1496 const LayoutBoxModelObject& paintInvalidationContainer = paintInvalidationSt
ate.paintInvalidationContainer(); |
| 1497 |
| 1498 if (!paintController.skippingCache() && paintOffsetChanged(paintOffset)) { |
| 1499 m_bitfields.setFullPaintInvalidationReason(PaintInvalidationLocationChan
ge); |
| 1500 setPreviousPaintOffset(paintOffset); |
| 1501 if (isLayoutInline() || (isLayoutBlock() && toLayoutBlock(this)->childre
nInline())) { |
| 1502 const LineBoxList& lineBoxList = isLayoutInline() ? *toLayoutInline(
this)->lineBoxes() : *toLayoutBlock(this)->lineBoxes(); |
| 1503 LineBoxListPainter(lineBoxList).invalidateLineBoxPaintOffsets(*this,
paintInfo); |
| 1504 } |
| 1505 } |
| 1506 |
| 1507 // Set paintInvalidationState's paint offset to that of the parent of this L
ayoutObject, to let |
| 1508 // invalidatePaintIfNeeded() and boundsRectForPaintInvalidation() work for t
his LayoutObject. |
| 1509 LayoutSize layerPaintOffset = paintInvalidationState.paintOffset(); |
| 1510 bool originalCachedOffsetsEnabled = paintInvalidationState.cachedOffsetsEnab
led(); |
| 1511 if (paintController.skippingCache()) { |
| 1512 paintInvalidationState.setCachedOffsetsEnabled(false); |
| 1513 } else if (paintInvalidationState.cachedOffsetsEnabled()) { |
| 1514 // The legacy paint invalidation code expects that the paint offset in P
aintInvalidationState |
| 1515 // is that of the container of the current object. |
| 1516 LayoutPoint containerPaintOffset = paintOffset + layerPaintOffset; |
| 1517 if (isBox()) |
| 1518 containerPaintOffset.moveBy(-toLayoutBox(this)->location()); |
| 1519 if (styleRef().hasInFlowPosition() && hasLayer()) |
| 1520 containerPaintOffset.move(-toLayoutBoxModelObject(this)->layer()->of
fsetForInFlowPosition()); |
| 1521 paintInvalidationState.setPaintOffset(toSize(containerPaintOffset)); |
| 1522 } |
| 1523 |
| 1524 PaintInvalidationReason reason = invalidatePaintIfNeeded(paintInvalidationSt
ate, paintInvalidationContainer); |
| 1525 clearPaintInvalidationState(paintInvalidationState); |
| 1526 |
| 1527 // Restore our own values after calling legacy paint invalidation code. |
| 1528 if (paintController.skippingCache()) |
| 1529 paintInvalidationState.setCachedOffsetsEnabled(originalCachedOffsetsEnab
led); |
| 1530 paintInvalidationState.setPaintOffset(layerPaintOffset); |
| 1531 |
| 1532 if (reason == PaintInvalidationDelayedFull) |
| 1533 setShouldDoFullPaintInvalidation(PaintInvalidationFull); |
| 1534 } |
| 1535 |
| 1483 PaintInvalidationReason LayoutObject::paintInvalidationReason(const LayoutBoxMod
elObject& paintInvalidationContainer, | 1536 PaintInvalidationReason LayoutObject::paintInvalidationReason(const LayoutBoxMod
elObject& paintInvalidationContainer, |
| 1484 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalida
tionBacking, | 1537 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInvalida
tionBacking, |
| 1485 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalida
tionBacking) const | 1538 const LayoutRect& newBounds, const LayoutPoint& newPositionFromPaintInvalida
tionBacking) const |
| 1486 { | 1539 { |
| 1487 // First check for InvalidationLocationChange to avoid it from being hidden
by other | 1540 // First check for InvalidationLocationChange to avoid it from being hidden
by other |
| 1488 // invalidation reasons because we'll need to force check for paint invalida
tion for | 1541 // invalidation reasons because we'll need to force check for paint invalida
tion for |
| 1489 // children when location of this object changed. | 1542 // children when location of this object changed. |
| 1490 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat
ionBacking) | 1543 if (newPositionFromPaintInvalidationBacking != oldPositionFromPaintInvalidat
ionBacking) |
| 1491 return PaintInvalidationLocationChange; | 1544 return PaintInvalidationLocationChange; |
| 1492 | 1545 |
| (...skipping 1901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3394 m_bitfields.setShouldInvalidateSelection(true); | 3447 m_bitfields.setShouldInvalidateSelection(true); |
| 3395 markContainerChainForPaintInvalidation(); | 3448 markContainerChainForPaintInvalidation(); |
| 3396 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); | 3449 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); |
| 3397 } | 3450 } |
| 3398 | 3451 |
| 3399 void LayoutObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reas
on) | 3452 void LayoutObject::setShouldDoFullPaintInvalidation(PaintInvalidationReason reas
on) |
| 3400 { | 3453 { |
| 3401 // Only full invalidation reasons are allowed. | 3454 // Only full invalidation reasons are allowed. |
| 3402 ASSERT(isFullPaintInvalidationReason(reason)); | 3455 ASSERT(isFullPaintInvalidationReason(reason)); |
| 3403 | 3456 |
| 3457 // TODO(wangxianzhu): This is temporary for table column rect-based paint in
validation in synchronized painting mode. |
| 3458 // We won't paint table columns during synchronized painting so won't call t
heir invalidatePaintIfNeeded(). |
| 3459 // Delegate their style-caused paint invalidation to their table just like t
heir invalidatePaintIfNeeded does. |
| 3460 // Remove this when we remove rect-based paint invalidation. |
| 3461 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 3462 if (isLayoutTableCol()) |
| 3463 toLayoutTableCol(this)->table()->setShouldDoFullPaintInvalidation(re
ason); |
| 3464 } |
| 3465 |
| 3404 bool isUpgradingDelayedFullToFull = m_bitfields.fullPaintInvalidationReason(
) == PaintInvalidationDelayedFull && reason != PaintInvalidationDelayedFull; | 3466 bool isUpgradingDelayedFullToFull = m_bitfields.fullPaintInvalidationReason(
) == PaintInvalidationDelayedFull && reason != PaintInvalidationDelayedFull; |
| 3405 | 3467 |
| 3406 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone || is
UpgradingDelayedFullToFull) { | 3468 if (m_bitfields.fullPaintInvalidationReason() == PaintInvalidationNone || is
UpgradingDelayedFullToFull) { |
| 3407 if (reason == PaintInvalidationFull) | 3469 if (reason == PaintInvalidationFull) |
| 3408 reason = documentLifecycleBasedPaintInvalidationReason(document().li
fecycle()); | 3470 reason = documentLifecycleBasedPaintInvalidationReason(document().li
fecycle()); |
| 3409 m_bitfields.setFullPaintInvalidationReason(reason); | 3471 m_bitfields.setFullPaintInvalidationReason(reason); |
| 3410 if (!isUpgradingDelayedFullToFull) | 3472 if (!isUpgradingDelayedFullToFull) |
| 3411 markContainerChainForPaintInvalidation(); | 3473 markContainerChainForPaintInvalidation(); |
| 3412 } | 3474 } |
| 3413 | 3475 |
| 3414 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); | 3476 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); |
| 3415 } | 3477 } |
| 3416 | 3478 |
| 3417 void LayoutObject::setMayNeedPaintInvalidation() | 3479 void LayoutObject::setMayNeedPaintInvalidation() |
| 3418 { | 3480 { |
| 3419 if (mayNeedPaintInvalidation()) | 3481 if (mayNeedPaintInvalidation()) |
| 3420 return; | 3482 return; |
| 3421 m_bitfields.setMayNeedPaintInvalidation(true); | 3483 m_bitfields.setMayNeedPaintInvalidation(true); |
| 3422 markContainerChainForPaintInvalidation(); | 3484 markContainerChainForPaintInvalidation(); |
| 3423 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); | 3485 frameView()->scheduleVisualUpdateForPaintInvalidationIfNeeded(); |
| 3424 } | 3486 } |
| 3425 | 3487 |
| 3426 void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& pai
ntInvalidationState) | 3488 void LayoutObject::clearPaintInvalidationState(const PaintInvalidationState& pai
ntInvalidationState) |
| 3427 { | 3489 { |
| 3428 // paintInvalidationStateIsDirty should be kept in sync with the | 3490 // paintInvalidationStateIsDirty should be kept in sync with the |
| 3429 // booleans that are cleared below. | 3491 // booleans that are cleared below. |
| 3430 ASSERT(paintInvalidationState.forcedSubtreeInvalidationWithinContainer() ||
paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinContainer() || p
aintInvalidationStateIsDirty()); | 3492 ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
| 3493 || paintInvalidationState.forcedSubtreeInvalidationWithinContainer() |
| 3494 || paintInvalidationState.forcedSubtreeInvalidationRectUpdateWithinConta
iner() |
| 3495 || paintInvalidationStateIsDirty()); |
| 3431 clearShouldDoFullPaintInvalidation(); | 3496 clearShouldDoFullPaintInvalidation(); |
| 3432 m_bitfields.setChildShouldCheckForPaintInvalidation(false); | 3497 m_bitfields.setChildShouldCheckForPaintInvalidation(false); |
| 3433 m_bitfields.setNeededLayoutBecauseOfChildren(false); | 3498 m_bitfields.setNeededLayoutBecauseOfChildren(false); |
| 3434 m_bitfields.setShouldInvalidateOverflowForPaint(false); | 3499 m_bitfields.setShouldInvalidateOverflowForPaint(false); |
| 3435 m_bitfields.setMayNeedPaintInvalidation(false); | 3500 m_bitfields.setMayNeedPaintInvalidation(false); |
| 3436 m_bitfields.setShouldInvalidateSelection(false); | 3501 m_bitfields.setShouldInvalidateSelection(false); |
| 3437 } | 3502 } |
| 3438 | 3503 |
| 3439 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) | 3504 bool LayoutObject::isAllowedToModifyLayoutTreeStructure(Document& document) |
| 3440 { | 3505 { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3666 const blink::LayoutObject* root = object1; | 3731 const blink::LayoutObject* root = object1; |
| 3667 while (root->parent()) | 3732 while (root->parent()) |
| 3668 root = root->parent(); | 3733 root = root->parent(); |
| 3669 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3734 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3670 } else { | 3735 } else { |
| 3671 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3736 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
| 3672 } | 3737 } |
| 3673 } | 3738 } |
| 3674 | 3739 |
| 3675 #endif | 3740 #endif |
| OLD | NEW |