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

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

Issue 1777613002: Add localToAbsoluteTransform and localToAncestorTransform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback about comments 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 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) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. 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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 // Otherwise: 980 // Otherwise:
981 // If TraverseDocumentBoundaries is specified, the input quad is in the sp ace of the local root frame. 981 // If TraverseDocumentBoundaries is specified, the input quad is in the sp ace of the local root frame.
982 // Otherwise, the input quad is in the space of the containing frame. 982 // Otherwise, the input quad is in the space of the containing frame.
983 FloatQuad ancestorToLocalQuad(LayoutBoxModelObject*, const FloatQuad&, MapCo ordinatesFlags mode = 0) const; 983 FloatQuad ancestorToLocalQuad(LayoutBoxModelObject*, const FloatQuad&, MapCo ordinatesFlags mode = 0) const;
984 FloatQuad absoluteToLocalQuad(const FloatQuad& quad, MapCoordinatesFlags mod e = 0) const 984 FloatQuad absoluteToLocalQuad(const FloatQuad& quad, MapCoordinatesFlags mod e = 0) const
985 { 985 {
986 return ancestorToLocalQuad(nullptr, quad, mode); 986 return ancestorToLocalQuad(nullptr, quad, mode);
987 } 987 }
988 988
989 // Convert a local quad into the coordinate system of container, taking tran sforms into account. 989 // Convert a local quad into the coordinate system of container, taking tran sforms into account.
990 // If the LayoutBoxModelObject ancestor is non-null, the result will be in t he space of the ancestor.
991 // Otherwise:
992 // If TraverseDocumentBoundaries is specified, the result will be in the s pace of the local root frame.
993 // Otherwise, the result will be in the space of the containing frame.
990 FloatQuad localToAncestorQuad(const FloatQuad&, const LayoutBoxModelObject* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const; 994 FloatQuad localToAncestorQuad(const FloatQuad&, const LayoutBoxModelObject* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const;
991 FloatPoint localToAncestorPoint(const FloatPoint&, const LayoutBoxModelObjec t* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr, const PaintInval idationState* = nullptr) const; 995 FloatPoint localToAncestorPoint(const FloatPoint&, const LayoutBoxModelObjec t* ancestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr, const PaintInval idationState* = nullptr) const;
992 void localToAncestorRects(Vector<LayoutRect>&, const LayoutBoxModelObject* a ncestor, const LayoutPoint& preOffset, const LayoutPoint& postOffset) const; 996 void localToAncestorRects(Vector<LayoutRect>&, const LayoutBoxModelObject* a ncestor, const LayoutPoint& preOffset, const LayoutPoint& postOffset) const;
993 997
998 // Return the transformation matrix to map points from local to the coordina te system of a container, taking transforms into account.
999 // Passing null for |ancestor| behaves the same as localToAncestorQuad.
1000 TransformationMatrix localToAncestorTransform(const LayoutBoxModelObject* an cestor, MapCoordinatesFlags = 0, bool* wasFixed = nullptr) const;
1001 TransformationMatrix localToAbsoluteTransform(MapCoordinatesFlags mode = 0, bool* wasFixed = nullptr) const
1002 {
1003 return localToAncestorTransform(nullptr, mode, wasFixed);
1004 }
1005
994 // Convert a local point into the coordinate system of backing coordinates. Also returns the backing layer if needed. 1006 // Convert a local point into the coordinate system of backing coordinates. Also returns the backing layer if needed.
995 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, PaintLayer** backingLayer = nullptr); 1007 FloatPoint localToInvalidationBackingPoint(const LayoutPoint&, PaintLayer** backingLayer = nullptr);
996 1008
997 // Return the offset from the container() layoutObject (excluding transforms ). In multi-column layout, 1009 // Return the offset from the container() layoutObject (excluding transforms ). In multi-column layout,
998 // different offsets apply at different points, so return the offset that ap plies to the given point. 1010 // different offsets apply at different points, so return the offset that ap plies to the given point.
999 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = nullptr) const; 1011 virtual LayoutSize offsetFromContainer(const LayoutObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = nullptr) const;
1000 // Return the offset from an object up the container() chain. Asserts that n one of the intermediate objects have transforms. 1012 // Return the offset from an object up the container() chain. Asserts that n one of the intermediate objects have transforms.
1001 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const; 1013 LayoutSize offsetFromAncestorContainer(const LayoutObject*) const;
1002 1014
1003 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } 1015 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { }
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2155 void showTree(const blink::LayoutObject*); 2167 void showTree(const blink::LayoutObject*);
2156 void showLineTree(const blink::LayoutObject*); 2168 void showLineTree(const blink::LayoutObject*);
2157 void showLayoutTree(const blink::LayoutObject* object1); 2169 void showLayoutTree(const blink::LayoutObject* object1);
2158 // We don't make object2 an optional parameter so that showLayoutTree 2170 // We don't make object2 an optional parameter so that showLayoutTree
2159 // can be called from gdb easily. 2171 // can be called from gdb easily.
2160 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 2172 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
2161 2173
2162 #endif 2174 #endif
2163 2175
2164 #endif // LayoutObject_h 2176 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698