| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 // Using strokeBoundingBox (instead of paintInvalidationRectInLocalCoordinat
es) to avoid the intersection | 128 // Using strokeBoundingBox (instead of paintInvalidationRectInLocalCoordinat
es) to avoid the intersection |
| 129 // with local clips/mask, which may yield incorrect results when mixing obje
ctBoundingBox and | 129 // with local clips/mask, which may yield incorrect results when mixing obje
ctBoundingBox and |
| 130 // userSpaceOnUse units (http://crbug.com/294900). | 130 // userSpaceOnUse units (http://crbug.com/294900). |
| 131 FloatRect bounds = strokeBoundingBox(); | 131 FloatRect bounds = strokeBoundingBox(); |
| 132 context->beginRecording(bounds); | 132 context->beginRecording(bounds); |
| 133 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { | 133 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { |
| 134 RenderObject* renderer = childElement->renderer(); | 134 RenderObject* renderer = childElement->renderer(); |
| 135 if (!renderer) | 135 if (!renderer) |
| 136 continue; | 136 continue; |
| 137 RenderStyle* style = renderer->style(); | 137 const RenderStyle* style = renderer->style(); |
| 138 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) | 138 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) |
| 139 continue; | 139 continue; |
| 140 | 140 |
| 141 SVGRenderingContext::renderSubtree(context, renderer); | 141 SVGRenderingContext::renderSubtree(context, renderer); |
| 142 } | 142 } |
| 143 m_maskContentPicture = context->endRecording(); | 143 m_maskContentPicture = context->endRecording(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void RenderSVGResourceMasker::calculateMaskContentPaintInvalidationRect() | 146 void RenderSVGResourceMasker::calculateMaskContentPaintInvalidationRect() |
| 147 { | 147 { |
| 148 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { | 148 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { |
| 149 RenderObject* renderer = childElement->renderer(); | 149 RenderObject* renderer = childElement->renderer(); |
| 150 if (!renderer) | 150 if (!renderer) |
| 151 continue; | 151 continue; |
| 152 RenderStyle* style = renderer->style(); | 152 const RenderStyle* style = renderer->style(); |
| 153 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) | 153 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) |
| 154 continue; | 154 continue; |
| 155 m_maskContentBoundaries.unite(renderer->localToParentTransform().mapRect
(renderer->paintInvalidationRectInLocalCoordinates())); | 155 m_maskContentBoundaries.unite(renderer->localToParentTransform().mapRect
(renderer->paintInvalidationRectInLocalCoordinates())); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 FloatRect RenderSVGResourceMasker::resourceBoundingBox(const RenderObject* objec
t) | 159 FloatRect RenderSVGResourceMasker::resourceBoundingBox(const RenderObject* objec
t) |
| 160 { | 160 { |
| 161 SVGMaskElement* maskElement = toSVGMaskElement(element()); | 161 SVGMaskElement* maskElement = toSVGMaskElement(element()); |
| 162 ASSERT(maskElement); | 162 ASSERT(maskElement); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 177 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); | 177 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); |
| 178 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 178 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
| 179 maskRect = transform.mapRect(maskRect); | 179 maskRect = transform.mapRect(maskRect); |
| 180 } | 180 } |
| 181 | 181 |
| 182 maskRect.intersect(maskBoundaries); | 182 maskRect.intersect(maskBoundaries); |
| 183 return maskRect; | 183 return maskRect; |
| 184 } | 184 } |
| 185 | 185 |
| 186 } | 186 } |
| OLD | NEW |