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


C++ StyleDifference类代码示例

本文整理汇总了C++中StyleDifference的典型用法代码示例。如果您正苦于以下问题:C++ StyleDifference类的具体用法?C++ StyleDifference怎么用?C++ StyleDifference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: visualInvalidationDiff

StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) const
{
    // Note, we use .get() on each DataRef below because DataRef::operator== will do a deep
    // compare, which is duplicate work when we're going to compare each property inside
    // this function anyway.

    StyleDifference diff;

    if (diffNeedsFullLayout(other)) {
        diff.setNeedsFullLayout();
    } else if (position() != StaticPosition && surround->offset != other.surround->offset) {
        // Optimize for the case where a positioned layer is moving but not changing size.
        if (positionedObjectMovedOnly(surround->offset, other.surround->offset, m_box->width()))
            diff.setNeedsPositionedMovementLayout();
        else
            diff.setNeedsFullLayout();
    }

    updatePropertySpecificDifferences(other, diff);

    // Cursors are not checked, since they will be set appropriately in response to mouse events,
    // so they don't need to cause any paint invalidation or layout.

    return diff;
}
开发者ID:rmacnak-google,项目名称:engine,代码行数:25,代码来源:RenderStyle.cpp

示例2: styleWillChange

void RenderLayerModelObject::styleWillChange(StyleDifference diff, const RenderStyle& newStyle)
{
    s_wasFloating = isFloating();

    // If our z-index changes value or our visibility changes,
    // we need to dirty our stacking context's z-order list.
    RenderStyle* oldStyle = style();
    if (oldStyle) {
        // Do a repaint with the old style first through RenderLayerRepainter.
        // RenderObject::styleWillChange takes care of repainting objects without RenderLayers.
        if (parent() && diff.needsRepaintLayer()) {
            layer()->repainter().repaintIncludingNonCompositingDescendants();
            if (oldStyle->hasClip() != newStyle.hasClip()
                || oldStyle->clip() != newStyle.clip())
                layer()->clipper().clearClipRectsIncludingDescendants();
        } else if (diff.needsFullLayout()) {
            if (hasLayer()) {
                if (!layer()->hasCompositedLayerMapping() && oldStyle->position() != newStyle.position())
                    layer()->repainter().repaintIncludingNonCompositingDescendants();
            } else if (newStyle.hasTransform() || newStyle.opacity() < 1 || newStyle.hasFilter()) {
                // If we don't have a layer yet, but we are going to get one because of transform or opacity,
                //  then we need to repaint the old position of the object.
                paintInvalidationForWholeRenderer();
            }
        }
    }

    RenderObject::styleWillChange(diff, newStyle);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:29,代码来源:RenderLayerModelObject.cpp

示例3: svgExtensionsFromElement

void RenderSVGResourceContainer::registerResource()
{
    SVGDocumentExtensions& extensions = svgExtensionsFromElement(element());
    if (!extensions.hasPendingResource(m_id)) {
        extensions.addResource(m_id, this);
        return;
    }

    OwnPtr<SVGDocumentExtensions::SVGPendingElements> clients(extensions.removePendingResource(m_id));

    // Cache us with the new id.
    extensions.addResource(m_id, this);

    // Update cached resources of pending clients.
    const SVGDocumentExtensions::SVGPendingElements::const_iterator end = clients->end();
    for (SVGDocumentExtensions::SVGPendingElements::const_iterator it = clients->begin(); it != end; ++it) {
        ASSERT((*it)->hasPendingResources());
        extensions.clearHasPendingResourcesIfPossible(*it);
        RenderObject* renderer = (*it)->renderer();
        if (!renderer)
            continue;

        StyleDifference diff;
        diff.setNeedsFullLayout();
        SVGResourcesCache::clientStyleChanged(renderer, diff, renderer->style());
        renderer->setNeedsLayoutAndFullPaintInvalidation();
    }
}
开发者ID:ewilligers,项目名称:blink,代码行数:28,代码来源:RenderSVGResourceContainer.cpp

示例4: styleDidChange

void LayoutSVGRoot::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
{
    if (diff.needsFullLayout())
        setNeedsBoundariesUpdate();
    if (diff.needsPaintInvalidation()) {
        // Box decorations may have appeared/disappeared - recompute status.
        m_hasBoxDecorationBackground = calculateHasBoxDecorations();
    }

    LayoutReplaced::styleDidChange(diff, oldStyle);
    SVGResourcesCache::clientStyleChanged(this, diff, styleRef());
}
开发者ID:mtucker6784,项目名称:chromium,代码行数:12,代码来源:LayoutSVGRoot.cpp

示例5: styleDidChange

void RenderSVGRoot::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
    if (diff.needsFullLayout())
        setNeedsBoundariesUpdate();
    if (diff.needsRepaint()) {
        // Box decorations may have appeared/disappeared - recompute status.
        m_hasBoxDecorations = calculateHasBoxDecorations();
    }

    RenderReplaced::styleDidChange(diff, oldStyle);
    SVGResourcesCache::clientStyleChanged(this, diff, style());
}
开发者ID:coinpayee,项目名称:blink,代码行数:12,代码来源:RenderSVGRoot.cpp

