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. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2231 0); | 2231 0); |
2232 transform = perspectiveMatrix * transform; | 2232 transform = perspectiveMatrix * transform; |
2233 transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(), 0); | 2233 transform.translateRight3d(perspectiveOrigin.x(), perspectiveOrigin.y(), 0); |
2234 } | 2234 } |
2235 } | 2235 } |
2236 | 2236 |
2237 FloatQuad LayoutObject::localToAncestorQuad( | 2237 FloatQuad LayoutObject::localToAncestorQuad( |
2238 const FloatQuad& localQuad, | 2238 const FloatQuad& localQuad, |
2239 const LayoutBoxModelObject* ancestor, | 2239 const LayoutBoxModelObject* ancestor, |
2240 MapCoordinatesFlags mode) const { | 2240 MapCoordinatesFlags mode) const { |
2241 return localToAncestorQuadWithoutTransforms(localQuad, ancestor, | |
2242 mode | UseTransforms); | |
2243 } | |
2244 | |
2245 FloatQuad LayoutObject::localToAncestorQuadWithoutTransforms( | |
Xianzhu
2017/01/24 22:53:11
I like the direction of the new code, but
localA
flackr
2017/01/25 13:23:24
Done.
| |
2246 const FloatQuad& localQuad, | |
2247 const LayoutBoxModelObject* ancestor, | |
2248 MapCoordinatesFlags mode) const { | |
2241 // Track the point at the center of the quad's bounding box. As | 2249 // Track the point at the center of the quad's bounding box. As |
2242 // mapLocalToAncestor() calls offsetFromContainer(), it will use that point | 2250 // mapLocalToAncestor() calls offsetFromContainer(), it will use that point |
2243 // as the reference point to decide which column's transform to apply in | 2251 // as the reference point to decide which column's transform to apply in |
2244 // multiple-column blocks. | 2252 // multiple-column blocks. |
2245 TransformState transformState(TransformState::ApplyTransformDirection, | 2253 TransformState transformState(TransformState::ApplyTransformDirection, |
2246 localQuad.boundingBox().center(), localQuad); | 2254 localQuad.boundingBox().center(), localQuad); |
2247 mapLocalToAncestor(ancestor, transformState, | 2255 mapLocalToAncestor(ancestor, transformState, mode | ApplyContainerFlip); |
2248 mode | ApplyContainerFlip | UseTransforms); | |
2249 transformState.flatten(); | 2256 transformState.flatten(); |
2250 | 2257 |
2251 return transformState.lastPlanarQuad(); | 2258 return transformState.lastPlanarQuad(); |
2252 } | 2259 } |
2253 | 2260 |
2254 FloatPoint LayoutObject::localToAncestorPoint( | 2261 FloatPoint LayoutObject::localToAncestorPoint( |
2255 const FloatPoint& localPoint, | 2262 const FloatPoint& localPoint, |
2256 const LayoutBoxModelObject* ancestor, | 2263 const LayoutBoxModelObject* ancestor, |
2257 MapCoordinatesFlags mode) const { | 2264 MapCoordinatesFlags mode) const { |
2258 TransformState transformState(TransformState::ApplyTransformDirection, | 2265 TransformState transformState(TransformState::ApplyTransformDirection, |
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3478 const blink::LayoutObject* root = object1; | 3485 const blink::LayoutObject* root = object1; |
3479 while (root->parent()) | 3486 while (root->parent()) |
3480 root = root->parent(); | 3487 root = root->parent(); |
3481 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3488 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3482 } else { | 3489 } else { |
3483 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3490 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3484 } | 3491 } |
3485 } | 3492 } |
3486 | 3493 |
3487 #endif | 3494 #endif |
OLD | NEW |