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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi
nates(); | 69 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi
nates(); |
70 if (paintInvalidationRect.isEmpty() || !element()->hasChildren()) | 70 if (paintInvalidationRect.isEmpty() || !element()->hasChildren()) |
71 return false; | 71 return false; |
72 | 72 |
73 // Content layer start. | 73 // Content layer start. |
74 context->beginTransparencyLayer(1, &paintInvalidationRect); | 74 context->beginTransparencyLayer(1, &paintInvalidationRect); |
75 | 75 |
76 return true; | 76 return true; |
77 } | 77 } |
78 | 78 |
79 void RenderSVGResourceMasker::postApplyResource(RenderObject* object, GraphicsCo
ntext*& context, | 79 void RenderSVGResourceMasker::postApplyResource(RenderObject* object, GraphicsCo
ntext*& context) |
80 unsigned short resourceMode, const Path*, const RenderSVGShape*) | |
81 { | 80 { |
82 ASSERT(object); | 81 ASSERT(object); |
83 ASSERT(context); | 82 ASSERT(context); |
84 ASSERT(style()); | 83 ASSERT(style()); |
85 ASSERT_UNUSED(resourceMode, resourceMode == ApplyToDefaultMode); | |
86 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); | 84 ASSERT_WITH_SECURITY_IMPLICATION(!needsLayout()); |
87 | 85 |
88 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi
nates(); | 86 FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordi
nates(); |
89 | 87 |
90 const SVGRenderStyle& svgStyle = style()->svgStyle(); | 88 const SVGRenderStyle& svgStyle = style()->svgStyle(); |
91 ColorFilter maskLayerFilter = svgStyle.maskType() == MT_LUMINANCE | 89 ColorFilter maskLayerFilter = svgStyle.maskType() == MT_LUMINANCE |
92 ? ColorFilterLuminanceToAlpha : ColorFilterNone; | 90 ? ColorFilterLuminanceToAlpha : ColorFilterNone; |
93 ColorFilter maskContentFilter = svgStyle.colorInterpolation() == CI_LINEARRG
B | 91 ColorFilter maskContentFilter = svgStyle.colorInterpolation() == CI_LINEARRG
B |
94 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; | 92 ? ColorFilterSRGBToLinearRGB : ColorFilterNone; |
95 | 93 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); | 182 transform.translate(objectBoundingBox.x(), objectBoundingBox.y()); |
185 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); | 183 transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.h
eight()); |
186 maskRect = transform.mapRect(maskRect); | 184 maskRect = transform.mapRect(maskRect); |
187 } | 185 } |
188 | 186 |
189 maskRect.intersect(maskBoundaries); | 187 maskRect.intersect(maskBoundaries); |
190 return maskRect; | 188 return maskRect; |
191 } | 189 } |
192 | 190 |
193 } | 191 } |
OLD | NEW |