示例#1
0
void PlatformCALayerRemote::recursiveBuildTransaction(RemoteLayerTreeTransaction& transaction)
{
    if (m_properties.backingStore.display())
        m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BackingStoreChanged);

    if (m_properties.changedProperties != RemoteLayerTreeTransaction::NoChange) {
        if (m_properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
            m_properties.children.clear();
            for (auto layer : m_children)
                m_properties.children.append(layer->layerID());
        }

        if (m_layerType == LayerTypeCustom) {
            RemoteLayerTreePropertyApplier::applyPropertiesToLayer(platformLayer(), m_properties, RemoteLayerTreePropertyApplier::RelatedLayerMap());
            m_properties.changedProperties = RemoteLayerTreeTransaction::NoChange;
            return;
        }

        transaction.layerPropertiesChanged(this, m_properties);
        m_properties.changedProperties = RemoteLayerTreeTransaction::NoChange;
    }

    for (size_t i = 0; i < m_children.size(); ++i) {
        PlatformCALayerRemote* child = toPlatformCALayerRemote(m_children[i].get());
        ASSERT(child->superlayer() == this);
        child->recursiveBuildTransaction(transaction);
    }

    if (m_maskLayer)
        m_maskLayer->recursiveBuildTransaction(transaction);
}
示例#2
0
PlatformCALayerRemote::PlatformCALayerRemote(const PlatformCALayerRemote& other, PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
    : PlatformCALayer(other.layerType(), owner)
    , m_superlayer(nullptr)
    , m_maskLayer(nullptr)
    , m_acceleratesDrawing(other.acceleratesDrawing())
    , m_context(&context)
{
}
示例#3
0
PassRefPtr<PlatformCALayerRemote> PlatformCALayerRemote::create(const PlatformCALayerRemote& other, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext& context)
{
    RefPtr<PlatformCALayerRemote> layer = adoptRef(new PlatformCALayerRemote(other, owner, context));

    context.layerWasCreated(*layer, other.layerType());

    return layer.release();
}
示例#4
0
void PlatformCALayerRemote::recursiveBuildTransaction(RemoteLayerTreeTransaction& transaction)
{
    if (m_properties.backingStore.display())
        m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BackingStoreChanged);

    if (m_properties.changedProperties != RemoteLayerTreeTransaction::NoChange) {
        if (m_properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
            m_properties.children.clear();
            for (auto layer : m_children)
                m_properties.children.append(toPlatformCALayerRemote(layer.get())->layerID());
        }

        transaction.layerPropertiesChanged(this, m_properties);
        m_properties.changedProperties = RemoteLayerTreeTransaction::NoChange;
    }

    for (size_t i = 0; i < m_children.size(); ++i) {
        PlatformCALayerRemote* child = toPlatformCALayerRemote(m_children[i].get());
        ASSERT(child->superlayer() == this);
        child->recursiveBuildTransaction(transaction);
    }
}
void PlatformCALayerRemote::recursiveBuildTransaction(RemoteLayerTreeContext& context, RemoteLayerTreeTransaction& transaction)
{
    ASSERT(!m_properties.backingStore || owner());
    ASSERT_WITH_SECURITY_IMPLICATION(&context == m_context);
    
    if (m_properties.backingStore && (!owner() || !owner()->platformCALayerDrawsContent())) {
        m_properties.backingStore = nullptr;
        m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BackingStoreChanged);
    }

    if (m_properties.backingStore && m_properties.backingStore->display())
        m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BackingStoreChanged);

    if (m_properties.changedProperties != RemoteLayerTreeTransaction::NoChange) {
        if (m_properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
            m_properties.children.clear();
            for (const auto& layer : m_children)
                m_properties.children.append(layer->layerID());
        }

        if (isPlatformCALayerRemoteCustom()) {
            RemoteLayerTreePropertyApplier::applyProperties(platformLayer(), nullptr, m_properties, RemoteLayerTreePropertyApplier::RelatedLayerMap());
            didCommit();
            return;
        }

        transaction.layerPropertiesChanged(*this);
    }

    for (size_t i = 0; i < m_children.size(); ++i) {
        PlatformCALayerRemote* child = toPlatformCALayerRemote(m_children[i].get());
        ASSERT(child->superlayer() == this);
        child->recursiveBuildTransaction(context, transaction);
    }

    if (m_maskLayer)
        m_maskLayer->recursiveBuildTransaction(context, transaction);
}
示例#6
0
void PlatformCALayerRemote::updateClonedLayerProperties(PlatformCALayerRemote& clone, bool copyContents) const
{
    clone.setPosition(position());
    clone.setBounds(bounds());
    clone.setAnchorPoint(anchorPoint());

    if (m_properties.transform)
        clone.setTransform(*m_properties.transform);

    if (m_properties.sublayerTransform)
        clone.setSublayerTransform(*m_properties.sublayerTransform);

    if (copyContents)
        clone.setContents(contents());

    clone.setMasksToBounds(masksToBounds());
    clone.setDoubleSided(isDoubleSided());
    clone.setOpaque(isOpaque());
    clone.setBackgroundColor(backgroundColor());
    clone.setContentsScale(contentsScale());
    clone.setCornerRadius(cornerRadius());

    if (m_properties.shapeRoundedRect)
        clone.setShapeRoundedRect(*m_properties.shapeRoundedRect);

    if (m_properties.filters)
        clone.copyFiltersFrom(*this);

    clone.updateCustomAppearance(customAppearance());
}