| 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 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 } | 1137 } |
| 1138 } | 1138 } |
| 1139 | 1139 |
| 1140 LayoutPoint RenderObject::positionFromPaintInvalidationContainer(const RenderLay
erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn
validationState) const | 1140 LayoutPoint RenderObject::positionFromPaintInvalidationContainer(const RenderLay
erModelObject* paintInvalidationContainer, const PaintInvalidationState* paintIn
validationState) const |
| 1141 { | 1141 { |
| 1142 ASSERT(containerForPaintInvalidation() == paintInvalidationContainer); | 1142 ASSERT(containerForPaintInvalidation() == paintInvalidationContainer); |
| 1143 | 1143 |
| 1144 if (paintInvalidationContainer == this) | 1144 if (paintInvalidationContainer == this) |
| 1145 return LayoutPoint(); | 1145 return LayoutPoint(); |
| 1146 | 1146 |
| 1147 return LayoutPoint(localToContainerPoint(LayoutPoint(), paintInvalidationCon
tainer, 0, 0, paintInvalidationState)); | 1147 return LayoutPoint(localToContainerPoint(LayoutPoint(), paintInvalidationCon
tainer, 0, paintInvalidationState)); |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 IntRect RenderObject::absoluteBoundingBoxRect() const | 1150 IntRect RenderObject::absoluteBoundingBoxRect() const |
| 1151 { | 1151 { |
| 1152 Vector<FloatQuad> quads; | 1152 Vector<FloatQuad> quads; |
| 1153 absoluteQuads(quads); | 1153 absoluteQuads(quads); |
| 1154 | 1154 |
| 1155 size_t n = quads.size(); | 1155 size_t n = quads.size(); |
| 1156 if (!n) | 1156 if (!n) |
| 1157 return IntRect(); | 1157 return IntRect(); |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2012 } | 2012 } |
| 2013 | 2013 |
| 2014 FloatQuad RenderObject::absoluteToLocalQuad(const FloatQuad& quad, MapCoordinate
sFlags mode) const | 2014 FloatQuad RenderObject::absoluteToLocalQuad(const FloatQuad& quad, MapCoordinate
sFlags mode) const |
| 2015 { | 2015 { |
| 2016 TransformState transformState(TransformState::UnapplyInverseTransformDirecti
on, quad.boundingBox().center(), quad); | 2016 TransformState transformState(TransformState::UnapplyInverseTransformDirecti
on, quad.boundingBox().center(), quad); |
| 2017 mapAbsoluteToLocalPoint(mode, transformState); | 2017 mapAbsoluteToLocalPoint(mode, transformState); |
| 2018 transformState.flatten(); | 2018 transformState.flatten(); |
| 2019 return transformState.lastPlanarQuad(); | 2019 return transformState.lastPlanarQuad(); |
| 2020 } | 2020 } |
| 2021 | 2021 |
| 2022 void RenderObject::mapLocalToContainer(const RenderLayerModelObject* paintInvali
dationContainer, TransformState& transformState, MapCoordinatesFlags mode, bool*
wasFixed, const PaintInvalidationState* paintInvalidationState) const | 2022 void RenderObject::mapLocalToContainer(const RenderLayerModelObject* paintInvali
dationContainer, TransformState& transformState, MapCoordinatesFlags mode, const
PaintInvalidationState* paintInvalidationState) const |
| 2023 { | 2023 { |
| 2024 if (paintInvalidationContainer == this) | 2024 if (paintInvalidationContainer == this) |
| 2025 return; | 2025 return; |
| 2026 | 2026 |
| 2027 RenderObject* o = parent(); | 2027 RenderObject* o = parent(); |
| 2028 if (!o) | 2028 if (!o) |
| 2029 return; | 2029 return; |
| 2030 | 2030 |
| 2031 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. | 2031 // FIXME: this should call offsetFromContainer to share code, but I'm not su
re it's ever called. |
| 2032 LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); | 2032 LayoutPoint centerPoint = roundedLayoutPoint(transformState.mappedPoint()); |
| 2033 if (mode & ApplyContainerFlip && o->isBox()) { | 2033 if (mode & ApplyContainerFlip && o->isBox()) { |
| 2034 if (o->style()->isFlippedBlocksWritingMode()) | 2034 if (o->style()->isFlippedBlocksWritingMode()) |
| 2035 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColum
ns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint); | 2035 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColum
ns(roundedLayoutPoint(transformState.mappedPoint())) - centerPoint); |
| 2036 mode &= ~ApplyContainerFlip; | 2036 mode &= ~ApplyContainerFlip; |
| 2037 } | 2037 } |
| 2038 | 2038 |
| 2039 if (o->hasOverflowClip()) | 2039 if (o->hasOverflowClip()) |
| 2040 transformState.move(-toRenderBox(o)->scrolledContentOffset()); | 2040 transformState.move(-toRenderBox(o)->scrolledContentOffset()); |
| 2041 | 2041 |
| 2042 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, was
Fixed, paintInvalidationState); | 2042 o->mapLocalToContainer(paintInvalidationContainer, transformState, mode, pai
ntInvalidationState); |
| 2043 } | 2043 } |
| 2044 | 2044 |
| 2045 const RenderObject* RenderObject::pushMappingToContainer(const RenderLayerModelO
bject* ancestorToStopAt, RenderGeometryMap& geometryMap) const | 2045 const RenderObject* RenderObject::pushMappingToContainer(const RenderLayerModelO
bject* ancestorToStopAt, RenderGeometryMap& geometryMap) const |
| 2046 { | 2046 { |
| 2047 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != this); | 2047 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != this); |
| 2048 | 2048 |
| 2049 RenderObject* container = parent(); | 2049 RenderObject* container = parent(); |
| 2050 if (!container) | 2050 if (!container) |
| 2051 return 0; | 2051 return 0; |
| 2052 | 2052 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2092 | 2092 |
| 2093 TransformationMatrix perspectiveMatrix; | 2093 TransformationMatrix perspectiveMatrix; |
| 2094 perspectiveMatrix.applyPerspective(containerObject->style()->perspective
()); | 2094 perspectiveMatrix.applyPerspective(containerObject->style()->perspective
()); |
| 2095 | 2095 |
| 2096 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y(
), 0); | 2096 transform.translateRight3d(-perspectiveOrigin.x(), -perspectiveOrigin.y(
), 0); |
| 2097 transform = perspectiveMatrix * transform; | 2097 transform = perspectiveMatrix * transform; |
| 2098 transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(),
0); | 2098 transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(),
0); |
| 2099 } | 2099 } |
| 2100 } | 2100 } |
| 2101 | 2101 |
| 2102 FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, const R
enderLayerModelObject* paintInvalidationContainer, MapCoordinatesFlags mode, boo
l* wasFixed) const | 2102 FloatQuad RenderObject::localToContainerQuad(const FloatQuad& localQuad, const R
enderLayerModelObject* paintInvalidationContainer, MapCoordinatesFlags mode) con
st |
| 2103 { | 2103 { |
| 2104 // Track the point at the center of the quad's bounding box. As mapLocalToCo
ntainer() calls offsetFromContainer(), | 2104 // Track the point at the center of the quad's bounding box. As mapLocalToCo
ntainer() calls offsetFromContainer(), |
| 2105 // it will use that point as the reference point to decide which column's tr
ansform to apply in multiple-column blocks. | 2105 // it will use that point as the reference point to decide which column's tr
ansform to apply in multiple-column blocks. |
| 2106 TransformState transformState(TransformState::ApplyTransformDirection, local
Quad.boundingBox().center(), localQuad); | 2106 TransformState transformState(TransformState::ApplyTransformDirection, local
Quad.boundingBox().center(), localQuad); |
| 2107 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed); | 2107 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms); |
| 2108 transformState.flatten(); | 2108 transformState.flatten(); |
| 2109 | 2109 |
| 2110 return transformState.lastPlanarQuad(); | 2110 return transformState.lastPlanarQuad(); |
| 2111 } | 2111 } |
| 2112 | 2112 |
| 2113 FloatPoint RenderObject::localToContainerPoint(const FloatPoint& localPoint, con
st RenderLayerModelObject* paintInvalidationContainer, MapCoordinatesFlags mode,
bool* wasFixed, const PaintInvalidationState* paintInvalidationState) const | 2113 FloatPoint RenderObject::localToContainerPoint(const FloatPoint& localPoint, con
st RenderLayerModelObject* paintInvalidationContainer, MapCoordinatesFlags mode,
const PaintInvalidationState* paintInvalidationState) const |
| 2114 { | 2114 { |
| 2115 TransformState transformState(TransformState::ApplyTransformDirection, local
Point); | 2115 TransformState transformState(TransformState::ApplyTransformDirection, local
Point); |
| 2116 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, wasFixed, paintInvalidationState); | 2116 mapLocalToContainer(paintInvalidationContainer, transformState, mode | Apply
ContainerFlip | UseTransforms, paintInvalidationState); |
| 2117 transformState.flatten(); | 2117 transformState.flatten(); |
| 2118 | 2118 |
| 2119 return transformState.lastPlanarPoint(); | 2119 return transformState.lastPlanarPoint(); |
| 2120 } | 2120 } |
| 2121 | 2121 |
| 2122 LayoutSize RenderObject::offsetFromContainer(const RenderObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const | 2122 LayoutSize RenderObject::offsetFromContainer(const RenderObject* o, const Layout
Point& point, bool* offsetDependsOnPoint) const |
| 2123 { | 2123 { |
| 2124 ASSERT(o == container()); | 2124 ASSERT(o == container()); |
| 2125 | 2125 |
| 2126 LayoutSize offset; | 2126 LayoutSize offset; |
| (...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2888 { | 2888 { |
| 2889 if (object1) { | 2889 if (object1) { |
| 2890 const blink::RenderObject* root = object1; | 2890 const blink::RenderObject* root = object1; |
| 2891 while (root->parent()) | 2891 while (root->parent()) |
| 2892 root = root->parent(); | 2892 root = root->parent(); |
| 2893 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 2893 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 2894 } | 2894 } |
| 2895 } | 2895 } |
| 2896 | 2896 |
| 2897 #endif | 2897 #endif |
| OLD | NEW |