示例6: diff

StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
{
    StyleDifference styleDifference;

    if (diffNeedsLayoutAndPaintInvalidation(other)) {
        styleDifference.setNeedsFullLayout();
        styleDifference.setNeedsPaintInvalidationObject();
    } else if (diffNeedsPaintInvalidation(other)) {
        styleDifference.setNeedsPaintInvalidationObject();
    }

    return styleDifference;
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:13,代码来源:SVGRenderStyle.cpp

示例7: diff

StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
{
    StyleDifference styleDifference;

    if (diffNeedsLayoutAndRepaint(other)) {
        styleDifference.setNeedsFullLayout();
        styleDifference.setNeedsRepaintObject();
    } else if (diffNeedsRepaint(other)) {
        styleDifference.setNeedsRepaintObject();
    }

    return styleDifference;
}
开发者ID:ewilligers,项目名称:blink,代码行数:13,代码来源:SVGRenderStyle.cpp

示例8: styleDidChange

void LayoutTableRow::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
{
    ASSERT(style()->display() == TABLE_ROW);

    LayoutBox::styleDidChange(diff, oldStyle);
    propagateStyleToAnonymousChildren();

    if (section() && oldStyle && style()->logicalHeight() != oldStyle->logicalHeight())
        section()->rowLogicalHeightChanged(this);

    // If border was changed, notify table.
    if (parent()) {
        LayoutTable* table = this->table();
        if (table && !table->selfNeedsLayout() && !table->normalChildNeedsLayout() && oldStyle && oldStyle->border() != style()->border())
            table->invalidateCollapsedBorders();

        if (table && oldStyle && diff.needsFullLayout() && needsLayout() && table->collapseBorders() && borderWidthChanged(oldStyle, style())) {
            // If the border width changes on a row, we need to make sure the cells in the row know to lay out again.
            // This only happens when borders are collapsed, since they end up affecting the border sides of the cell
            // itself.
            for (LayoutBox* childBox = firstChildBox(); childBox; childBox = childBox->nextSiblingBox()) {
                if (!childBox->isTableCell())
                    continue;
                childBox->setChildNeedsLayout();
            }
        }
    }
}
开发者ID:JiangSuyong,项目名称:chromium,代码行数:28,代码来源:LayoutTableRow.cpp

示例9: styleDidChange

void LayoutSVGInline::styleDidChange(StyleDifference diff,
                                     const ComputedStyle* oldStyle) {
  if (diff.needsFullLayout())
    setNeedsBoundariesUpdate();

  LayoutInline::styleDidChange(diff, oldStyle);
  SVGResourcesCache::clientStyleChanged(this, diff, styleRef());
}
开发者ID:ollie314,项目名称:chromium,代码行数:8,代码来源:LayoutSVGInline.cpp

示例10: updatePropertySpecificDifferences

void RenderStyle::updatePropertySpecificDifferences(const RenderStyle& other, StyleDifference& diff) const
{
    // StyleAdjuster has ensured that zIndex is non-auto only if it's applicable.
    if (m_box->zIndex() != other.m_box->zIndex() || m_box->hasAutoZIndex() != other.m_box->hasAutoZIndex())
        diff.setZIndexChanged();

    if (rareNonInheritedData.get() != other.rareNonInheritedData.get()) {
        if (!transformDataEquivalent(other))
            diff.setTransformChanged();

        if (rareNonInheritedData->opacity != other.rareNonInheritedData->opacity)
            diff.setOpacityChanged();

        if (rareNonInheritedData->m_filter != other.rareNonInheritedData->m_filter)
            diff.setFilterChanged();
    }
}
开发者ID:rmacnak-google,项目名称:engine,代码行数:17,代码来源:RenderStyle.cpp

示例11: styleDidChange

void LayoutSVGBlock::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
{
    if (diff.needsFullLayout()) {
        setNeedsBoundariesUpdate();
        if (diff.transformChanged())
            setNeedsTransformUpdate();
    }

    if (isBlendingAllowed()) {
        bool hasBlendModeChanged = (oldStyle && oldStyle->hasBlendMode()) == !style()->hasBlendMode();
        if (parent() && hasBlendModeChanged)
            parent()->descendantIsolationRequirementsChanged(style()->hasBlendMode() ? DescendantIsolationRequired : DescendantIsolationNeedsUpdate);
    }

    LayoutBlock::styleDidChange(diff, oldStyle);
    SVGResourcesCache::clientStyleChanged(this, diff, styleRef());
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:17,代码来源:LayoutSVGBlock.cpp

示例12: styleDidChange

void RenderSVGBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
    if (diff.needsFullLayout())
        setNeedsBoundariesUpdate();

    RenderBlock::styleDidChange(diff, oldStyle);
    SVGResourcesCache::clientStyleChanged(this, diff, style());
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:8,代码来源:RenderSVGBlock.cpp

示例13: styleDidChange

void LayoutScrollbarPart::styleDidChange(StyleDifference diff, const ComputedStyle* oldStyle)
{
    LayoutBlock::styleDidChange(diff, oldStyle);
    setInline(false);
    clearPositionedState();
    setFloating(false);
    setHasOverflowClip(false);
    if (oldStyle && m_scrollbar && m_part != NoPart && (diff.needsPaintInvalidation() || diff.needsLayout()))
        m_scrollbar->theme()->invalidatePart(m_scrollbar, m_part);
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:10,代码来源:LayoutScrollbarPart.cpp

示例14: paintTextWithShadows

void SVGInlineTextBoxPainter::paintText(const PaintInfo& paintInfo, const ComputedStyle& style,
    const ComputedStyle& selectionStyle, const SVGTextFragment& fragment,
    LayoutSVGResourceMode resourceMode, bool shouldPaintSelection)
{
    int startPosition = 0;
    int endPosition = 0;
    if (shouldPaintSelection) {
        m_svgInlineTextBox.selectionStartEnd(startPosition, endPosition);
        shouldPaintSelection = m_svgInlineTextBox.mapStartEndPositionsIntoFragmentCoordinates(fragment, startPosition, endPosition);
    }

    // Fast path if there is no selection, just draw the whole chunk part using the regular style
    TextRun textRun = m_svgInlineTextBox.constructTextRun(style, fragment);
    if (!shouldPaintSelection || startPosition >= endPosition) {
        paintTextWithShadows(paintInfo, style, textRun, fragment, 0, fragment.length, resourceMode);
        return;
    }

    // Eventually draw text using regular style until the start position of the selection
    bool paintSelectedTextOnly = paintInfo.phase == PaintPhaseSelection;
    if (startPosition > 0 && !paintSelectedTextOnly)
        paintTextWithShadows(paintInfo, style, textRun, fragment, 0, startPosition, resourceMode);

    // Draw text using selection style from the start to the end position of the selection
    if (style != selectionStyle) {
        StyleDifference diff;
        diff.setNeedsPaintInvalidationObject();
        SVGResourcesCache::clientStyleChanged(&m_svgInlineTextBox.parent()->layoutObject(), diff, selectionStyle);
    }

    paintTextWithShadows(paintInfo, selectionStyle, textRun, fragment, startPosition, endPosition, resourceMode);

    if (style != selectionStyle) {
        StyleDifference diff;
        diff.setNeedsPaintInvalidationObject();
        SVGResourcesCache::clientStyleChanged(&m_svgInlineTextBox.parent()->layoutObject(), diff, style);
    }

    // Eventually draw text using regular style from the end position of the selection to the end of the current chunk part
    if (endPosition < static_cast<int>(fragment.length) && !paintSelectedTextOnly)
        paintTextWithShadows(paintInfo, style, textRun, fragment, endPosition, fragment.length, resourceMode);
}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:42,代码来源:SVGInlineTextBoxPainter.cpp

示例15: styleDidChange

void RenderSVGModelObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
    if (diff.needsFullLayout()) {
        setNeedsBoundariesUpdate();
        if (style()->hasTransform())
            setNeedsTransformUpdate();
    }

    RenderObject::styleDidChange(diff, oldStyle);
    SVGResourcesCache::clientStyleChanged(this, diff, style());
}
开发者ID:coinpayee,项目名称:blink,代码行数:11,代码来源:RenderSVGModelObject.cpp


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