本文整理汇总了C++中SVGMarkerElement类的典型用法代码示例。如果您正苦于以下问题:C++ SVGMarkerElement类的具体用法?C++ SVGMarkerElement怎么用?C++ SVGMarkerElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SVGMarkerElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toSVGMarkerElement
AffineTransform RenderSVGResourceMarker::viewportTransform() const
{
SVGMarkerElement* marker = toSVGMarkerElement(element());
ASSERT(marker);
return marker->viewBoxToViewTransform(m_viewport.width(), m_viewport.height());
}
示例2: throwError
JSValue* JSSVGMarkerElementPrototypeFunction::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
{
if (!thisObj->inherits(&JSSVGMarkerElement::info))
return throwError(exec, TypeError);
JSSVGMarkerElement* castedThisObj = static_cast<JSSVGMarkerElement*>(thisObj);
SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThisObj->impl());
switch (id) {
case JSSVGMarkerElement::SetOrientToAutoFuncNum: {
imp->setOrientToAuto();
return jsUndefined();
}
case JSSVGMarkerElement::SetOrientToAngleFuncNum: {
SVGAngle* angle = toSVGAngle(args[0]);
imp->setOrientToAngle(angle);
return jsUndefined();
}
case JSSVGMarkerElement::GetPresentationAttributeFuncNum: {
String name = args[0]->toString(exec);
KJS::JSValue* result = toJS(exec, WTF::getPtr(imp->getPresentationAttribute(name)));
return result;
}
}
return 0;
}
示例3: toSVGMarkerElement
void SVGShapePainter::paintMarker(const PaintInfo& paintInfo, RenderSVGResourceMarker& marker, const MarkerPosition& position, float strokeWidth)
{
// An empty viewBox disables rendering.
SVGMarkerElement* markerElement = toSVGMarkerElement(marker.element());
ASSERT(markerElement);
if (markerElement->hasAttribute(SVGNames::viewBoxAttr) && markerElement->viewBox()->currentValue()->isValid() && markerElement->viewBox()->currentValue()->value().isEmpty())
return;
OwnPtr<DisplayItemList> displayItemList;
if (RuntimeEnabledFeatures::slimmingPaintEnabled())
displayItemList = DisplayItemList::create();
GraphicsContext recordingContext(nullptr, displayItemList.get());
recordingContext.beginRecording(m_renderSVGShape.paintInvalidationRectInLocalCoordinates());
PaintInfo markerPaintInfo(paintInfo);
markerPaintInfo.context = &recordingContext;
{
TransformRecorder transformRecorder(*markerPaintInfo.context, marker.displayItemClient(), marker.markerTransformation(position.origin, position.angle, strokeWidth));
OwnPtr<FloatClipRecorder> clipRecorder;
if (SVGRenderSupport::isOverflowHidden(&marker))
clipRecorder = adoptPtr(new FloatClipRecorder(recordingContext, marker.displayItemClient(), markerPaintInfo.phase, marker.viewport()));
SVGContainerPainter(marker).paint(markerPaintInfo);
}
if (displayItemList)
displayItemList->replay(&recordingContext);
RefPtr<const SkPicture> recording = recordingContext.endRecording();
paintInfo.context->drawPicture(recording.get());
}
示例4: FloatRect
void RenderSVGContainer::calcViewport()
{
SVGElement* svgelem = static_cast<SVGElement*>(element());
if (svgelem->hasTagName(SVGNames::svgTag)) {
SVGSVGElement* svg = static_cast<SVGSVGElement*>(element());
if (!selfNeedsLayout() && !svg->hasRelativeValues())
return;
float x = 0.0f;
float y = 0.0f;
if (parent()->isSVGContainer()) {
x = svg->x().value();
y = svg->y().value();
}
float w = svg->width().value();
float h = svg->height().value();
m_viewport = FloatRect(x, y, w, h);
} else if (svgelem->hasTagName(SVGNames::markerTag)) {
if (!selfNeedsLayout())
return;
SVGMarkerElement* svg = static_cast<SVGMarkerElement*>(element());
float w = svg->markerWidth().value();
float h = svg->markerHeight().value();
m_viewport = FloatRect(0.0f, 0.0f, w, h);
}
}
示例5: markerRef
nsresult
nsSVGMarkerFrame::PaintMark(gfxContext& aContext,
const gfxMatrix& aToMarkedFrameUserSpace,
nsSVGPathGeometryFrame *aMarkedFrame,
nsSVGMark *aMark, float aStrokeWidth)
{
// If the flag is set when we get here, it means this marker frame
// has already been used painting the current mark, and the document
// has a marker reference loop.
if (mInUse)
return NS_OK;
AutoMarkerReferencer markerRef(this, aMarkedFrame);
SVGMarkerElement *marker = static_cast<SVGMarkerElement*>(mContent);
if (!marker->HasValidDimensions()) {
return NS_OK;
}
const nsSVGViewBoxRect viewBox = marker->GetViewBoxRect();
if (viewBox.width <= 0.0f || viewBox.height <= 0.0f) {
// We must disable rendering if the viewBox width or height are zero.
return NS_OK;
}
mStrokeWidth = aStrokeWidth;
mX = aMark->x;
mY = aMark->y;
mAutoAngle = aMark->angle;
mIsStart = aMark->type == nsSVGMark::eStart;
Matrix viewBoxTM = marker->GetViewBoxTransform();
Matrix markerTM = marker->GetMarkerTransform(mStrokeWidth, mX, mY,
mAutoAngle, mIsStart);
gfxMatrix markTM = ThebesMatrix(viewBoxTM) * ThebesMatrix(markerTM) *
aToMarkedFrameUserSpace;
if (StyleDisplay()->IsScrollableOverflow()) {
aContext.Save();
gfxRect clipRect =
nsSVGUtils::GetClipRectForFrame(this, viewBox.x, viewBox.y,
viewBox.width, viewBox.height);
nsSVGUtils::SetClipRect(&aContext, markTM, clipRect);
}
nsIFrame* kid = GetAnonymousChildFrame(this);
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
// The CTM of each frame referencing us may be different.
SVGFrame->NotifySVGChanged(nsISVGChildFrame::TRANSFORM_CHANGED);
nsSVGUtils::PaintFrameWithEffects(kid, aContext, markTM);
if (StyleDisplay()->IsScrollableOverflow())
aContext.Restore();
return NS_OK;
}
示例6: referencePoint
FloatPoint RenderSVGResourceMarker::referencePoint() const
{
SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
ASSERT(marker);
return FloatPoint(marker->refX().value(marker), marker->refY().value(marker));
}
示例7: toSVGMarkerElement
bool LayoutSVGResourceMarker::shouldPaint() const {
// An empty viewBox disables rendering.
SVGMarkerElement* marker = toSVGMarkerElement(element());
ASSERT(marker);
return !marker->viewBox()->isSpecified() ||
!marker->viewBox()->currentValue()->isValid() ||
!marker->viewBox()->currentValue()->value().isEmpty();
}
示例8: toSVGMarkerElement
FloatPoint LayoutSVGResourceMarker::referencePoint() const
{
SVGMarkerElement* marker = toSVGMarkerElement(element());
ASSERT(marker);
SVGLengthContext lengthContext(marker);
return FloatPoint(marker->refX()->currentValue()->value(lengthContext), marker->refY()->currentValue()->value(lengthContext));
}
示例9: jsSVGMarkerElementStyle
JSValue jsSVGMarkerElementStyle(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMarkerElement* castedThis = static_cast<JSSVGMarkerElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style()));
return result;
}
示例10: jsSVGMarkerElementXmlspace
JSValue jsSVGMarkerElementXmlspace(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMarkerElement* castedThis = static_cast<JSSVGMarkerElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThis->impl());
JSValue result = jsString(exec, imp->xmlspace());
return result;
}
示例11: jsSVGMarkerElementPreserveAspectRatio
JSValue jsSVGMarkerElementPreserveAspectRatio(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMarkerElement* castedThis = static_cast<JSSVGMarkerElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThis->impl());
RefPtr<SVGAnimatedPreserveAspectRatio> obj = imp->preserveAspectRatioAnimated();
JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);
return result;
}
示例12: jsSVGMarkerElementExternalResourcesRequired
JSValue jsSVGMarkerElementExternalResourcesRequired(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSSVGMarkerElement* castedThis = static_cast<JSSVGMarkerElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThis->impl());
RefPtr<SVGAnimatedBoolean> obj = imp->externalResourcesRequiredAnimated();
JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);
return result;
}
示例13: jsSVGMarkerElementPrototypeFunctionSetOrientToAuto
JSValue* jsSVGMarkerElementPrototypeFunctionSetOrientToAuto(ExecState* exec, JSObject*, JSValue* thisValue, const ArgList& args)
{
if (!thisValue->isObject(&JSSVGMarkerElement::s_info))
return throwError(exec, TypeError);
JSSVGMarkerElement* castedThisObj = static_cast<JSSVGMarkerElement*>(thisValue);
SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThisObj->impl());
imp->setOrientToAuto();
return jsUndefined();
}
示例14: jsSVGMarkerElementPrototypeFunctionSetOrientToAuto
JSValue JSC_HOST_CALL jsSVGMarkerElementPrototypeFunctionSetOrientToAuto(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args)
{
UNUSED_PARAM(args);
if (!thisValue.inherits(&JSSVGMarkerElement::s_info))
return throwError(exec, TypeError);
JSSVGMarkerElement* castedThisObj = static_cast<JSSVGMarkerElement*>(asObject(thisValue));
SVGMarkerElement* imp = static_cast<SVGMarkerElement*>(castedThisObj->impl());
imp->setOrientToAuto();
return jsUndefined();
}
示例15: angle
float RenderSVGResourceMarker::angle() const
{
SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
ASSERT(marker);
float angle = -1;
if (marker->orientType() == SVGMarkerOrientAngle)
angle = marker->orientAngle().value();
return angle;
}