OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 University of Szeged | 2 * Copyright (C) 2010 University of Szeged |
3 * Copyright (C) 2010 Zoltan Herczeg | 3 * Copyright (C) 2010 Zoltan Herczeg |
4 * Copyright (C) 2011 Renata Hodovan (reni@webkit.org) | 4 * Copyright (C) 2011 Renata Hodovan (reni@webkit.org) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 if (!effect->hasX()) | 84 if (!effect->hasX()) |
85 subregion.setX(uniteRect.x()); | 85 subregion.setX(uniteRect.x()); |
86 if (!effect->hasY()) | 86 if (!effect->hasY()) |
87 subregion.setY(uniteRect.y()); | 87 subregion.setY(uniteRect.y()); |
88 if (!effect->hasWidth()) | 88 if (!effect->hasWidth()) |
89 subregion.setWidth(uniteRect.width()); | 89 subregion.setWidth(uniteRect.width()); |
90 if (!effect->hasHeight()) | 90 if (!effect->hasHeight()) |
91 subregion.setHeight(uniteRect.height()); | 91 subregion.setHeight(uniteRect.height()); |
92 effect->setFilterPrimitiveSubregion(subregion); | 92 effect->setFilterPrimitiveSubregion(subregion); |
93 | 93 |
94 FloatRect absoluteSubregion = filter->mapLocalRectToAbsoluteRect(subregion); | 94 FloatRect absoluteSubregion = filter->absoluteTransform().mapRect(subregion)
; |
95 FloatSize filterResolution = filter->filterResolution(); | 95 FloatSize filterResolution = filter->filterResolution(); |
96 absoluteSubregion.scale(filterResolution.width(), filterResolution.height())
; | 96 absoluteSubregion.scale(filterResolution.width(), filterResolution.height())
; |
97 | 97 |
98 // FEImage needs the unclipped subregion in absolute coordinates to determin
e the correct | 98 // FEImage needs the unclipped subregion in absolute coordinates to determin
e the correct |
99 // destination rect in combination with preserveAspectRatio. | 99 // destination rect in combination with preserveAspectRatio. |
100 if (effect->filterEffectType() == FilterEffectTypeImage) | 100 if (effect->filterEffectType() == FilterEffectTypeImage) |
101 static_cast<FEImage*>(effect)->setAbsoluteSubregion(absoluteSubregion); | 101 static_cast<FEImage*>(effect)->setAbsoluteSubregion(absoluteSubregion); |
102 | 102 |
103 // Clip every filter effect to the filter region. | 103 // Clip every filter effect to the filter region. |
104 FloatRect absoluteScaledFilterRegion = filter->filterRegion(); | 104 FloatRect absoluteScaledFilterRegion = filter->filterRegion(); |
105 absoluteScaledFilterRegion.scale(filterResolution.width(), filterResolution.
height()); | 105 absoluteScaledFilterRegion.scale(filterResolution.width(), filterResolution.
height()); |
106 absoluteSubregion.intersect(absoluteScaledFilterRegion); | 106 absoluteSubregion.intersect(absoluteScaledFilterRegion); |
107 | 107 |
108 effect->setMaxEffectRect(absoluteSubregion); | 108 effect->setMaxEffectRect(absoluteSubregion); |
109 return subregion; | 109 return subregion; |
110 } | 110 } |
111 | 111 |
112 } // namespace WebCore | 112 } // namespace WebCore |
113 | 113 |
114 #endif // ENABLE(SVG) && ENABLE(FILTERS) | 114 #endif // ENABLE(SVG) && ENABLE(FILTERS) |
OLD | NEW |