| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 LayoutSize containerOffset = repaintContainer->offsetFromAncestorContain
er(o); | 1706 LayoutSize containerOffset = repaintContainer->offsetFromAncestorContain
er(o); |
| 1707 transformState.move(-containerOffset.width(), -containerOffset.height(),
preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTrans
form); | 1707 transformState.move(-containerOffset.width(), -containerOffset.height(),
preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTrans
form); |
| 1708 return; | 1708 return; |
| 1709 } | 1709 } |
| 1710 | 1710 |
| 1711 mode &= ~ApplyContainerFlip; | 1711 mode &= ~ApplyContainerFlip; |
| 1712 | 1712 |
| 1713 o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed); | 1713 o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed); |
| 1714 } | 1714 } |
| 1715 | 1715 |
| 1716 const RenderObject* RenderBox::pushMappingToContainer(const RenderLayerModelObje
ct* ancestorToStopAt, RenderGeometryMap& geometryMap) const | |
| 1717 { | |
| 1718 ASSERT(ancestorToStopAt != this); | |
| 1719 | |
| 1720 bool ancestorSkipped; | |
| 1721 RenderObject* container = this->container(ancestorToStopAt, &ancestorSkipped
); | |
| 1722 if (!container) | |
| 1723 return 0; | |
| 1724 | |
| 1725 bool isFixedPos = style()->position() == FixedPosition; | |
| 1726 bool hasTransform = hasLayer() && layer()->transform(); | |
| 1727 | |
| 1728 LayoutSize adjustmentForSkippedAncestor; | |
| 1729 if (ancestorSkipped) { | |
| 1730 // There can't be a transform between repaintContainer and o, because tr
ansforms create containers, so it should be safe | |
| 1731 // to just subtract the delta between the ancestor and o. | |
| 1732 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont
ainer(container); | |
| 1733 } | |
| 1734 | |
| 1735 bool offsetDependsOnPoint = false; | |
| 1736 LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), &
offsetDependsOnPoint); | |
| 1737 | |
| 1738 bool preserve3D = container->style()->preserves3D() || style()->preserves3D(
); | |
| 1739 if (shouldUseTransformFromContainer(container)) { | |
| 1740 TransformationMatrix t; | |
| 1741 getTransformFromContainer(container, containerOffset, t); | |
| 1742 t.translateRight(adjustmentForSkippedAncestor.width(), adjustmentForSkip
pedAncestor.height()); | |
| 1743 | |
| 1744 geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, isFixedPos,
hasTransform); | |
| 1745 } else { | |
| 1746 containerOffset += adjustmentForSkippedAncestor; | |
| 1747 geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint
, isFixedPos, hasTransform); | |
| 1748 } | |
| 1749 | |
| 1750 return ancestorSkipped ? ancestorToStopAt : container; | |
| 1751 } | |
| 1752 | |
| 1753 void RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState
& transformState) const | 1716 void RenderBox::mapAbsoluteToLocalPoint(MapCoordinatesFlags mode, TransformState
& transformState) const |
| 1754 { | 1717 { |
| 1755 // We don't expect to be called during layout. | 1718 // We don't expect to be called during layout. |
| 1756 ASSERT(!view() || !view()->layoutStateEnabled()); | 1719 ASSERT(!view() || !view()->layoutStateEnabled()); |
| 1757 | 1720 |
| 1758 bool isFixedPos = style()->position() == FixedPosition; | 1721 bool isFixedPos = style()->position() == FixedPosition; |
| 1759 bool hasTransform = hasLayer() && layer()->transform(); | 1722 bool hasTransform = hasLayer() && layer()->transform(); |
| 1760 if (hasTransform && !isFixedPos) { | 1723 if (hasTransform && !isFixedPos) { |
| 1761 // If this box has a transform, it acts as a fixed position container fo
r fixed descendants, | 1724 // If this box has a transform, it acts as a fixed position container fo
r fixed descendants, |
| 1762 // and may itself also be fixed position. So propagate 'fixed' up only i
f this box is fixed position. | 1725 // and may itself also be fixed position. So propagate 'fixed' up only i
f this box is fixed position. |
| (...skipping 2835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4598 | 4561 |
| 4599 void RenderBox::reportStaticMembersMemoryUsage(MemoryInstrumentation* memoryInst
rumentation) | 4562 void RenderBox::reportStaticMembersMemoryUsage(MemoryInstrumentation* memoryInst
rumentation) |
| 4600 { | 4563 { |
| 4601 memoryInstrumentation->addRootObject(gOverrideHeightMap, WebCoreMemoryTypes:
:RenderingStructures); | 4564 memoryInstrumentation->addRootObject(gOverrideHeightMap, WebCoreMemoryTypes:
:RenderingStructures); |
| 4602 memoryInstrumentation->addRootObject(gOverrideWidthMap, WebCoreMemoryTypes::
RenderingStructures); | 4565 memoryInstrumentation->addRootObject(gOverrideWidthMap, WebCoreMemoryTypes::
RenderingStructures); |
| 4603 memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalHeightMa
p, WebCoreMemoryTypes::RenderingStructures); | 4566 memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalHeightMa
p, WebCoreMemoryTypes::RenderingStructures); |
| 4604 memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalWidthMap
, WebCoreMemoryTypes::RenderingStructures); | 4567 memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalWidthMap
, WebCoreMemoryTypes::RenderingStructures); |
| 4605 } | 4568 } |
| 4606 | 4569 |
| 4607 } // namespace WebCore | 4570 } // namespace WebCore |
| OLD | NEW |