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 |
11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
22 */ | 22 */ |
23 | 23 |
24 #ifndef SVGLayoutSupport_h | 24 #ifndef SVGLayoutSupport_h |
25 #define SVGLayoutSupport_h | 25 #define SVGLayoutSupport_h |
26 | 26 |
27 #include "core/layout/svg/LayoutSVGResourcePaintServer.h" | 27 #include "core/layout/LayoutObject.h" |
| 28 #include "core/style/SVGComputedStyleDefs.h" |
28 #include "platform/graphics/DashArray.h" | 29 #include "platform/graphics/DashArray.h" |
29 | 30 |
30 namespace blink { | 31 namespace blink { |
31 | 32 |
32 class AffineTransform; | 33 class AffineTransform; |
33 class FloatPoint; | 34 class FloatPoint; |
34 class FloatRect; | 35 class FloatRect; |
35 class GraphicsContext; | |
36 class GraphicsContextStateSaver; | |
37 class PaintInvalidationState; | 36 class PaintInvalidationState; |
38 class LayoutRect; | 37 class LayoutRect; |
39 struct PaintInfo; | |
40 class LayoutGeometryMap; | 38 class LayoutGeometryMap; |
41 class LayoutBoxModelObject; | 39 class LayoutBoxModelObject; |
42 class LayoutObject; | 40 class LayoutObject; |
43 class ComputedStyle; | 41 class ComputedStyle; |
44 class LayoutSVGRoot; | 42 class LayoutSVGRoot; |
45 class SVGLengthContext; | 43 class SVGLengthContext; |
46 class StrokeData; | 44 class StrokeData; |
47 class TransformState; | 45 class TransformState; |
48 | 46 |
49 class SVGLayoutSupport { | 47 class SVGLayoutSupport { |
(...skipping 23 matching lines...) Expand all Loading... |
73 | 71 |
74 static void computeContainerBoundingBoxes(const LayoutObject* container, Flo
atRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundi
ngBox, FloatRect& paintInvalidationBoundingBox); | 72 static void computeContainerBoundingBoxes(const LayoutObject* container, Flo
atRect& objectBoundingBox, bool& objectBoundingBoxValid, FloatRect& strokeBoundi
ngBox, FloatRect& paintInvalidationBoundingBox); |
75 | 73 |
76 // Important functions used by nearly all SVG layoutObjects centralizing coo
rdinate transformations / paint invalidation rect calculations | 74 // 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*); | 75 static LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutObject
*, const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidati
onState*); |
78 static const LayoutSVGRoot& mapRectToSVGRootForPaintInvalidation(const Layou
tObject*, const FloatRect& localPaintInvalidationRect, LayoutRect&); | 76 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); | 77 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&); | 78 static const LayoutObject* pushMappingToContainer(const LayoutObject*, const
LayoutBoxModelObject* ancestorToStopAt, LayoutGeometryMap&); |
81 | 79 |
82 // Shared between SVG layoutObjects and resources. | 80 // Shared between SVG layoutObjects and resources. |
83 static void applyStrokeStyleToContext(GraphicsContext&, const ComputedStyle&
, const LayoutObject&); | |
84 static void applyStrokeStyleToStrokeData(StrokeData&, const ComputedStyle&,
const LayoutObject&); | 81 static void applyStrokeStyleToStrokeData(StrokeData&, const ComputedStyle&,
const LayoutObject&); |
85 | 82 |
86 static DashArray resolveSVGDashArray(const SVGDashArray&, const ComputedStyl
e&, const SVGLengthContext&); | 83 static DashArray resolveSVGDashArray(const SVGDashArray&, const ComputedStyl
e&, const SVGLengthContext&); |
87 | 84 |
88 // Update the GC state (on |paintInfo.context|) for painting |layoutObject| | |
89 // using |style|. |resourceMode| is used to decide between fill/stroke. | |
90 // Previous state will be saved (if needed) using |stateSaver|. | |
91 static bool updateGraphicsContext(const PaintInfo&, GraphicsContextStateSave
r&, const ComputedStyle&, LayoutObject&, LayoutSVGResourceMode, const AffineTran
sform* additionalPaintServerTransform = 0); | |
92 | |
93 // Determines if any ancestor's transform has changed. | 85 // Determines if any ancestor's transform has changed. |
94 static bool transformToRootChanged(LayoutObject*); | 86 static bool transformToRootChanged(LayoutObject*); |
95 | 87 |
96 // FIXME: These methods do not belong here. | 88 // FIXME: These methods do not belong here. |
97 static const LayoutSVGRoot* findTreeRootObject(const LayoutObject*); | 89 static const LayoutSVGRoot* findTreeRootObject(const LayoutObject*); |
98 | 90 |
99 // Helper method for determining if a LayoutObject marked as text (isText()=
= true) | 91 // Helper method for determining if a LayoutObject marked as text (isText()=
= true) |
100 // can/will be laid out as part of a <text>. | 92 // can/will be laid out as part of a <text>. |
101 static bool isLayoutableTextNode(const LayoutObject*); | 93 static bool isLayoutableTextNode(const LayoutObject*); |
102 | 94 |
(...skipping 28 matching lines...) Expand all Loading... |
131 return true; | 123 return true; |
132 if (child->hasNonIsolatedBlendingDescendants() && !willIsolateBlendingDe
scendantsForObject(child)) | 124 if (child->hasNonIsolatedBlendingDescendants() && !willIsolateBlendingDe
scendantsForObject(child)) |
133 return true; | 125 return true; |
134 } | 126 } |
135 return false; | 127 return false; |
136 } | 128 } |
137 | 129 |
138 } // namespace blink | 130 } // namespace blink |
139 | 131 |
140 #endif // SVGLayoutSupport_h | 132 #endif // SVGLayoutSupport_h |
OLD | NEW |