当前位置: 首页>>代码示例>>C++>>正文


C++ SVGMarkerElement类代码示例

本文整理汇总了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());
}
开发者ID:junmin-zhu,项目名称:blink-crosswalk,代码行数:7,代码来源:RenderSVGResourceMarker.cpp

示例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;
}
开发者ID:Crawping,项目名称:davinci,代码行数:30,代码来源:JSSVGMarkerElement.cpp

示例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());
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:30,代码来源:SVGShapePainter.cpp

示例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);
    }
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:28,代码来源:RenderSVGContainer.cpp

示例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;
}
开发者ID:Acidburn0zzz,项目名称:tor-browser,代码行数:60,代码来源:nsSVGMarkerFrame.cpp

示例6: referencePoint

FloatPoint RenderSVGResourceMarker::referencePoint() const
{
    SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(node());
    ASSERT(marker);

    return FloatPoint(marker->refX().value(marker), marker->refY().value(marker));
}
开发者ID:13W,项目名称:phantomjs,代码行数:7,代码来源:RenderSVGResourceMarker.cpp

示例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();
}
开发者ID:mirror,项目名称:chromium,代码行数:8,代码来源:LayoutSVGResourceMarker.cpp

示例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));
}
开发者ID:dstockwell,项目名称:blink,代码行数:8,代码来源:LayoutSVGResourceMarker.cpp

示例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;
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:8,代码来源:JSSVGMarkerElement.cpp

示例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;
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:8,代码来源:JSSVGMarkerElement.cpp

示例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;
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:9,代码来源:JSSVGMarkerElement.cpp

示例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;
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:9,代码来源:JSSVGMarkerElement.cpp

示例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();
}
开发者ID:achellies,项目名称:ISeeBrowser,代码行数:10,代码来源:JSSVGMarkerElement.cpp

示例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();
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:11,代码来源:JSSVGMarkerElement.cpp

示例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;
}
开发者ID:windyuuy,项目名称:opera,代码行数:11,代码来源:RenderSVGResourceMarker.cpp


注:本文中的SVGMarkerElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。