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


C++ RenderStyle::deref方法代码示例

本文整理汇总了C++中RenderStyle::deref方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderStyle::deref方法的具体用法?C++ RenderStyle::deref怎么用?C++ RenderStyle::deref使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RenderStyle的用法示例。


在下文中一共展示了RenderStyle::deref方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: canvasResource

SVGResource* SVGClipPathElement::canvasResource()
{
    if (!m_clipper)
        m_clipper = SVGResourceClipper::create();
    else
        m_clipper->resetClipData();

    bool bbox = clipPathUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;

    RenderStyle* clipPathStyle = styleForRenderer(parent()->renderer()); // FIXME: Manual style resolution is a hack
    for (Node* n = firstChild(); n; n = n->nextSibling()) {
        if (n->isSVGElement() && static_cast<SVGElement*>(n)->isStyledTransformable()) {
            SVGStyledTransformableElement* styled = static_cast<SVGStyledTransformableElement*>(n);
            RenderStyle* pathStyle = document()->styleSelector()->styleForElement(styled, clipPathStyle);
            if (pathStyle->display() != NONE) {
                Path pathData = styled->toClipPath();
                // FIXME: How do we know the element has done a layout?
                pathData.transform(styled->animatedLocalTransform());
                if (!pathData.isEmpty())
                    m_clipper->addClipData(pathData, pathStyle->svgStyle()->clipRule(), bbox);
            }
            pathStyle->deref(document()->renderArena());
        }
    }
    if (m_clipper->clipData().isEmpty()) {
        Path pathData;
        pathData.addRect(FloatRect());
        m_clipper->addClipData(pathData, RULE_EVENODD, bbox);
    }
    clipPathStyle->deref(document()->renderArena());
    return m_clipper.get();
}
开发者ID:acss,项目名称:owb-mirror,代码行数:32,代码来源:SVGClipPathElement.cpp

示例2: clipPathUnits

KCanvasClipper *SVGClipPathElement::canvasResource()
{
    if (!view())
        return 0;
    if (!m_clipper)
        m_clipper = static_cast<KCanvasClipper *>(renderingDevice()->createResource(RS_CLIPPER));
    else
        m_clipper->resetClipData();

    bool bbox = clipPathUnits()->baseVal() == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;

    RenderStyle *clipPathStyle = styleForRenderer(parent()->renderer()); // FIXME: Manual style resolution is a hack
    for (Node *n = firstChild(); n != 0; n = n->nextSibling()) {
        SVGElement *e = svg_dynamic_cast(n);
        if (e && e->isStyled()) {
            SVGStyledElement *styled = static_cast<SVGStyledElement *>(e);
            RenderStyle *pathStyle = document()->styleSelector()->styleForElement(styled, clipPathStyle);
            if (KCanvasPath* pathData = styled->toPathData())
                m_clipper->addClipData(pathData, (KCWindRule) pathStyle->svgStyle()->clipRule(), bbox);
            pathStyle->deref(view()->renderArena());
        }
    }
    clipPathStyle->deref(view()->renderArena());
    return m_clipper;
}
开发者ID:oroisec,项目名称:ios,代码行数:25,代码来源:SVGClipPathElement.cpp

示例3: build

bool SVGFEFloodElement::build(FilterBuilder* builder)
{
    RenderStyle* parentStyle = this->styleForRenderer(parent()->renderer());
    RenderStyle* filterStyle = this->resolveStyle(parentStyle);

    Color color = filterStyle->svgStyle()->floodColor();
    float opacity = filterStyle->svgStyle()->floodOpacity();

    parentStyle->deref(document()->renderArena());
    filterStyle->deref(document()->renderArena());

    builder->add(result(), FEFlood::create(color, opacity));
    
    return true;
}
开发者ID:acss,项目名称:owb-mirror,代码行数:15,代码来源:SVGFEFloodElement.cpp

示例4: attach

