| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 ColorFilter maskContentFilter = | 82 ColorFilter maskContentFilter = |
| 83 style()->svgStyle().colorInterpolation() == CI_LINEARRGB | 83 style()->svgStyle().colorInterpolation() == CI_LINEARRGB |
| 84 ? ColorFilterSRGBToLinearRGB | 84 ? ColorFilterSRGBToLinearRGB |
| 85 : ColorFilterNone; | 85 : ColorFilterNone; |
| 86 builder.context().setColorFilter(maskContentFilter); | 86 builder.context().setColorFilter(maskContentFilter); |
| 87 | 87 |
| 88 for (const SVGElement& childElement : | 88 for (const SVGElement& childElement : |
| 89 Traversal<SVGElement>::childrenOf(*element())) { | 89 Traversal<SVGElement>::childrenOf(*element())) { |
| 90 const LayoutObject* layoutObject = childElement.layoutObject(); | 90 const LayoutObject* layoutObject = childElement.layoutObject(); |
| 91 if (!layoutObject || layoutObject->styleRef().display() == EDisplay::None) | 91 if (!layoutObject || layoutObject->styleRef().display() == EDisplay::kNone) |
| 92 continue; | 92 continue; |
| 93 SVGPaintContext::paintResourceSubtree(builder.context(), layoutObject); | 93 SVGPaintContext::paintResourceSubtree(builder.context(), layoutObject); |
| 94 } | 94 } |
| 95 | 95 |
| 96 m_cachedPaintRecord = builder.endRecording(); | 96 m_cachedPaintRecord = builder.endRecording(); |
| 97 return m_cachedPaintRecord; | 97 return m_cachedPaintRecord; |
| 98 } | 98 } |
| 99 | 99 |
| 100 void LayoutSVGResourceMasker::calculateMaskContentVisualRect() { | 100 void LayoutSVGResourceMasker::calculateMaskContentVisualRect() { |
| 101 for (const SVGElement& childElement : | 101 for (const SVGElement& childElement : |
| 102 Traversal<SVGElement>::childrenOf(*element())) { | 102 Traversal<SVGElement>::childrenOf(*element())) { |
| 103 const LayoutObject* layoutObject = childElement.layoutObject(); | 103 const LayoutObject* layoutObject = childElement.layoutObject(); |
| 104 if (!layoutObject || layoutObject->styleRef().display() == EDisplay::None) | 104 if (!layoutObject || layoutObject->styleRef().display() == EDisplay::kNone) |
| 105 continue; | 105 continue; |
| 106 m_maskContentBoundaries.unite( | 106 m_maskContentBoundaries.unite( |
| 107 layoutObject->localToSVGParentTransform().mapRect( | 107 layoutObject->localToSVGParentTransform().mapRect( |
| 108 layoutObject->visualRectInLocalSVGCoordinates())); | 108 layoutObject->visualRectInLocalSVGCoordinates())); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 FloatRect LayoutSVGResourceMasker::resourceBoundingBox( | 112 FloatRect LayoutSVGResourceMasker::resourceBoundingBox( |
| 113 const LayoutObject* object) { | 113 const LayoutObject* object) { |
| 114 SVGMaskElement* maskElement = toSVGMaskElement(element()); | 114 SVGMaskElement* maskElement = toSVGMaskElement(element()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 134 transform.scaleNonUniform(objectBoundingBox.width(), | 134 transform.scaleNonUniform(objectBoundingBox.width(), |
| 135 objectBoundingBox.height()); | 135 objectBoundingBox.height()); |
| 136 maskRect = transform.mapRect(maskRect); | 136 maskRect = transform.mapRect(maskRect); |
| 137 } | 137 } |
| 138 | 138 |
| 139 maskRect.intersect(maskBoundaries); | 139 maskRect.intersect(maskBoundaries); |
| 140 return maskRect; | 140 return maskRect; |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |