本文整理汇总了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();
}
示例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;
}
示例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;
}
示例4: attach
void HTMLOptGroupElement::attach()
{
RenderStyle* style = styleForRenderer(0);
setRenderStyle(style);
style->deref(document()->renderArena());
HTMLGenericFormElement::attach();
}
示例5: setRenderStyle
void HTMLOptGroupElement::setRenderStyle(RenderStyle* newStyle)
{
RenderStyle* oldStyle = m_style;
m_style = newStyle;
if (newStyle)
newStyle->ref();
if (oldStyle)
oldStyle->deref(document()->renderArena());
}
示例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();
}
示例7: attach
void HTMLOptGroupElement::attach()
{
if (parentNode()->renderStyle()) {
RenderStyle* style = styleForRenderer(0);
setRenderStyle(style);
style->deref(document()->renderArena());
}
HTMLFormControlElement::attach();
}
示例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;
}
示例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;
}
示例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);
}
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}