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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 ColorFilter maskContentFilter = style()->svgStyle().colorInterpolation() ==
CI_LINEARRGB | 75 ColorFilter maskContentFilter = style()->svgStyle().colorInterpolation() ==
CI_LINEARRGB |
76 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; | 76 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; |
77 pictureBuilder.context().setColorFilter(maskContentFilter); | 77 pictureBuilder.context().setColorFilter(maskContentFilter); |
78 | 78 |
79 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { | 79 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { |
80 LayoutObject* layoutObject = childElement->layoutObject(); | 80 LayoutObject* layoutObject = childElement->layoutObject(); |
81 if (!layoutObject) | 81 if (!layoutObject) |
82 continue; | 82 continue; |
83 const ComputedStyle* style = layoutObject->style(); | 83 const ComputedStyle* style = layoutObject->style(); |
84 if (!style || style->display() == NONE || style->visibility() != EVisibi
lity::Visible) | 84 if (!style || style->display() == EDisplay::None || style->visibility()
!= EVisibility::Visible) |
85 continue; | 85 continue; |
86 | 86 |
87 SVGPaintContext::paintSubtree(pictureBuilder.context(), layoutObject); | 87 SVGPaintContext::paintSubtree(pictureBuilder.context(), layoutObject); |
88 } | 88 } |
89 | 89 |
90 m_maskContentPicture = pictureBuilder.endRecording(); | 90 m_maskContentPicture = pictureBuilder.endRecording(); |
91 return m_maskContentPicture; | 91 return m_maskContentPicture; |
92 } | 92 } |
93 | 93 |
94 void LayoutSVGResourceMasker::calculateMaskContentPaintInvalidationRect() | 94 void LayoutSVGResourceMasker::calculateMaskContentPaintInvalidationRect() |
95 { | 95 { |
96 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { | 96 for (SVGElement* childElement = Traversal<SVGElement>::firstChild(*element()
); childElement; childElement = Traversal<SVGElement>::nextSibling(*childElement
)) { |
97 LayoutObject* layoutObject = childElement->layoutObject(); | 97 LayoutObject* layoutObject = childElement->layoutObject(); |
98 if (!layoutObject) | 98 if (!layoutObject) |
99 continue; | 99 continue; |
100 const ComputedStyle* style = layoutObject->style(); | 100 const ComputedStyle* style = layoutObject->style(); |
101 if (!style || style->display() == NONE || style->visibility() != EVisibi
lity::Visible) | 101 if (!style || style->display() == EDisplay::None || style->visibility()
!= EVisibility::Visible) |
102 continue; | 102 continue; |
103 m_maskContentBoundaries.unite(layoutObject->localToSVGParentTransform().
mapRect(layoutObject->paintInvalidationRectInLocalSVGCoordinates())); | 103 m_maskContentBoundaries.unite(layoutObject->localToSVGParentTransform().
mapRect(layoutObject->paintInvalidationRectInLocalSVGCoordinates())); |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 FloatRect LayoutSVGResourceMasker::resourceBoundingBox(const LayoutObject* objec
t) | 107 FloatRect LayoutSVGResourceMasker::resourceBoundingBox(const LayoutObject* objec
t) |
108 { | 108 { |
109 SVGMaskElement* maskElement = toSVGMaskElement(element()); | 109 SVGMaskElement* maskElement = toSVGMaskElement(element()); |
110 ASSERT(maskElement); | 110 ASSERT(maskElement); |
111 | 111 |
(...skipping 13 matching lines...) Expand all Loading... |
125 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); | 125 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); |
126 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 126 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
127 maskRect = transform.mapRect(maskRect); | 127 maskRect = transform.mapRect(maskRect); |
128 } | 128 } |
129 | 129 |
130 maskRect.intersect(maskBoundaries); | 130 maskRect.intersect(maskBoundaries); |
131 return maskRect; | 131 return maskRect; |
132 } | 132 } |
133 | 133 |
134 } // namespace blink | 134 } // namespace blink |
OLD | NEW |