Exemplo n.º 1
0
void FillLayer::computeClipMax() const
{
    if (m_next) {
        m_next->computeClipMax();
        m_clipMax = clipMax(clip(), m_next->clip());
    } else
        m_clipMax = m_clip;
}
Exemplo n.º 2
0
void FillLayer::computeClipMax() const
{
    Vector<const FillLayer*, 4> layers;
    for (auto* layer = this; layer; layer = layer->m_next.get())
        layers.append(layer);
    EFillBox computedClipMax = TextFillBox;
    for (unsigned i = layers.size(); i; --i) {
        auto& layer = *layers[i - 1];
        computedClipMax = clipMax(computedClipMax, layer.clip());
        layer.m_clipMax = computedClipMax;
    }
}
void FillLayer::computeCachedPropertiesIfNeeded() const
{
    if (m_cachedPropertiesComputed)
        return;
    m_thisOrNextLayersClipMax = clip();
    m_thisOrNextLayersUseContentBox = clip() == ContentFillBox || origin() == ContentFillBox;
    m_thisOrNextLayersHaveLocalAttachment = attachment() == LocalBackgroundAttachment;
    m_cachedPropertiesComputed = true;

    if (m_next) {
        m_next->computeCachedPropertiesIfNeeded();
        m_thisOrNextLayersClipMax = clipMax(thisOrNextLayersClipMax(), m_next->thisOrNextLayersClipMax());
        m_thisOrNextLayersUseContentBox |= m_next->m_thisOrNextLayersUseContentBox;
        m_thisOrNextLayersHaveLocalAttachment |= m_next->m_thisOrNextLayersHaveLocalAttachment;
    }
}