OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Google, Inc. All rights reserved. | 5 * Copyright (C) 2009 Google, Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 22 matching lines...) Expand all Loading... |
33 class FloatPoint; | 33 class FloatPoint; |
34 class FloatRect; | 34 class FloatRect; |
35 class GraphicsContext; | 35 class GraphicsContext; |
36 class GraphicsContextStateSaver; | 36 class GraphicsContextStateSaver; |
37 class PaintInvalidationState; | 37 class PaintInvalidationState; |
38 class LayoutRect; | 38 class LayoutRect; |
39 struct PaintInfo; | 39 struct PaintInfo; |
40 class LayoutGeometryMap; | 40 class LayoutGeometryMap; |
41 class LayoutBoxModelObject; | 41 class LayoutBoxModelObject; |
42 class LayoutObject; | 42 class LayoutObject; |
43 class LayoutStyle; | 43 class ComputedStyle; |
44 class LayoutSVGRoot; | 44 class LayoutSVGRoot; |
45 class SVGLengthContext; | 45 class SVGLengthContext; |
46 class StrokeData; | 46 class StrokeData; |
47 class TransformState; | 47 class TransformState; |
48 | 48 |
49 class SVGLayoutSupport { | 49 class SVGLayoutSupport { |
50 public: | 50 public: |
51 // Shares child layouting code between LayoutSVGRoot/LayoutSVG(Hidden)Contai
ner | 51 // Shares child layouting code between LayoutSVGRoot/LayoutSVG(Hidden)Contai
ner |
52 static void layoutChildren(LayoutObject*, bool selfNeedsLayout); | 52 static void layoutChildren(LayoutObject*, bool selfNeedsLayout); |
53 | 53 |
(...skipping 19 matching lines...) Expand all Loading... |
73 | 73 |
74 static void computeContainerBoundingBoxes(const LayoutObject* container, Flo
atRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundi
ngBox, FloatRect& paintInvalidationBoundingBox); | 74 static void computeContainerBoundingBoxes(const LayoutObject* container, Flo
atRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundi
ngBox, FloatRect& paintInvalidationBoundingBox); |
75 | 75 |
76 // Important functions used by nearly all SVG layoutObjects centralizing coo
rdinate transformations / paint invalidation rect calculations | 76 // Important functions used by nearly all SVG layoutObjects centralizing coo
rdinate transformations / paint invalidation rect calculations |
77 static LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutObject
*, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidati
onState*); | 77 static LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutObject
*, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidati
onState*); |
78 static const LayoutSVGRoot& mapRectToSVGRootForPaintInvalidation(const Layou
tObject*, const FloatRect& localPaintInvalidationRect, LayoutRect&); | 78 static const LayoutSVGRoot& mapRectToSVGRootForPaintInvalidation(const Layou
tObject*, const FloatRect& localPaintInvalidationRect, LayoutRect&); |
79 static void mapLocalToContainer(const LayoutObject*, const LayoutBoxModelObj
ect* paintInvalidationContainer, TransformState&, bool* wasFixed = 0, const Pain
tInvalidationState* = 0); | 79 static void mapLocalToContainer(const LayoutObject*, const LayoutBoxModelObj
ect* paintInvalidationContainer, TransformState&, bool* wasFixed = 0, const Pain
tInvalidationState* = 0); |
80 static const LayoutObject* pushMappingToContainer(const LayoutObject*, const
LayoutBoxModelObject* ancestorToStopAt, LayoutGeometryMap&); | 80 static const LayoutObject* pushMappingToContainer(const LayoutObject*, const
LayoutBoxModelObject* ancestorToStopAt, LayoutGeometryMap&); |
81 | 81 |
82 // Shared between SVG layoutObjects and resources. | 82 // Shared between SVG layoutObjects and resources. |
83 static void applyStrokeStyleToContext(GraphicsContext&, const LayoutStyle&,
const LayoutObject&); | 83 static void applyStrokeStyleToContext(GraphicsContext&, const ComputedStyle&
, const LayoutObject&); |
84 static void applyStrokeStyleToStrokeData(StrokeData&, const LayoutStyle&, co
nst LayoutObject&); | 84 static void applyStrokeStyleToStrokeData(StrokeData&, const ComputedStyle&,
const LayoutObject&); |
85 | 85 |
86 static DashArray resolveSVGDashArray(const SVGDashArray&, const LayoutStyle&
, const SVGLengthContext&); | 86 static DashArray resolveSVGDashArray(const SVGDashArray&, const ComputedStyl
e&, const SVGLengthContext&); |
87 | 87 |
88 // Update the GC state (on |paintInfo.context|) for painting |layoutObject| | 88 // Update the GC state (on |paintInfo.context|) for painting |layoutObject| |
89 // using |style|. |resourceMode| is used to decide between fill/stroke. | 89 // using |style|. |resourceMode| is used to decide between fill/stroke. |
90 // Previous state will be saved (if needed) using |stateSaver|. | 90 // Previous state will be saved (if needed) using |stateSaver|. |
91 static bool updateGraphicsContext(const PaintInfo&, GraphicsContextStateSave
r&, const LayoutStyle&, LayoutObject&, LayoutSVGResourceMode, const AffineTransf
orm* additionalPaintServerTransform = 0); | 91 static bool updateGraphicsContext(const PaintInfo&, GraphicsContextStateSave
r&, const ComputedStyle&, LayoutObject&, LayoutSVGResourceMode, const AffineTran
sform* additionalPaintServerTransform = 0); |
92 | 92 |
93 // Determines if any ancestor's transform has changed. | 93 // Determines if any ancestor's transform has changed. |
94 static bool transformToRootChanged(LayoutObject*); | 94 static bool transformToRootChanged(LayoutObject*); |
95 | 95 |
96 // FIXME: These methods do not belong here. | 96 // FIXME: These methods do not belong here. |
97 static const LayoutSVGRoot* findTreeRootObject(const LayoutObject*); | 97 static const LayoutSVGRoot* findTreeRootObject(const LayoutObject*); |
98 | 98 |
99 // Helper method for determining if a LayoutObject marked as text (isText()=
= true) | 99 // Helper method for determining if a LayoutObject marked as text (isText()=
= true) |
100 // can/will be laid out as part of a <text>. | 100 // can/will be laid out as part of a <text>. |
101 static bool isLayoutableTextNode(const LayoutObject*); | 101 static bool isLayoutableTextNode(const LayoutObject*); |
102 | 102 |
103 // Determines whether a svg node should isolate or not based on LayoutStyle. | 103 // Determines whether a svg node should isolate or not based on ComputedStyl
e. |
104 static bool willIsolateBlendingDescendantsForStyle(const LayoutStyle&); | 104 static bool willIsolateBlendingDescendantsForStyle(const ComputedStyle&); |
105 static bool willIsolateBlendingDescendantsForObject(const LayoutObject*); | 105 static bool willIsolateBlendingDescendantsForObject(const LayoutObject*); |
106 template<typename LayoutObjectType> | 106 template<typename LayoutObjectType> |
107 static bool computeHasNonIsolatedBlendingDescendants(const LayoutObjectType*
); | 107 static bool computeHasNonIsolatedBlendingDescendants(const LayoutObjectType*
); |
108 static bool isIsolationRequired(const LayoutObject*); | 108 static bool isIsolationRequired(const LayoutObject*); |
109 | 109 |
110 static float calculateScreenFontSizeScalingFactor(const LayoutObject*); | 110 static float calculateScreenFontSizeScalingFactor(const LayoutObject*); |
111 | 111 |
112 private: | 112 private: |
113 static void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& obje
ctBoundingBoxValid, LayoutObject* other, FloatRect otherBoundingBox); | 113 static void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& obje
ctBoundingBoxValid, LayoutObject* other, FloatRect otherBoundingBox); |
114 static bool layoutSizeOfNearestViewportChanged(const LayoutObject* start); | 114 static bool layoutSizeOfNearestViewportChanged(const LayoutObject* start); |
(...skipping 16 matching lines...) Expand all Loading... |
131 return true; | 131 return true; |
132 if (child->hasNonIsolatedBlendingDescendants() && !willIsolateBlendingDe
scendantsForObject(child)) | 132 if (child->hasNonIsolatedBlendingDescendants() && !willIsolateBlendingDe
scendantsForObject(child)) |
133 return true; | 133 return true; |
134 } | 134 } |
135 return false; | 135 return false; |
136 } | 136 } |
137 | 137 |
138 } // namespace blink | 138 } // namespace blink |
139 | 139 |
140 #endif // SVGLayoutSupport_h | 140 #endif // SVGLayoutSupport_h |
OLD | NEW |