OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007, 2008 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) 2009 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2009-2010. 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 25 matching lines...) Expand all Loading... |
36 #include "core/rendering/svg/RenderSVGRoot.h" | 36 #include "core/rendering/svg/RenderSVGRoot.h" |
37 #include "core/rendering/svg/RenderSVGText.h" | 37 #include "core/rendering/svg/RenderSVGText.h" |
38 #include "core/rendering/svg/RenderSVGViewportContainer.h" | 38 #include "core/rendering/svg/RenderSVGViewportContainer.h" |
39 #include "core/rendering/svg/SVGResources.h" | 39 #include "core/rendering/svg/SVGResources.h" |
40 #include "core/rendering/svg/SVGResourcesCache.h" | 40 #include "core/rendering/svg/SVGResourcesCache.h" |
41 #include "core/svg/SVGElement.h" | 41 #include "core/svg/SVGElement.h" |
42 #include "platform/geometry/TransformState.h" | 42 #include "platform/geometry/TransformState.h" |
43 | 43 |
44 namespace WebCore { | 44 namespace WebCore { |
45 | 45 |
46 LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* o
bject, const RenderLayerModelObject* repaintContainer, const PaintInvalidationSt
ate* paintInvalidationState) | 46 LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderObject* o
bject, const RenderLayerModelObject* repaintContainer) |
47 { | 47 { |
48 // Return early for any cases where we don't actually paint | 48 // Return early for any cases where we don't actually paint |
49 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h
asVisibleContent()) | 49 if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->h
asVisibleContent()) |
50 return LayoutRect(); | 50 return LayoutRect(); |
51 | 51 |
52 // Pass our local paint rect to computeRectForRepaint() which will | 52 // Pass our local paint rect to computeRectForRepaint() which will |
53 // map to parent coords and recurse up the parent chain. | 53 // map to parent coords and recurse up the parent chain. |
54 FloatRect repaintRect = object->paintInvalidationRectInLocalCoordinates(); | 54 FloatRect repaintRect = object->paintInvalidationRectInLocalCoordinates(); |
55 object->computeFloatRectForPaintInvalidation(repaintContainer, repaintRect,
paintInvalidationState); | 55 object->computeFloatRectForPaintInvalidation(repaintContainer, repaintRect); |
56 return enclosingLayoutRect(repaintRect); | 56 return enclosingLayoutRect(repaintRect); |
57 } | 57 } |
58 | 58 |
59 void SVGRenderSupport::computeFloatRectForRepaint(const RenderObject* object, co
nst RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed
, const PaintInvalidationState* paintInvalidationState) | 59 void SVGRenderSupport::computeFloatRectForRepaint(const RenderObject* object, co
nst RenderLayerModelObject* repaintContainer, FloatRect& repaintRect, bool fixed
) |
60 { | 60 { |
61 repaintRect.inflate(object->style()->outlineWidth()); | 61 repaintRect.inflate(object->style()->outlineWidth()); |
62 | 62 |
63 // Translate to coords in our parent renderer, and then call computeFloatRec
tForPaintInvalidation() on our parent. | 63 // Translate to coords in our parent renderer, and then call computeFloatRec
tForPaintInvalidation() on our parent. |
64 repaintRect = object->localToParentTransform().mapRect(repaintRect); | 64 repaintRect = object->localToParentTransform().mapRect(repaintRect); |
65 object->parent()->computeFloatRectForPaintInvalidation(repaintContainer, rep
aintRect, fixed, paintInvalidationState); | 65 object->parent()->computeFloatRectForPaintInvalidation(repaintContainer, rep
aintRect, fixed); |
66 } | 66 } |
67 | 67 |
68 void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const Ren
derLayerModelObject* repaintContainer, TransformState& transformState, bool* was
Fixed, const PaintInvalidationState* paintInvalidationState) | 68 void SVGRenderSupport::mapLocalToContainer(const RenderObject* object, const Ren
derLayerModelObject* repaintContainer, TransformState& transformState, bool* was
Fixed) |
69 { | 69 { |
70 transformState.applyTransform(object->localToParentTransform()); | 70 transformState.applyTransform(object->localToParentTransform()); |
71 | 71 |
72 RenderObject* parent = object->parent(); | 72 RenderObject* parent = object->parent(); |
73 | 73 |
74 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderB
oxTransform | 74 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderB
oxTransform |
75 // to map an element from SVG viewport coordinates to CSS box coordinates. | 75 // to map an element from SVG viewport coordinates to CSS box coordinates. |
76 // RenderSVGRoot's mapLocalToContainer method expects CSS box coordinates. | 76 // RenderSVGRoot's mapLocalToContainer method expects CSS box coordinates. |
77 if (parent->isSVGRoot()) | 77 if (parent->isSVGRoot()) |
78 transformState.applyTransform(toRenderSVGRoot(parent)->localToBorderBoxT
ransform()); | 78 transformState.applyTransform(toRenderSVGRoot(parent)->localToBorderBoxT
ransform()); |
79 | 79 |
80 MapCoordinatesFlags mode = UseTransforms; | 80 MapCoordinatesFlags mode = UseTransforms; |
81 parent->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed
, paintInvalidationState); | 81 parent->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed
); |
82 } | 82 } |
83 | 83 |
84 const RenderObject* SVGRenderSupport::pushMappingToContainer(const RenderObject*
object, const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geom
etryMap) | 84 const RenderObject* SVGRenderSupport::pushMappingToContainer(const RenderObject*
object, const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap& geom
etryMap) |
85 { | 85 { |
86 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != object); | 86 ASSERT_UNUSED(ancestorToStopAt, ancestorToStopAt != object); |
87 | 87 |
88 RenderObject* parent = object->parent(); | 88 RenderObject* parent = object->parent(); |
89 | 89 |
90 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderB
oxTransform | 90 // At the SVG/HTML boundary (aka RenderSVGRoot), we apply the localToBorderB
oxTransform |
91 // to map an element from SVG viewport coordinates to CSS box coordinates. | 91 // to map an element from SVG viewport coordinates to CSS box coordinates. |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 } | 387 } |
388 | 388 |
389 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) | 389 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) |
390 { | 390 { |
391 ASSERT(object->isText()); | 391 ASSERT(object->isText()); |
392 // <br> is marked as text, but is not handled by the SVG rendering code-path
. | 392 // <br> is marked as text, but is not handled by the SVG rendering code-path
. |
393 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty
Text(); | 393 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty
Text(); |
394 } | 394 } |
395 | 395 |
396 } | 396 } |
OLD | NEW |