summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderGeometryMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderGeometryMap.h')
-rw-r--r--Source/WebCore/rendering/RenderGeometryMap.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/Source/WebCore/rendering/RenderGeometryMap.h b/Source/WebCore/rendering/RenderGeometryMap.h
index 15dc884d3..bab106f1d 100644
--- a/Source/WebCore/rendering/RenderGeometryMap.h
+++ b/Source/WebCore/rendering/RenderGeometryMap.h
@@ -30,6 +30,7 @@
#include "FloatQuad.h"
#include "IntSize.h"
#include "LayoutSize.h"
+#include "RenderObject.h"
#include "TransformationMatrix.h"
#include <wtf/OwnPtr.h>
@@ -37,7 +38,6 @@ namespace WebCore {
class RenderLayer;
class RenderLayerModelObject;
-class RenderObject;
class RenderView;
class TransformState;
@@ -74,11 +74,26 @@ struct RenderGeometryMapStep {
class RenderGeometryMap {
WTF_MAKE_NONCOPYABLE(RenderGeometryMap);
public:
- RenderGeometryMap();
+ RenderGeometryMap(MapCoordinatesFlags = UseTransforms | SnapOffsetForTransforms);
~RenderGeometryMap();
- FloatPoint absolutePoint(const FloatPoint&) const;
- FloatRect absoluteRect(const FloatRect&) const;
+ MapCoordinatesFlags mapCoordinatesFlags() const { return m_mapCoordinatesFlags; }
+
+ FloatPoint absolutePoint(const FloatPoint& p) const
+ {
+ return mapToContainer(p, 0);
+ }
+
+ FloatRect absoluteRect(const FloatRect& rect) const
+ {
+ return mapToContainer(rect, 0).boundingBox();
+ }
+
+ // Map to a container. Will assert that the container has been pushed onto this map.
+ // A null container maps through the RenderView (including its scale transform, if any).
+ // If the container is the RenderView, the scroll offset is applied, but not the scale.
+ FloatPoint mapToContainer(const FloatPoint&, const RenderLayerModelObject*) const;
+ FloatQuad mapToContainer(const FloatRect&, const RenderLayerModelObject*) const;
// Called by code walking the renderer or layer trees.
void pushMappingsToAncestor(const RenderLayer*, const RenderLayer* ancestorLayer);
@@ -97,7 +112,7 @@ public:
void pushView(const RenderView*, const LayoutSize& scrollOffset, const TransformationMatrix* = 0);
private:
- void mapToAbsolute(TransformState&) const;
+ void mapToContainer(TransformState&, const RenderLayerModelObject* container = 0) const;
void stepInserted(const RenderGeometryMapStep&);
void stepRemoved(const RenderGeometryMapStep&);
@@ -114,6 +129,7 @@ private:
int m_fixedStepsCount;
RenderGeometryMapSteps m_mapping;
LayoutSize m_accumulatedOffset;
+ MapCoordinatesFlags m_mapCoordinatesFlags;
};
} // namespace WebCore