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 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 pos.move(box->locationOffset()); // FIXME: Snap offsets? crbug.c
om/350474 | 1312 pos.move(box->locationOffset()); // FIXME: Snap offsets? crbug.c
om/350474 |
1313 box->addFocusRingRects(rects, flooredIntPoint(pos), paintContain
er); | 1313 box->addFocusRingRects(rects, flooredIntPoint(pos), paintContain
er); |
1314 } | 1314 } |
1315 } else { | 1315 } else { |
1316 current->addFocusRingRects(rects, additionalOffset, paintContainer); | 1316 current->addFocusRingRects(rects, additionalOffset, paintContainer); |
1317 } | 1317 } |
1318 } | 1318 } |
1319 } | 1319 } |
1320 | 1320 |
1321 // FIXME: In repaint-after-layout, we should be able to change the logic to remo
ve the need for this function. See crbug.com/368416. | 1321 // FIXME: In repaint-after-layout, we should be able to change the logic to remo
ve the need for this function. See crbug.com/368416. |
1322 LayoutPoint RenderObject::positionFromPaintInvalidationContainer(const RenderLay
erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn
validationState) const | 1322 LayoutPoint RenderObject::positionFromPaintInvalidationContainer(const RenderLay
erModelObject* paintInvalidationContainer) const |
1323 { | 1323 { |
1324 // FIXME: This assert should be re-enabled when we move paint invalidation t
o after compositing update. crbug.com/360286 | 1324 // FIXME: This assert should be re-enabled when we move paint invalidation t
o after compositing update. crbug.com/360286 |
1325 // ASSERT(containerForPaintInvalidation() == paintInvalidationContainer); | 1325 // ASSERT(containerForPaintInvalidation() == paintInvalidationContainer); |
1326 | 1326 |
1327 LayoutPoint offset = isBox() ? toRenderBox(this)->location() : LayoutPoint()
; | 1327 LayoutPoint offset = isBox() ? toRenderBox(this)->location() : LayoutPoint()
; |
1328 if (paintInvalidationContainer == this) | 1328 if (paintInvalidationContainer == this) |
1329 return offset; | 1329 return offset; |
1330 | 1330 |
1331 return roundedIntPoint(localToContainerPoint(offset, paintInvalidationContai
ner, 0, 0, paintInvalidationState)); | 1331 return roundedIntPoint(localToContainerPoint(offset, paintInvalidationContai
ner)); |
1332 } | 1332 } |
1333 | 1333 |
1334 IntRect RenderObject::absoluteBoundingBoxRect() const | 1334 IntRect RenderObject::absoluteBoundingBoxRect() const |
1335 { | 1335 { |
1336 Vector<FloatQuad> quads; | 1336 Vector<FloatQuad> quads; |
1337 absoluteQuads(quads); | 1337 absoluteQuads(quads); |
1338 | 1338 |
1339 size_t n = quads.size(); | 1339 size_t n = quads.size(); |
1340 if (!n) | 1340 if (!n) |
1341 return IntRect(); | 1341 return IntRect(); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 } | 1467 } |
1468 | 1468 |
1469 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> jsonObjectForPaintInvali
dationInfo(const LayoutRect& rect, const String& invalidationReason) | 1469 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> jsonObjectForPaintInvali
dationInfo(const LayoutRect& rect, const String& invalidationReason) |
1470 { | 1470 { |
1471 TracedValue value; | 1471 TracedValue value; |
1472 addJsonObjectForRect(value, "rect", rect); | 1472 addJsonObjectForRect(value, "rect", rect); |
1473 value.setString("invalidation_reason", invalidationReason); | 1473 value.setString("invalidation_reason", invalidationReason); |
1474 return value.finish(); | 1474 return value.finish(); |
1475 } | 1475 } |
1476 | 1476 |
1477 LayoutRect RenderObject::computePaintInvalidationRect(const RenderLayerModelObje
ct* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationS
tate) const | 1477 LayoutRect RenderObject::computePaintInvalidationRect(const RenderLayerModelObje
ct* paintInvalidationContainer) const |
1478 { | 1478 { |
1479 return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer, p
aintInvalidationState); | 1479 return clippedOverflowRectForPaintInvalidation(paintInvalidationContainer); |
1480 } | 1480 } |
1481 | 1481 |
1482 void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* p
aintInvalidationContainer, const LayoutRect& r, InvalidationReason invalidationR
eason) const | 1482 void RenderObject::invalidatePaintUsingContainer(const RenderLayerModelObject* p
aintInvalidationContainer, const LayoutRect& r, InvalidationReason invalidationR
eason) const |
1483 { | 1483 { |
1484 if (r.isEmpty()) | 1484 if (r.isEmpty()) |
1485 return; | 1485 return; |
1486 | 1486 |
1487 // FIXME: This should be an assert, but editing/selection can trigger this c
ase to invalidate | 1487 // FIXME: This should be an assert, but editing/selection can trigger this c
ase to invalidate |
1488 // the selection. crbug.com/368140. | 1488 // the selection. crbug.com/368140. |
1489 if (!isRooted()) | 1489 if (!isRooted()) |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 return; // Don't invalidate paints if we're printing. | 1528 return; // Don't invalidate paints if we're printing. |
1529 | 1529 |
1530 // FIXME: really, we're in the paint invalidation phase here, and the follow
ing queries are legal. | 1530 // FIXME: really, we're in the paint invalidation phase here, and the follow
ing queries are legal. |
1531 // Until those states are fully fledged, I'll just disable the ASSERTS. | 1531 // Until those states are fully fledged, I'll just disable the ASSERTS. |
1532 DisableCompositingQueryAsserts disabler; | 1532 DisableCompositingQueryAsserts disabler; |
1533 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint
Invalidation(); | 1533 const RenderLayerModelObject* paintInvalidationContainer = containerForPaint
Invalidation(); |
1534 LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInval
idationContainer); | 1534 LayoutRect paintInvalidationRect = boundsRectForPaintInvalidation(paintInval
idationContainer); |
1535 invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationR
ect, InvalidationPaint); | 1535 invalidatePaintUsingContainer(paintInvalidationContainer, paintInvalidationR
ect, InvalidationPaint); |
1536 } | 1536 } |
1537 | 1537 |
1538 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb
ject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidatio
nState) const | 1538 LayoutRect RenderObject::boundsRectForPaintInvalidation(const RenderLayerModelOb
ject* paintInvalidationContainer) const |
1539 { | 1539 { |
1540 if (!paintInvalidationContainer) | 1540 if (!paintInvalidationContainer) |
1541 return computePaintInvalidationRect(paintInvalidationContainer, paintInv
alidationState); | 1541 return computePaintInvalidationRect(paintInvalidationContainer); |
1542 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont
ainer->layer(), paintInvalidationState); | 1542 return RenderLayer::computePaintInvalidationRect(this, paintInvalidationCont
ainer->layer()); |
1543 } | 1543 } |
1544 | 1544 |
1545 void RenderObject::invalidatePaintRectangle(const LayoutRect& r) const | 1545 void RenderObject::invalidatePaintRectangle(const LayoutRect& r) const |
1546 { | 1546 { |
1547 if (!isRooted()) | 1547 if (!isRooted()) |
1548 return; | 1548 return; |
1549 | 1549 |
1550 if (view()->document().printing()) | 1550 if (view()->document().printing()) |
1551 return; // Don't invalidate paints if we're printing. | 1551 return; // Don't invalidate paints if we're printing. |
1552 | 1552 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 return "layer"; | 1589 return "layer"; |
1590 case InvalidationPaint: | 1590 case InvalidationPaint: |
1591 return "invalidate paint"; | 1591 return "invalidate paint"; |
1592 case InvalidationPaintRectangle: | 1592 case InvalidationPaintRectangle: |
1593 return "invalidate paint rectangle"; | 1593 return "invalidate paint rectangle"; |
1594 } | 1594 } |
1595 ASSERT_NOT_REACHED(); | 1595 ASSERT_NOT_REACHED(); |
1596 return ""; | 1596 return ""; |
1597 } | 1597 } |
1598 | 1598 |
1599 void RenderObject::invalidateTreeAfterLayout(const PaintInvalidationState& paint
InvalidationState) | 1599 void RenderObject::invalidateTreeAfterLayout(const RenderLayerModelObject& paint
InvalidationContainer) |
1600 { | 1600 { |
1601 // If we didn't need paint invalidation then our children don't need as well
. | 1601 // If we didn't need paint invalidation then our children don't need as well
. |
1602 // Skip walking down the tree as everything should be fine below us. | 1602 // Skip walking down the tree as everything should be fine below us. |
1603 if (!shouldCheckForPaintInvalidationAfterLayout()) | 1603 if (!shouldCheckForPaintInvalidationAfterLayout()) |
1604 return; | 1604 return; |
1605 | 1605 |
1606 clearPaintInvalidationState(); | 1606 clearPaintInvalidationState(); |
1607 | 1607 |
1608 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { | 1608 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
1609 if (!child->isOutOfFlowPositioned()) | 1609 if (!child->isOutOfFlowPositioned()) |
1610 child->invalidateTreeAfterLayout(paintInvalidationState); | 1610 child->invalidateTreeAfterLayout(paintInvalidationContainer); |
1611 } | 1611 } |
1612 } | 1612 } |
1613 | 1613 |
1614 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> jsonObjectForOldAndNewRe
cts(const LayoutRect& oldRect, const LayoutRect& newRect) | 1614 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> jsonObjectForOldAndNewRe
cts(const LayoutRect& oldRect, const LayoutRect& newRect) |
1615 { | 1615 { |
1616 TracedValue value; | 1616 TracedValue value; |
1617 addJsonObjectForRect(value, "old", oldRect); | 1617 addJsonObjectForRect(value, "old", oldRect); |
1618 addJsonObjectForRect(value, "new", newRect); | 1618 addJsonObjectForRect(value, "new", newRect); |
1619 return value.finish(); | 1619 return value.finish(); |
1620 } | 1620 } |
1621 | 1621 |
1622 bool RenderObject::invalidatePaintIfNeeded(const RenderLayerModelObject& paintIn
validationContainer, const LayoutRect& oldBounds, const LayoutPoint& oldLocation
) | 1622 bool RenderObject::invalidatePaintIfNeeded(const RenderLayerModelObject* paintIn
validationContainer, const LayoutRect& oldBounds, const LayoutPoint& oldLocation
) |
1623 { | 1623 { |
1624 RenderView* v = view(); | 1624 RenderView* v = view(); |
1625 if (v->document().printing()) | 1625 if (v->document().printing()) |
1626 return false; // Don't invalidate paints if we're printing. | 1626 return false; // Don't invalidate paints if we're printing. |
1627 | 1627 |
1628 const LayoutRect& newBounds = previousPaintInvalidationRect(); | 1628 const LayoutRect& newBounds = previousPaintInvalidationRect(); |
1629 const LayoutPoint& newLocation = previousPositionFromPaintInvalidationContai
ner(); | 1629 const LayoutPoint& newLocation = previousPositionFromPaintInvalidationContai
ner(); |
1630 | 1630 |
1631 ASSERT(newBounds == boundsRectForPaintInvalidation(&paintInvalidationContain
er)); | 1631 ASSERT(newBounds == boundsRectForPaintInvalidation(paintInvalidationContaine
r)); |
1632 | 1632 |
1633 // FIXME: This should use a ConvertableToTraceFormat when they are available
in Blink. | 1633 // FIXME: This should use a ConvertableToTraceFormat when they are available
in Blink. |
1634 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject:
:invalidatePaintIfNeeded()", | 1634 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), "RenderObject:
:invalidatePaintIfNeeded()", |
1635 "object", this->debugName().ascii(), | 1635 "object", this->debugName().ascii(), |
1636 "info", jsonObjectForOldAndNewRects(oldBounds, newBounds)); | 1636 "info", jsonObjectForOldAndNewRects(oldBounds, newBounds)); |
1637 | 1637 |
1638 InvalidationReason invalidationReason = getPaintInvalidationReason(paintInva
lidationContainer, oldBounds, oldLocation, newBounds, newLocation); | 1638 InvalidationReason invalidationReason = getPaintInvalidationReason(paintInva
lidationContainer, oldBounds, oldLocation, newBounds, newLocation); |
1639 | 1639 |
1640 if (invalidationReason == InvalidationNone) | 1640 if (invalidationReason == InvalidationNone) |
1641 return false; | 1641 return false; |
1642 | 1642 |
1643 if (invalidationReason == InvalidationIncremental) { | 1643 if (invalidationReason == InvalidationIncremental) { |
1644 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB
ounds); | 1644 incrementallyInvalidatePaint(paintInvalidationContainer, oldBounds, newB
ounds); |
1645 return false; | 1645 return false; |
1646 } | 1646 } |
1647 | 1647 |
1648 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun
ds, newBounds); | 1648 fullyInvalidatePaint(paintInvalidationContainer, invalidationReason, oldBoun
ds, newBounds); |
1649 return true; | 1649 return true; |
1650 } | 1650 } |
1651 | 1651 |
1652 InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod
elObject& paintInvalidationContainer, | 1652 InvalidationReason RenderObject::getPaintInvalidationReason(const RenderLayerMod
elObject* paintInvalidationContainer, |
1653 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) | 1653 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec
t& newBounds, const LayoutPoint& newLocation) |
1654 { | 1654 { |
1655 if (shouldDoFullPaintInvalidationAfterLayout()) | 1655 if (shouldDoFullPaintInvalidationAfterLayout()) |
1656 return InvalidationFull; | 1656 return InvalidationFull; |
1657 | 1657 |
1658 // Presumably a background or a border exists if border-fit:lines was specif
ied. | 1658 // Presumably a background or a border exists if border-fit:lines was specif
ied. |
1659 if (style()->borderFit() == BorderFitLines) | 1659 if (style()->borderFit() == BorderFitLines) |
1660 return InvalidationBorderFitLines; | 1660 return InvalidationBorderFitLines; |
1661 | 1661 |
1662 if (compositingState() != PaintsIntoOwnBacking && newLocation != oldLocation
) | 1662 if (compositingState() != PaintsIntoOwnBacking && newLocation != oldLocation
) |
(...skipping 20 matching lines...) Expand all Loading... |
1683 // This covers the case where we mark containing blocks for layout | 1683 // This covers the case where we mark containing blocks for layout |
1684 // and they change size but don't have anything to paint. This is | 1684 // and they change size but don't have anything to paint. This is |
1685 // a pretty common case for <body> as we add / remove children | 1685 // a pretty common case for <body> as we add / remove children |
1686 // (and the default background is done by FrameView). | 1686 // (and the default background is done by FrameView). |
1687 if (skipInvalidationWhenLaidOutChildren() && !mayNeedPaintInvalidation()) | 1687 if (skipInvalidationWhenLaidOutChildren() && !mayNeedPaintInvalidation()) |
1688 return InvalidationNone; | 1688 return InvalidationNone; |
1689 | 1689 |
1690 return InvalidationIncremental; | 1690 return InvalidationIncremental; |
1691 } | 1691 } |
1692 | 1692 |
1693 void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject& pa
intInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBoun
ds) | 1693 void RenderObject::incrementallyInvalidatePaint(const RenderLayerModelObject* pa
intInvalidationContainer, const LayoutRect& oldBounds, const LayoutRect& newBoun
ds) |
1694 { | 1694 { |
| 1695 ASSERT(paintInvalidationContainer); |
| 1696 |
1695 ASSERT(oldBounds.location() == newBounds.location()); | 1697 ASSERT(oldBounds.location() == newBounds.location()); |
1696 | 1698 |
1697 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); | 1699 LayoutUnit deltaRight = newBounds.maxX() - oldBounds.maxX(); |
1698 if (deltaRight > 0) | 1700 if (deltaRight > 0) |
1699 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ol
dBounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncr
emental); | 1701 invalidatePaintUsingContainer(paintInvalidationContainer, LayoutRect(old
Bounds.maxX(), newBounds.y(), deltaRight, newBounds.height()), InvalidationIncre
mental); |
1700 else if (deltaRight < 0) | 1702 else if (deltaRight < 0) |
1701 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ne
wBounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationInc
remental); | 1703 invalidatePaintUsingContainer(paintInvalidationContainer, LayoutRect(new
Bounds.maxX(), oldBounds.y(), -deltaRight, oldBounds.height()), InvalidationIncr
emental); |
1702 | 1704 |
1703 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); | 1705 LayoutUnit deltaBottom = newBounds.maxY() - oldBounds.maxY(); |
1704 if (deltaBottom > 0) | 1706 if (deltaBottom > 0) |
1705 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ne
wBounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom), InvalidationIncr
emental); | 1707 invalidatePaintUsingContainer(paintInvalidationContainer, LayoutRect(new
Bounds.x(), oldBounds.maxY(), newBounds.width(), deltaBottom), InvalidationIncre
mental); |
1706 else if (deltaBottom < 0) | 1708 else if (deltaBottom < 0) |
1707 invalidatePaintUsingContainer(&paintInvalidationContainer, LayoutRect(ol
dBounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom), InvalidationInc
remental); | 1709 invalidatePaintUsingContainer(paintInvalidationContainer, LayoutRect(old
Bounds.x(), newBounds.maxY(), oldBounds.width(), -deltaBottom), InvalidationIncr
emental); |
1708 } | 1710 } |
1709 | 1711 |
1710 void RenderObject::fullyInvalidatePaint(const RenderLayerModelObject& paintInval
idationContainer, InvalidationReason invalidationReason, const LayoutRect& oldBo
unds, const LayoutRect& newBounds) | 1712 void RenderObject::fullyInvalidatePaint(const RenderLayerModelObject* paintInval
idationContainer, InvalidationReason invalidationReason, const LayoutRect& oldBo
unds, const LayoutRect& newBounds) |
1711 { | 1713 { |
1712 // Otherwise do full paint invalidation. | 1714 // Otherwise do full paint invalidation. |
1713 invalidatePaintUsingContainer(&paintInvalidationContainer, oldBounds, invali
dationReason); | 1715 invalidatePaintUsingContainer(paintInvalidationContainer, oldBounds, invalid
ationReason); |
1714 if (newBounds != oldBounds) | 1716 if (newBounds != oldBounds) |
1715 invalidatePaintUsingContainer(&paintInvalidationContainer, newBounds, in
validationReason); | 1717 invalidatePaintUsingContainer(paintInvalidationContainer, newBounds, inv
alidationReason); |
1716 } | 1718 } |
1717 | 1719 |
1718 void RenderObject::invalidatePaintForOverflow() | 1720 void RenderObject::invalidatePaintForOverflow() |
1719 { | 1721 { |
1720 } | 1722 } |
1721 | 1723 |
1722 void RenderObject::invalidatePaintForOverflowIfNeeded() | 1724 void RenderObject::invalidatePaintForOverflowIfNeeded() |
1723 { | 1725 { |
1724 if (shouldInvalidateOverflowForPaint()) | 1726 if (shouldInvalidateOverflowForPaint()) |
1725 invalidatePaintForOverflow(); | 1727 invalidatePaintForOverflow(); |
1726 } | 1728 } |
1727 | 1729 |
1728 bool RenderObject::checkForPaintInvalidation() const | 1730 bool RenderObject::checkForPaintInvalidation() const |
1729 { | 1731 { |
1730 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); | 1732 return !document().view()->needsFullPaintInvalidation() && everHadLayout(); |
1731 } | 1733 } |
1732 | 1734 |
1733 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo
delObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInval
idationState* paintInvalidationState) const | 1735 LayoutRect RenderObject::rectWithOutlineForPaintInvalidation(const RenderLayerMo
delObject* paintInvalidationContainer, LayoutUnit outlineWidth) const |
1734 { | 1736 { |
1735 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai
ner, paintInvalidationState)); | 1737 LayoutRect r(clippedOverflowRectForPaintInvalidation(paintInvalidationContai
ner)); |
1736 r.inflate(outlineWidth); | 1738 r.inflate(outlineWidth); |
1737 return r; | 1739 return r; |
1738 } | 1740 } |
1739 | 1741 |
1740 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject*, const PaintInvalidationState*) const | 1742 LayoutRect RenderObject::clippedOverflowRectForPaintInvalidation(const RenderLay
erModelObject*) const |
1741 { | 1743 { |
1742 ASSERT_NOT_REACHED(); | 1744 ASSERT_NOT_REACHED(); |
1743 return LayoutRect(); | 1745 return LayoutRect(); |
1744 } | 1746 } |
1745 | 1747 |
1746 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, bool fixed, const PaintInvalida
tionState* paintInvalidationState) const | 1748 void RenderObject::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec
t* paintInvalidationContainer, LayoutRect& rect, bool fixed) const |
1747 { | 1749 { |
1748 if (paintInvalidationContainer == this) | 1750 if (paintInvalidationContainer == this) |
1749 return; | 1751 return; |
1750 | 1752 |
1751 if (RenderObject* o = parent()) { | 1753 if (RenderObject* o = parent()) { |
1752 if (o->isRenderBlockFlow()) { | 1754 if (o->isRenderBlockFlow()) { |
1753 RenderBlock* cb = toRenderBlock(o); | 1755 RenderBlock* cb = toRenderBlock(o); |
1754 if (cb->hasColumns()) | 1756 if (cb->hasColumns()) |
1755 cb->adjustRectForColumns(rect); | 1757 cb->adjustRectForColumns(rect); |
1756 } | 1758 } |
1757 | 1759 |
1758 if (o->hasOverflowClip()) { | 1760 if (o->hasOverflowClip()) { |
1759 RenderBox* boxParent = toRenderBox(o); | 1761 RenderBox* boxParent = toRenderBox(o); |
1760 boxParent->applyCachedClipAndScrollOffsetForRepaint(rect); | 1762 boxParent->applyCachedClipAndScrollOffsetForRepaint(rect); |
1761 if (rect.isEmpty()) | 1763 if (rect.isEmpty()) |
1762 return; | 1764 return; |
1763 } | 1765 } |
1764 | 1766 |
1765 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, f
ixed, paintInvalidationState); | 1767 o->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, f
ixed); |
1766 } | 1768 } |
1767 } | 1769 } |
1768 | 1770 |
1769 void RenderObject::computeFloatRectForPaintInvalidation(const RenderLayerModelOb
ject*, FloatRect&, bool, const PaintInvalidationState*) const | 1771 void RenderObject::computeFloatRectForPaintInvalidation(const RenderLayerModelOb
ject*, FloatRect&, bool) const |
1770 { | 1772 { |
1771 ASSERT_NOT_REACHED(); | 1773 ASSERT_NOT_REACHED(); |
1772 } | 1774 } |
1773 | 1775 |
1774 void RenderObject::dirtyLinesFromChangedChild(RenderObject*) | 1776 void RenderObject::dirtyLinesFromChangedChild(RenderObject*) |
1775 { | 1777 { |
1776 } | 1778 } |
1777 | 1779 |
1778 #ifndef NDEBUG | 1780 #ifndef NDEBUG |
1779 | 1781 |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2309 } | 2311 } |
2310 | 2312 |
2311 FloatQuad RenderObject::absoluteToLocalQuad(const FloatQuad& quad, MapCoordinate
sFlags mode) const | 2313 FloatQuad RenderObject::absoluteToLocalQuad(const FloatQuad& quad, MapCoordinate
sFlags mode) const |
2312 { | 2314 { |
2313 TransformState transformState(TransformState::UnapplyInverseTransformDirecti
on, quad.boundingBox().center(), quad); | 2315 TransformState transformState(TransformState::UnapplyInverseTransformDirecti
on, quad.boundingBox().center(), quad); |
2314 mapAbsoluteToLocalPoint(mode, transformState); | 2316 mapAbsoluteToLocalPoint(mode, transformState); |
2315 transformState.flatten(); | 2317 transformState.flatten(); |
2316 return transformState.lastPlanarQuad(); | 2318 return transformState.lastPlanarQuad(); |
2317 } | 2319 } |
2318 | 2320 |
2319 void RenderObject::mapLocalToContainer(const RenderLayerModelObject* paintInvali
dationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool*
wasFixed, const PaintInvalidationState* paintInvalidationState) const | 2321 void RenderObject::mapLocalToContainer(const RenderLayerModelObject* paintInvali
dationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool*
wasFixed) const |
2320 { | 2322 { |
2321 if (paintInvalidationContainer == this) | 2323 if (paintInvalidationContainer == this) |
2322 return; | 2324 return; |
2323 | 2325 |
2324 RenderObject* o = parent(); | 2326 RenderObject* o = parent(); |
2325 if (!o) | 2327 if (!o) |
2326 return; | 2328 return; |
2327 | 2329 |
2328 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. | 2330 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. |
2329 LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); | 2331 LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); |
2330 if (mode & ApplyContainerFlip && o->isBox()) { | 2332 if (mode & ApplyContainerFlip && o->isBox()) { |
2331 if (o->style()->isFlippedBlocksWritingMode()) | 2333 if (o->style()->isFlippedBlocksWritingMode()) |
2332 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColum
ns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint); | 2334 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColum
ns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint); |
2333 mode &= ~ApplyContainerFlip; | 2335 mode &= ~ApplyContainerFlip; |
2334 } | 2336 } |
2335 | 2337 |
2336 transformState.move(o->columnOffset(roundedLayoutPoint(transformState.mapped
Point()))); | 2338 transformState.move(o->columnOffset(roundedLayoutPoint(transformState.mapped
Point()))); |
2337 | 2339 |
2338 if (o->hasOverflowClip()) | 2340 if (o->hasOverflowClip()) |
2339 transformState.move(-toRenderBox(o)->scrolledContentOffset()); | 2341 transformState.move(-toRenderBox(o)->scrolledContentOffset()); |
2340 | 2342 |
2341 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, was
Fixed, paintInvalidationState); | 2343 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, was
Fixed); |
2342 } | 2344 } |
2343 | 2345 |
2344 const RenderObject* RenderObject::pushMappingToContainer(const RenderLayerModelO
bject* ancestorToStopAt, RenderGeometryMap& geometryMap) const | 2346 const RenderObject* RenderObject::pushMappingToContainer(const RenderLayerModelO
bject* ancestorToStopAt, RenderGeometryMap& geometryMap) const |
2345 { | 2347 { |
2346 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != this); | 2348 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != this); |
2347 | 2349 |
2348 RenderObject* container = parent(); | 2350 RenderObject* container = parent(); |
2349 if (!container) | 2351 if (!container) |
2350 return 0; | 2352 return 0; |
2351 | 2353 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2402 { | 2404 { |
2403 // Track the point at the center of the quad's bounding box. As mapLocalToCo
ntainer() calls offsetFromContainer(), | 2405 // Track the point at the center of the quad's bounding box. As mapLocalToCo
ntainer() calls offsetFromContainer(), |
2404 // it will use that point as the reference point to decide which column's tr
ansform to apply in multiple-column blocks. | 2406 // it will use that point as the reference point to decide which column's tr
ansform to apply in multiple-column blocks. |
2405 TransformState transformState(TransformState::ApplyTransformDirection, local
Quad.boundingBox().center(), localQuad); | 2407 TransformState transformState(TransformState::ApplyTransformDirection, local
Quad.boundingBox().center(), localQuad); |
2406 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed); | 2408 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed); |
2407 transformState.flatten(); | 2409 transformState.flatten(); |
2408 | 2410 |
2409 return transformState.lastPlanarQuad(); | 2411 return transformState.lastPlanarQuad(); |
2410 } | 2412 } |
2411 | 2413 |
2412 FloatPoint RenderObject::localToContainerPoint(const FloatPoint& localPoint, con
st RenderLayerModelObject* paintInvalidationContainer, MapCoordinatesFlags mode,
bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const | 2414 FloatPoint RenderObject::localToContainerPoint(const FloatPoint& localPoint, con
st RenderLayerModelObject* paintInvalidationContainer, MapCoordinatesFlags mode,
bool* wasFixed) const |
2413 { | 2415 { |
2414 TransformState transformState(TransformState::ApplyTransformDirection, local
Point); | 2416 TransformState transformState(TransformState::ApplyTransformDirection, local
Point); |
2415 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed, paintInvalidationState); | 2417 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed); |
2416 transformState.flatten(); | 2418 transformState.flatten(); |
2417 | 2419 |
2418 return transformState.lastPlanarPoint(); | 2420 return transformState.lastPlanarPoint(); |
2419 } | 2421 } |
2420 | 2422 |
2421 LayoutSize RenderObject::offsetFromContainer(const RenderObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const | 2423 LayoutSize RenderObject::offsetFromContainer(const RenderObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const |
2422 { | 2424 { |
2423 ASSERT(o == container()); | 2425 ASSERT(o == container()); |
2424 | 2426 |
2425 LayoutSize offset = o->columnOffset(point); | 2427 LayoutSize offset = o->columnOffset(point); |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3445 { | 3447 { |
3446 if (object1) { | 3448 if (object1) { |
3447 const WebCore::RenderObject* root = object1; | 3449 const WebCore::RenderObject* root = object1; |
3448 while (root->parent()) | 3450 while (root->parent()) |
3449 root = root->parent(); | 3451 root = root->parent(); |
3450 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3452 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3451 } | 3453 } |
3452 } | 3454 } |
3453 | 3455 |
3454 #endif | 3456 #endif |
OLD | NEW |