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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 context.beginRecording(bounds); | 77 context.beginRecording(bounds); |
78 | 78 |
79 ColorFilter maskContentFilter = style()->svgStyle().colorInterpolation() ==
CI_LINEARRGB | 79 ColorFilter maskContentFilter = style()->svgStyle().colorInterpolation() ==
CI_LINEARRGB |
80 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; | 80 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; |
81 context.setColorFilter(maskContentFilter); | 81 context.setColorFilter(maskContentFilter); |
82 | 82 |
83 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { | 83 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { |
84 LayoutObject* layoutObject = childElement->layoutObject(); | 84 LayoutObject* layoutObject = childElement->layoutObject(); |
85 if (!layoutObject) | 85 if (!layoutObject) |
86 continue; | 86 continue; |
87 const LayoutStyle* style = layoutObject->style(); | 87 const ComputedStyle* style = layoutObject->style(); |
88 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) | 88 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) |
89 continue; | 89 continue; |
90 | 90 |
91 SVGPaintContext::paintSubtree(&context, layoutObject); | 91 SVGPaintContext::paintSubtree(&context, layoutObject); |
92 } | 92 } |
93 | 93 |
94 if (displayItemList) | 94 if (displayItemList) |
95 displayItemList->replay(&context); | 95 displayItemList->replay(&context); |
96 m_maskContentPicture = context.endRecording(); | 96 m_maskContentPicture = context.endRecording(); |
97 return m_maskContentPicture; | 97 return m_maskContentPicture; |
98 } | 98 } |
99 | 99 |
100 void LayoutSVGResourceMasker::calculateMaskContentPaintInvalidationRect() | 100 void LayoutSVGResourceMasker::calculateMaskContentPaintInvalidationRect() |
101 { | 101 { |
102 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { | 102 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { |
103 LayoutObject* layoutObject = childElement->layoutObject(); | 103 LayoutObject* layoutObject = childElement->layoutObject(); |
104 if (!layoutObject) | 104 if (!layoutObject) |
105 continue; | 105 continue; |
106 const LayoutStyle* style = layoutObject->style(); | 106 const ComputedStyle* style = layoutObject->style(); |
107 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) | 107 if (!style || style->display() == NONE || style->visibility() != VISIBLE
) |
108 continue; | 108 continue; |
109 m_maskContentBoundaries.unite(layoutObject->localToParentTransform().map
Rect(layoutObject->paintInvalidationRectInLocalCoordinates())); | 109 m_maskContentBoundaries.unite(layoutObject->localToParentTransform().map
Rect(layoutObject->paintInvalidationRectInLocalCoordinates())); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 FloatRect LayoutSVGResourceMasker::resourceBoundingBox(const LayoutObject* objec
t) | 113 FloatRect LayoutSVGResourceMasker::resourceBoundingBox(const LayoutObject* objec
t) |
114 { | 114 { |
115 SVGMaskElement* maskElement = toSVGMaskElement(element()); | 115 SVGMaskElement* maskElement = toSVGMaskElement(element()); |
116 ASSERT(maskElement); | 116 ASSERT(maskElement); |
(...skipping 14 matching lines...) Expand all Loading... |
131 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); | 131 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); |
132 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 132 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
133 maskRect = transform.mapRect(maskRect); | 133 maskRect = transform.mapRect(maskRect); |
134 } | 134 } |
135 | 135 |
136 maskRect.intersect(maskBoundaries); | 136 maskRect.intersect(maskBoundaries); |
137 return maskRect; | 137 return maskRect; |
138 } | 138 } |
139 | 139 |
140 } | 140 } |
OLD | NEW |