本文整理汇总了C++中SVGMaskElement类的典型用法代码示例。如果您正苦于以下问题:C++ SVGMaskElement类的具体用法?C++ SVGMaskElement怎么用?C++ SVGMaskElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SVGMaskElement类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resourceBoundingBox
FloatRect RenderSVGResourceMasker::resourceBoundingBox(RenderObject* object)
{
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
ASSERT(maskElement);
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect maskBoundaries = maskElement->maskBoundingBox(objectBoundingBox);
// Resource was not layouted yet. Give back clipping rect of the mask.
if (selfNeedsLayout())
return maskBoundaries;
if (m_maskContentBoundaries.isEmpty())
calculateMaskContentRepaintRect();
FloatRect maskRect = m_maskContentBoundaries;
if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskBoundaries);
return maskRect;
}
示例2: resourceBoundingBox
FloatRect RenderSVGResourceMasker::resourceBoundingBox(RenderObject* object)
{
// Save the reference to the calling object for relayouting it on changing resource properties.
if (!m_masker.contains(object))
m_masker.set(object, new MaskerData);
// Resource was not layouted yet. Give back clipping rect of the mask.
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect maskBoundaries = maskElement->maskBoundingBox(objectBoundingBox);
if (selfNeedsLayout())
return maskBoundaries;
if (m_maskBoundaries.isEmpty())
calculateMaskContentRepaintRect();
if (!maskElement)
return FloatRect();
FloatRect maskRect = m_maskBoundaries;
if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskBoundaries);
return maskRect;
}
示例3: toSVGMaskElement
FloatRect LayoutSVGResourceMasker::resourceBoundingBox(const LayoutObject* object)
{
SVGMaskElement* maskElement = toSVGMaskElement(element());
ASSERT(maskElement);
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect maskBoundaries = SVGLengthContext::resolveRectangle<SVGMaskElement>(maskElement, maskElement->maskUnits()->currentValue()->enumValue(), objectBoundingBox);
// Resource was not layouted yet. Give back clipping rect of the mask.
if (selfNeedsLayout())
return maskBoundaries;
if (m_maskContentBoundaries.isEmpty())
calculateMaskContentPaintInvalidationRect();
FloatRect maskRect = m_maskContentBoundaries;
if (maskElement->maskContentUnits()->currentValue()->value() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskBoundaries);
return maskRect;
}
示例4: jsSVGMaskElementStyle
JSValue jsSVGMaskElementStyle(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style()));
return result;
}
示例5: jsSVGMaskElementXmlspace
JSValue jsSVGMaskElementXmlspace(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
JSValue result = jsString(exec, imp->xmlspace());
return result;
}
示例6: jsSVGMaskElementClassName
JSValue jsSVGMaskElementClassName(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
RefPtr<SVGAnimatedString> obj = imp->classNameAnimated();
JSValue result = toJS(exec, castedThis->globalObject(), obj.get());
return result;
}
示例7: jsSVGMaskElementExternalResourcesRequired
JSValue jsSVGMaskElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
JSValue result = toJS(exec, castedThis->globalObject(), obj.get());
return result;
}
示例8: jsSVGMaskElementMaskContentUnits
JSValue jsSVGMaskElementMaskContentUnits(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
RefPtr<SVGAnimatedEnumeration> obj = imp->maskContentUnitsAnimated();
JSValue result = toJS(exec, castedThis->globalObject(), obj.get());
return result;
}
示例9: jsSVGMaskElementPrototypeFunctionGetPresentationAttribute
EncodedJSValue JSC_HOST_CALL jsSVGMaskElementPrototypeFunctionGetPresentationAttribute(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSSVGMaskElement::s_info))
return throwVMTypeError(exec);
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGMaskElement::s_info);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
const String& name(ustringToString(exec->argument(0).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name)));
return JSValue::encode(result);
}
示例10: jsSVGMaskElementPrototypeFunctionHasExtension
EncodedJSValue JSC_HOST_CALL jsSVGMaskElementPrototypeFunctionHasExtension(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSSVGMaskElement::s_info))
return throwVMTypeError(exec);
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGMaskElement::s_info);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
const String& extension(ustringToString(exec->argument(0).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
JSC::JSValue result = jsBoolean(imp->hasExtension(extension));
return JSValue::encode(result);
}
示例11: jsSVGMaskElementSystemLanguage
JSValue jsSVGMaskElementSystemLanguage(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGStaticListPropertyTearOff<SVGStringList>::create(GetOwnerElementForType<SVGMaskElement, IsDerivedFromSVGElement<SVGMaskElement>::value>::ownerElement(imp), imp->systemLanguage())));
return result;
}
示例12: calculateMaskContentRepaintRect
FloatRect RenderSVGResourceMasker::resourceBoundingBox(const FloatRect& objectBoundingBox)
{
if (m_maskBoundaries.isEmpty())
calculateMaskContentRepaintRect();
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
if (!maskElement)
return FloatRect();
FloatRect maskRect = m_maskBoundaries;
if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskElement->maskBoundingBox(objectBoundingBox));
return maskRect;
}
示例13: setJSSVGMaskElementXmlspace
void setJSSVGMaskElementXmlspace(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSSVGMaskElement* castedThis = static_cast<JSSVGMaskElement*>(thisObject);
SVGMaskElement* imp = static_cast<SVGMaskElement*>(castedThis->impl());
imp->setXmlspace(ustringToString(value.toString(exec)));
}