本文整理汇总了C++中SVGResources::masker方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGResources::masker方法的具体用法?C++ SVGResources::masker怎么用?C++ SVGResources::masker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGResources
的用法示例。
在下文中一共展示了SVGResources::masker方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersectRepaintRectWithResources
void SVGRenderSupport::intersectRepaintRectWithResources(const RenderObject* object, FloatRect& repaintRect)
{
ASSERT(object);
RenderStyle* style = object->style();
ASSERT(style);
const SVGRenderStyle* svgStyle = style->svgStyle();
ASSERT(svgStyle);
RenderObject* renderer = const_cast<RenderObject*>(object);
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer);
if (!resources) {
if (const ShadowData* shadow = svgStyle->shadow())
shadow->adjustRectForShadow(repaintRect);
return;
}
#if ENABLE(FILTERS)
if (RenderSVGResourceFilter* filter = resources->filter())
repaintRect = filter->resourceBoundingBox(renderer);
#endif
if (RenderSVGResourceClipper* clipper = resources->clipper())
repaintRect.intersect(clipper->resourceBoundingBox(renderer));
if (RenderSVGResourceMasker* masker = resources->masker())
repaintRect.intersect(masker->resourceBoundingBox(renderer));
if (const ShadowData* shadow = svgStyle->shadow())
shadow->adjustRectForShadow(repaintRect);
}
示例2: prepareToRenderSVGContent
bool SVGRenderSupport::prepareToRenderSVGContent(RenderObject* object, PaintInfo& paintInfo)
{
ASSERT(object);
RenderStyle* style = object->style();
ASSERT(style);
const SVGRenderStyle* svgStyle = style->svgStyle();
ASSERT(svgStyle);
// Setup transparency layers before setting up SVG resources!
float opacity = style->opacity();
const ShadowData* shadow = svgStyle->shadow();
if (opacity < 1 || shadow) {
FloatRect repaintRect = object->repaintRectInLocalCoordinates();
if (opacity < 1) {
paintInfo.context->clip(repaintRect);
paintInfo.context->beginTransparencyLayer(opacity);
}
if (shadow) {
paintInfo.context->clip(repaintRect);
paintInfo.context->setShadow(IntSize(shadow->x(), shadow->y()), shadow->blur(), shadow->color(), style->colorSpace());
paintInfo.context->beginTransparencyLayer(1);
}
}
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object);
if (!resources) {
#if ENABLE(FILTERS)
if (svgStyle->hasFilter())
return false;
#endif
return true;
}
if (RenderSVGResourceMasker* masker = resources->masker()) {
if (!masker->applyResource(object, style, paintInfo.context, ApplyToDefaultMode))
return false;
}
if (RenderSVGResourceClipper* clipper = resources->clipper()) {
if (!clipper->applyResource(object, style, paintInfo.context, ApplyToDefaultMode))
return false;
}
#if ENABLE(FILTERS)
if (RenderSVGResourceFilter* filter = resources->filter()) {
if (!filter->applyResource(object, style, paintInfo.context, ApplyToDefaultMode))
return false;
}
#endif
return true;
}
示例3: intersectRepaintRectWithResources
void SVGRenderSupport::intersectRepaintRectWithResources(const RenderObject* renderer, FloatRect& repaintRect)
{
ASSERT(renderer);
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(renderer);
if (!resources)
return;
if (RenderSVGResourceFilter* filter = resources->filter())
repaintRect = filter->resourceBoundingBox(renderer);
if (RenderSVGResourceClipper* clipper = resources->clipper())
repaintRect.intersect(clipper->resourceBoundingBox(renderer));
if (RenderSVGResourceMasker* masker = resources->masker())
repaintRect.intersect(masker->resourceBoundingBox(renderer));
}
示例4: intersectPaintInvalidationRectWithResources
void SVGLayoutSupport::intersectPaintInvalidationRectWithResources(const LayoutObject* layoutObject, FloatRect& paintInvalidationRect)
{
ASSERT(layoutObject);
SVGResources* resources = SVGResourcesCache::cachedResourcesForLayoutObject(layoutObject);
if (!resources)
return;
if (LayoutSVGResourceFilter* filter = resources->filter())
paintInvalidationRect = filter->resourceBoundingBox(layoutObject);
if (LayoutSVGResourceClipper* clipper = resources->clipper())
paintInvalidationRect.intersect(clipper->resourceBoundingBox(layoutObject));
if (LayoutSVGResourceMasker* masker = resources->masker())
paintInvalidationRect.intersect(masker->resourceBoundingBox(layoutObject));
}
示例5: intersectRepaintRectWithResources
void SVGRenderSupport::intersectRepaintRectWithResources(const RenderElement& renderer, FloatRect& repaintRect)
{
SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(&renderer);
if (!resources)
return;
#if ENABLE(FILTERS)
if (RenderSVGResourceFilter* filter = resources->filter())
repaintRect = filter->resourceBoundingBox(renderer);
#endif
if (RenderSVGResourceClipper* clipper = resources->clipper())
repaintRect.intersect(clipper->resourceBoundingBox(renderer));
if (RenderSVGResourceMasker* masker = resources->masker())
repaintRect.intersect(masker->resourceBoundingBox(renderer));
}