| 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 SVGRenderSupport_h | 24 #ifndef SVGRenderSupport_h |
| 25 #define SVGRenderSupport_h | 25 #define SVGRenderSupport_h |
| 26 | 26 |
| 27 #include "core/rendering/svg/RenderSVGResource.h" |
| 28 |
| 27 namespace blink { | 29 namespace blink { |
| 28 | 30 |
| 29 class AffineTransform; | 31 class AffineTransform; |
| 30 class FloatPoint; | 32 class FloatPoint; |
| 31 class FloatRect; | 33 class FloatRect; |
| 32 class GraphicsContext; | 34 class GraphicsContext; |
| 33 class GraphicsContextStateSaver; | 35 class GraphicsContextStateSaver; |
| 34 class PaintInvalidationState; | 36 class PaintInvalidationState; |
| 35 class LayoutRect; | 37 class LayoutRect; |
| 36 struct PaintInfo; | 38 struct PaintInfo; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 static LayoutRect clippedOverflowRectForPaintInvalidation(const RenderObject
*, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalida
tionState*); | 81 static LayoutRect clippedOverflowRectForPaintInvalidation(const RenderObject
*, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalida
tionState*); |
| 80 static void computeFloatRectForPaintInvalidation(const RenderObject*, const
RenderLayerModelObject* paintInvalidationContainer, FloatRect&, const PaintInval
idationState*); | 82 static void computeFloatRectForPaintInvalidation(const RenderObject*, const
RenderLayerModelObject* paintInvalidationContainer, FloatRect&, const PaintInval
idationState*); |
| 81 static void mapLocalToContainer(const RenderObject*, const RenderLayerModelO
bject* paintInvalidationContainer, TransformState&, bool* wasFixed = 0, const Pa
intInvalidationState* = 0); | 83 static void mapLocalToContainer(const RenderObject*, const RenderLayerModelO
bject* paintInvalidationContainer, TransformState&, bool* wasFixed = 0, const Pa
intInvalidationState* = 0); |
| 82 static const RenderObject* pushMappingToContainer(const RenderObject*, const
RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&); | 84 static const RenderObject* pushMappingToContainer(const RenderObject*, const
RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&); |
| 83 | 85 |
| 84 // Shared between SVG renderers and resources. | 86 // Shared between SVG renderers and resources. |
| 85 static void applyStrokeStyleToContext(GraphicsContext*, const RenderStyle*,
const RenderObject*); | 87 static void applyStrokeStyleToContext(GraphicsContext*, const RenderStyle*,
const RenderObject*); |
| 86 static void applyStrokeStyleToStrokeData(StrokeData*, const RenderStyle*, co
nst RenderObject*); | 88 static void applyStrokeStyleToStrokeData(StrokeData*, const RenderStyle*, co
nst RenderObject*); |
| 87 | 89 |
| 88 // Update the GC state (on |stateSaver.context()|) for painting |renderer| | 90 // Update the GC state (on |stateSaver.context()|) for painting |renderer| |
| 89 // using |style|. |resourceModeFlags| is used to decide between fill/stroke. | 91 // using |style|. |resourceMode| is used to decide between fill/stroke. |
| 90 // Previous state will be saved (if needed) using |stateSaver|. | 92 // Previous state will be saved (if needed) using |stateSaver|. |
| 91 static bool updateGraphicsContext(GraphicsContextStateSaver&, RenderStyle*,
RenderObject&, unsigned resourceModeFlags); | 93 static bool updateGraphicsContext(GraphicsContextStateSaver&, RenderStyle*,
RenderObject&, RenderSVGResourceMode, const AffineTransform* additionalPaintServ
erTransform = 0); |
| 92 | 94 |
| 93 // Determines if any ancestor's transform has changed. | 95 // Determines if any ancestor's transform has changed. |
| 94 static bool transformToRootChanged(RenderObject*); | 96 static bool transformToRootChanged(RenderObject*); |
| 95 | 97 |
| 96 // FIXME: These methods do not belong here. | 98 // FIXME: These methods do not belong here. |
| 97 static const RenderSVGRoot* findTreeRootObject(const RenderObject*); | 99 static const RenderSVGRoot* findTreeRootObject(const RenderObject*); |
| 98 | 100 |
| 99 // Helper method for determining if a RenderObject marked as text (isText()=
= true) | 101 // Helper method for determining if a RenderObject marked as text (isText()=
= true) |
| 100 // can/will be rendered as part of a <text>. | 102 // can/will be rendered as part of a <text>. |
| 101 static bool isRenderableTextNode(const RenderObject*); | 103 static bool isRenderableTextNode(const RenderObject*); |
| 102 | 104 |
| 103 private: | 105 private: |
| 104 static void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& obje
ctBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBox); | 106 static void updateObjectBoundingBox(FloatRect& objectBoundingBox, bool& obje
ctBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBox); |
| 105 static bool layoutSizeOfNearestViewportChanged(const RenderObject* start); | 107 static bool layoutSizeOfNearestViewportChanged(const RenderObject* start); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 } // namespace blink | 110 } // namespace blink |
| 109 | 111 |
| 110 #endif // SVGRenderSupport_h | 112 #endif // SVGRenderSupport_h |
| OLD | NEW |