Пример #1
0
void GraphicsLayerBlackBerry::setContentsToImage(Image* image)
{
    bool childrenChanged = false;
    if (image) {
        m_contentsLayerPurpose = ContentsLayerForImage;
        if (!m_contentsLayer)
            childrenChanged = true;
    } else {
        m_contentsLayerPurpose = NoContentsLayer;
        if (m_contentsLayer)
            childrenChanged = true;
    }

    updateContentsImage(image);

    if (childrenChanged)
        updateSublayerList();
}
void GraphicsLayerCACF::setContentsToImage(Image* image)
{
    bool childrenChanged = false;

    if (image) {
        m_pendingContentsImage = image->nativeImageForCurrentFrame();
        m_contentsLayerPurpose = ContentsLayerForImage;
        if (!m_contentsLayer)
            childrenChanged = true;
    } else {
        m_pendingContentsImage = 0;
        m_contentsLayerPurpose = NoContentsLayer;
        if (m_contentsLayer)
            childrenChanged = true;
    }

    updateContentsImage();

    // This has to happen after updateContentsImage
    if (childrenChanged)
        updateSublayerList();
}