24 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
27 #include "SVGRenderTreeAsText.h"
32 SVGFilterEffect::SVGFilterEffect(SVGResourceFilter* filter)
36 , m_widthBBoxMode(false)
37 , m_heightBBoxMode(false)
41 FloatRect SVGFilterEffect::primitiveBBoxForFilterBBox(
const FloatRect& filterBBox,
const FloatRect& itemBBox)
const
43 FloatRect subRegionBBox = subRegion();
44 FloatRect useBBox = filterBBox;
50 if (m_filter->effectBoundingBoxMode()) {
51 if (!m_filter->filterBoundingBoxMode())
54 subRegionBBox = FloatRect(useBBox.x() + subRegionBBox.x() * useBBox.width(),
55 useBBox.y() + subRegionBBox.y() * useBBox.height(),
56 subRegionBBox.width() * useBBox.width(),
57 subRegionBBox.height() * useBBox.height());
59 if (xBoundingBoxMode())
60 subRegionBBox.setX(useBBox.x() + subRegionBBox.x() * useBBox.width());
62 if (yBoundingBoxMode())
63 subRegionBBox.setY(useBBox.y() + subRegionBBox.y() * useBBox.height());
65 if (widthBoundingBoxMode())
66 subRegionBBox.setWidth(subRegionBBox.width() * useBBox.width());
68 if (heightBoundingBoxMode())
69 subRegionBBox.setHeight(subRegionBBox.height() * useBBox.height());
75 FloatRect SVGFilterEffect::subRegion()
const
80 void SVGFilterEffect::setSubRegion(
const FloatRect& subRegion)
82 m_subRegion = subRegion;
85 String SVGFilterEffect::in()
const
90 void SVGFilterEffect::setIn(
const String& in)
95 String SVGFilterEffect::result()
const
100 void SVGFilterEffect::setResult(
const String& result)
105 SVGResourceFilter* SVGFilterEffect::filter()
const
110 void SVGFilterEffect::setFilter(SVGResourceFilter* filter)
115 TextStream& SVGFilterEffect::externalRepresentation(TextStream& ts)
const
118 ts <<
"[in=\"" << in() <<
"\"]";
119 if (!result().isEmpty())
120 ts <<
" [result=\"" << result() <<
"\"]";
121 if (!subRegion().isEmpty())
122 ts <<
" [subregion=\"" << subRegion() <<
"\"]";
126 TextStream&
operator<<(TextStream& ts,
const SVGFilterEffect& e)
128 return e.externalRepresentation(ts);
133 #endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
QDebug operator<<(QDebug s, KDebugStreamFunction f)