| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 if (parent->isSVGRoot()) { | 93 if (parent->isSVGRoot()) { |
| 94 TransformationMatrix matrix(object->localToParentTransform()); | 94 TransformationMatrix matrix(object->localToParentTransform()); |
| 95 matrix.multiply(toRenderSVGRoot(parent)->localToBorderBoxTransform()); | 95 matrix.multiply(toRenderSVGRoot(parent)->localToBorderBoxTransform()); |
| 96 geometryMap.push(object, matrix); | 96 geometryMap.push(object, matrix); |
| 97 } else | 97 } else |
| 98 geometryMap.push(object, object->localToParentTransform()); | 98 geometryMap.push(object, object->localToParentTransform()); |
| 99 | 99 |
| 100 return parent; | 100 return parent; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool SVGRenderSupport::parentTransformDidChange(RenderObject* object) |
| 104 { |
| 105 // When a parent container is transformed in SVG, all children will be paint
ed automatically |
| 106 // so we are able to skip redundant repaint checks. |
| 107 RenderObject* parent = object->parent(); |
| 108 return !(parent && parent->isSVGContainer() && toRenderSVGContainer(parent)-
>didTransformToRootUpdate()); |
| 109 } |
| 110 |
| 103 bool SVGRenderSupport::checkForSVGRepaintDuringLayout(RenderObject* object) | 111 bool SVGRenderSupport::checkForSVGRepaintDuringLayout(RenderObject* object) |
| 104 { | 112 { |
| 105 if (!object->checkForRepaintDuringLayout()) | 113 if (!object->checkForRepaintDuringLayout()) |
| 106 return false; | 114 return false; |
| 107 // When a parent container is transformed in SVG, all children will be paint
ed automatically | 115 |
| 108 // so we are able to skip redundant repaint checks. | 116 return parentTransformDidChange(object); |
| 109 RenderObject* parent = object->parent(); | |
| 110 return !(parent && parent->isSVGContainer() && toRenderSVGContainer(parent)-
>didTransformToRootUpdate()); | |
| 111 } | 117 } |
| 112 | 118 |
| 113 // Update a bounding box taking into account the validity of the other bounding
box. | 119 // Update a bounding box taking into account the validity of the other bounding
box. |
| 114 inline void SVGRenderSupport::updateObjectBoundingBox(FloatRect& objectBoundingB
ox, bool& objectBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBo
x) | 120 inline void SVGRenderSupport::updateObjectBoundingBox(FloatRect& objectBoundingB
ox, bool& objectBoundingBoxValid, RenderObject* other, FloatRect otherBoundingBo
x) |
| 115 { | 121 { |
| 116 bool otherValid = other->isSVGContainer() ? toRenderSVGContainer(other)->isO
bjectBoundingBoxValid() : true; | 122 bool otherValid = other->isSVGContainer() ? toRenderSVGContainer(other)->isO
bjectBoundingBoxValid() : true; |
| 117 if (!otherValid) | 123 if (!otherValid) |
| 118 return; | 124 return; |
| 119 | 125 |
| 120 if (!objectBoundingBoxValid) { | 126 if (!objectBoundingBoxValid) { |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 } | 398 } |
| 393 | 399 |
| 394 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) | 400 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) |
| 395 { | 401 { |
| 396 ASSERT(object->isText()); | 402 ASSERT(object->isText()); |
| 397 // <br> is marked as text, but is not handled by the SVG rendering code-path
. | 403 // <br> is marked as text, but is not handled by the SVG rendering code-path
. |
| 398 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty
Text(); | 404 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty
Text(); |
| 399 } | 405 } |
| 400 | 406 |
| 401 } | 407 } |
| OLD | NEW |