Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 1777613002: Add localToAbsoluteTransform and localToAncestorTransform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments to LayoutObject.h Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2397 matching lines...) Expand 10 before | Expand all | Expand 10 after
2408 LayoutRect containerRect = LayoutRect(containerQuad.boundingBox()); 2408 LayoutRect containerRect = LayoutRect(containerQuad.boundingBox());
2409 if (containerRect.isEmpty()) { 2409 if (containerRect.isEmpty()) {
2410 rects.remove(i--); 2410 rects.remove(i--);
2411 continue; 2411 continue;
2412 } 2412 }
2413 containerRect.moveBy(postOffset); 2413 containerRect.moveBy(postOffset);
2414 rects[i] = containerRect; 2414 rects[i] = containerRect;
2415 } 2415 }
2416 } 2416 }
2417 2417
2418 TransformationMatrix LayoutObject::localToAncestorTransform(const LayoutBoxModel Object* ancestor, MapCoordinatesFlags mode, bool* wasFixed) const
2419 {
2420 TransformState transformState(TransformState::ApplyTransformDirection);
2421 mapLocalToAncestor(ancestor, transformState, mode | ApplyContainerFlip | Use Transforms, wasFixed);
2422 return transformState.accumulatedTransform();
2423 }
2424
2418 FloatPoint LayoutObject::localToInvalidationBackingPoint(const LayoutPoint& loca lPoint, PaintLayer** backingLayer) 2425 FloatPoint LayoutObject::localToInvalidationBackingPoint(const LayoutPoint& loca lPoint, PaintLayer** backingLayer)
2419 { 2426 {
2420 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn validation(); 2427 const LayoutBoxModelObject& paintInvalidationContainer = containerForPaintIn validation();
2421 ASSERT(paintInvalidationContainer.layer()); 2428 ASSERT(paintInvalidationContainer.layer());
2422 2429
2423 if (backingLayer) 2430 if (backingLayer)
2424 *backingLayer = paintInvalidationContainer.layer(); 2431 *backingLayer = paintInvalidationContainer.layer();
2425 FloatPoint containerPoint = localToAncestorPoint(FloatPoint(localPoint), &pa intInvalidationContainer, TraverseDocumentBoundaries); 2432 FloatPoint containerPoint = localToAncestorPoint(FloatPoint(localPoint), &pa intInvalidationContainer, TraverseDocumentBoundaries);
2426 2433
2427 // A layoutObject can have no invalidation backing if it is from a detached frame, 2434 // A layoutObject can have no invalidation backing if it is from a detached frame,
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3728 const blink::LayoutObject* root = object1; 3735 const blink::LayoutObject* root = object1;
3729 while (root->parent()) 3736 while (root->parent())
3730 root = root->parent(); 3737 root = root->parent();
3731 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3738 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3732 } else { 3739 } else {
3733 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3740 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3734 } 3741 }
3735 } 3742 }
3736 3743
3737 #endif 3744 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698