Exemplo n.º 1
0
void WKCACFLayer::internalCheckLayerConsistency()
{
    ASSERT(layer());
    size_t n = sublayerCount();
    for (size_t i = 0; i < n; ++i) {
        // This will ASSERT in internalSublayerAtIndex if this entry doesn't have proper user data
        WKCACFLayer* sublayer = internalSublayerAtIndex(i);

        // Make sure we don't have any null entries in the list
        ASSERT(sublayer);

        // Make sure the each layer has a corresponding CACFLayer
        ASSERT(sublayer->layer());
    }
}
Exemplo n.º 2
0
void WKCACFLayer::setNeedsCommit()
{
    WKCACFLayer* root = rootLayer();

    CACFContextRef context = CACFLayerGetContext(root->layer());

    // The context might now be set yet. This happens if a property gets set
    // before placing the layer in the tree. In this case we don't need to 
    // worry about remembering the context because we will when the layer is
    // added to the tree.
    if (context)
        WKCACFContextFlusher::shared().addContext(context);

    // Call setNeedsRender on the root layer, which will cause a render to 
    // happen in WKCACFLayerRenderer
    root->setNeedsRender();
}