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 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 | 2308 |
2309 TransformationMatrix LayoutObject::localToAncestorTransform( | 2309 TransformationMatrix LayoutObject::localToAncestorTransform( |
2310 const LayoutBoxModelObject* ancestor, | 2310 const LayoutBoxModelObject* ancestor, |
2311 MapCoordinatesFlags mode) const { | 2311 MapCoordinatesFlags mode) const { |
2312 TransformState transformState(TransformState::ApplyTransformDirection); | 2312 TransformState transformState(TransformState::ApplyTransformDirection); |
2313 mapLocalToAncestor(ancestor, transformState, | 2313 mapLocalToAncestor(ancestor, transformState, |
2314 mode | ApplyContainerFlip | UseTransforms); | 2314 mode | ApplyContainerFlip | UseTransforms); |
2315 return transformState.accumulatedTransform(); | 2315 return transformState.accumulatedTransform(); |
2316 } | 2316 } |
2317 | 2317 |
2318 FloatPoint LayoutObject::localToInvalidationBackingPoint( | |
2319 const LayoutPoint& localPoint, | |
2320 PaintLayer** backingLayer) { | |
2321 const LayoutBoxModelObject& paintInvalidationContainer = | |
2322 containerForPaintInvalidation(); | |
2323 DCHECK(paintInvalidationContainer.layer()); | |
2324 | |
2325 if (backingLayer) | |
2326 *backingLayer = paintInvalidationContainer.layer(); | |
2327 FloatPoint containerPoint = | |
2328 localToAncestorPoint(FloatPoint(localPoint), &paintInvalidationContainer, | |
2329 TraverseDocumentBoundaries); | |
2330 | |
2331 // A layoutObject can have no invalidation backing if it is from a detached | |
2332 // frame, or when forced compositing is disabled. | |
2333 if (paintInvalidationContainer.layer()->compositingState() == NotComposited) | |
2334 return containerPoint; | |
2335 | |
2336 PaintLayer::mapPointInPaintInvalidationContainerToBacking( | |
2337 paintInvalidationContainer, containerPoint); | |
2338 | |
2339 if (GraphicsLayer* backingLayer = | |
2340 paintInvalidationContainer.layer()->graphicsLayerBacking(this)) { | |
2341 containerPoint.move(-backingLayer->offsetFromLayoutObject()); | |
2342 } | |
2343 | |
2344 return containerPoint; | |
2345 } | |
2346 | |
2347 LayoutSize LayoutObject::offsetFromContainer(const LayoutObject* o) const { | 2318 LayoutSize LayoutObject::offsetFromContainer(const LayoutObject* o) const { |
2348 ASSERT(o == container()); | 2319 ASSERT(o == container()); |
2349 return o->hasOverflowClip() | 2320 return o->hasOverflowClip() |
2350 ? LayoutSize(-toLayoutBox(o)->scrolledContentOffset()) | 2321 ? LayoutSize(-toLayoutBox(o)->scrolledContentOffset()) |
2351 : LayoutSize(); | 2322 : LayoutSize(); |
2352 } | 2323 } |
2353 | 2324 |
2354 LayoutSize LayoutObject::offsetFromAncestorContainer( | 2325 LayoutSize LayoutObject::offsetFromAncestorContainer( |
2355 const LayoutObject* ancestorContainer) const { | 2326 const LayoutObject* ancestorContainer) const { |
2356 if (ancestorContainer == this) | 2327 if (ancestorContainer == this) |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3537 const blink::LayoutObject* root = object1; | 3508 const blink::LayoutObject* root = object1; |
3538 while (root->parent()) | 3509 while (root->parent()) |
3539 root = root->parent(); | 3510 root = root->parent(); |
3540 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3511 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3541 } else { | 3512 } else { |
3542 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3513 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3543 } | 3514 } |
3544 } | 3515 } |
3545 | 3516 |
3546 #endif | 3517 #endif |
OLD | NEW |