void HTMLOptGroupElement::attach()
{
    RenderStyle* style = styleForRenderer(0);
    setRenderStyle(style);
    style->deref(document()->renderArena());
    HTMLGenericFormElement::attach();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:7,代码来源:HTMLOptGroupElement.cpp

示例5: setRenderStyle

void HTMLOptGroupElement::setRenderStyle(RenderStyle* newStyle)
{
    RenderStyle* oldStyle = m_style;
    m_style = newStyle;
    if (newStyle)
        newStyle->ref();
    if (oldStyle)
        oldStyle->deref(document()->renderArena());
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:9,代码来源:HTMLOptGroupElement.cpp

示例6: setStyle

void NodeBaseImpl::setStyle(khtml::RenderStyle *style)
{
    RenderStyle *oldStyle = m_style;
    m_style = style;
    if (m_style)
	m_style->ref();
    if (oldStyle)
	oldStyle->deref();
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:9,代码来源:dom_nodeimpl.cpp

示例7: attach

void HTMLOptGroupElement::attach()
{
    if (parentNode()->renderStyle()) {
        RenderStyle* style = styleForRenderer(0);
        setRenderStyle(style);
        style->deref(document()->renderArena());
    }
    HTMLFormControlElement::attach();
}
开发者ID:acss,项目名称:owb-mirror,代码行数:9,代码来源:HTMLOptGroupElement.cpp

示例8: makeRGBA

Vector<SVGGradientStop> SVGGradientElement::buildStops() const
{
    Vector<SVGGradientStop> stops;
    RenderStyle* gradientStyle = 0;

    for (Node* n = firstChild(); n; n = n->nextSibling()) {
        SVGElement* element = n->isSVGElement() ? static_cast<SVGElement*>(n) : 0;

        if (element && element->isGradientStop()) {
            SVGStopElement* stop = static_cast<SVGStopElement*>(element);
            float stopOffset = stop->offset();

            Color color;
            float opacity;

            if (stop->renderer()) {
                RenderStyle* stopStyle = stop->renderer()->style();
                color = stopStyle->svgStyle()->stopColor();
                opacity = stopStyle->svgStyle()->stopOpacity();
            } else {
                // If there is no renderer for this stop element, then a parent element
                // set display="none" - ie. <g display="none"><linearGradient><stop>..
                // Unfortunately we have to manually rebuild the stop style. See pservers-grad-19-b.svg
                if (!gradientStyle)
                    gradientStyle = const_cast<SVGGradientElement*>(this)->styleForRenderer(parent()->renderer());

                RenderStyle* stopStyle = stop->resolveStyle(gradientStyle);

                color = stopStyle->svgStyle()->stopColor();
                opacity = stopStyle->svgStyle()->stopOpacity();

                stopStyle->deref(document()->renderArena());
            }

            stops.append(makeGradientStop(stopOffset, makeRGBA(color.red(), color.green(), color.blue(), int(opacity * 255.))));
        }
    }

    if (gradientStyle)
        gradientStyle->deref(document()->renderArena());

    return stops;
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:43,代码来源:SVGGradientElement.cpp

示例9: build

bool SVGFEDiffuseLightingElement::build(FilterBuilder* builder)
{
    FilterEffect* input1 = builder->getEffectById(in1());
    
    if(!input1)
        return false;
    
    RenderStyle* parentStyle = this->styleForRenderer(parent()->renderer());
    RenderStyle* filterStyle = this->resolveStyle(parentStyle);
    Color color = filterStyle->svgStyle()->lightingColor();
    
    parentStyle->deref(document()->renderArena());
    filterStyle->deref(document()->renderArena());
    
    RefPtr<FilterEffect> addedEffect = FEDiffuseLighting::create(input1, color, surfaceScale(), diffuseConstant(), 
                                            kernelUnitLengthX(), kernelUnitLengthY(), findLights());
    builder->add(result(), addedEffect.release());
    
    return true;
}
开发者ID:acss,项目名称:owb-mirror,代码行数:20,代码来源:SVGFEDiffuseLightingElement.cpp

示例10: rebuildStops

void SVGGradientElement::rebuildStops() const
{
    if (m_resource && !ownerDocument()->parsing()) {
        Vector<KCGradientStop> stops;
         // FIXME: Manual style resolution is a hack
        RenderStyle* gradientStyle = const_cast<SVGGradientElement*>(this)->styleForRenderer(parent()->renderer());
        for (Node *n = firstChild(); n; n = n->nextSibling()) {
            SVGElement *element = svg_dynamic_cast(n);
            if (element && element->isGradientStop()) {
                SVGStopElement *stop = static_cast<SVGStopElement *>(element);
                float stopOffset = stop->offset()->baseVal();
                
                RenderStyle *stopStyle = document()->styleSelector()->styleForElement(stop, gradientStyle);
                Color c = stopStyle->svgStyle()->stopColor();
                float opacity = stopStyle->svgStyle()->stopOpacity();
                
                stops.append(makeGradientStop(stopOffset, makeRGBA(c.red(), c.green(), c.blue(), int(opacity * 255.))));
                stopStyle->deref(view()->renderArena());
            }
        }
        gradientStyle->deref(view()->renderArena());
        m_resource->setGradientStops(stops);
    }
}
开发者ID:oroisec,项目名称:ios,代码行数:24,代码来源:SVGGradientElement.cpp

示例11: while

RenderStyle::~RenderStyle()
{
    RenderStyle *ps = pseudoStyle;
    RenderStyle *prev = 0;

    while (ps) {
        prev = ps;
        ps = ps->pseudoStyle;
	// to prevent a double deletion.
	// this works only because the styles below aren't really shared
	// Dirk said we need another construct as soon as these are shared
        prev->pseudoStyle = 0;
        prev->deref();
    }
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:15,代码来源:render_style.cpp

示例12: attach

void HTMLBodyElementImpl::attach()
{
    assert(!m_render);
    assert(parentNode());
    assert(parentNode()->renderer());

    RenderStyle* style = getDocument()->styleSelector()->styleForElement(this);
    style->ref();
    if (style->display() != NONE) {
        m_render = new RenderBody(this);
        m_render->setStyle(style);
        parentNode()->renderer()->addChild(m_render, nextRenderer());
    }
    style->deref();

    NodeBaseImpl::attach();
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:17,代码来源:html_baseimpl.cpp

示例13: removePseudoStyle

void RenderStyle::removePseudoStyle(PseudoId pid)
{
    RenderStyle *ps = pseudoStyle;
    RenderStyle *prev = this;

    while (ps) {
        if (ps->noninherited_flags.f._styleType==pid) {
            prev->pseudoStyle = ps->pseudoStyle;
            ps->deref();
            return;
        }
        prev = ps;
        ps = ps->pseudoStyle;
    }

    setHasPseudoStyle(pid, false);
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:17,代码来源:render_style.cpp

示例14: arenaDelete

void RenderStyle::arenaDelete(RenderArena *arena)
{
    RenderStyle *ps = pseudoStyle;
    RenderStyle *prev = 0;
    
    while (ps) {
        prev = ps;
        ps = ps->pseudoStyle;
        // to prevent a double deletion.
        // this works only because the styles below aren't really shared
        // Dirk said we need another construct as soon as these are shared
        prev->pseudoStyle = 0;
        prev->deref(arena);
    }
    delete this;
    
    // Recover the size left there for us by operator delete and free the memory.
    arena->free(*(size_t *)this, this);
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:19,代码来源:RenderStyle.cpp

示例15: setStyle

void RenderObject::setStyle(RenderStyle *style)
{
    if (m_style == style)
	return;

    // reset style flags
    m_floating = false;
    m_positioned = false;
    m_relPositioned = false;
    m_printSpecial = false;
    // no support for changing the display type dynamically... object must be
    // detached and re-attached as a different type
    //m_inline = true;
    m_visible = true;

    RenderStyle *oldStyle = m_style;
    m_style = style;
    if (m_style)
	m_style->ref();
    if (oldStyle)
	oldStyle->deref();

    if( m_bgImage != m_style->backgroundImage() ) {
	if(m_bgImage) m_bgImage->deref(this);
	m_bgImage = m_style->backgroundImage();
	if(m_bgImage) m_bgImage->ref(this);
    }

    if( m_style->backgroundColor().isValid() || m_style->hasBorder() || m_bgImage )
        setSpecialObjects(true);
    else
        setSpecialObjects(false);

    if( m_style->visiblity() == HIDDEN || m_style->visiblity() == COLLAPSE )
	m_visible = false;

    setMinMaxKnown(false);
    setLayouted(false);
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:39,代码来源:render_object.cpp


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