本文整理汇总了C++中SVGDocumentExtensions::clearHasPendingResourcesIfPossible方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGDocumentExtensions::clearHasPendingResourcesIfPossible方法的具体用法?C++ SVGDocumentExtensions::clearHasPendingResourcesIfPossible怎么用?C++ SVGDocumentExtensions::clearHasPendingResourcesIfPossible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGDocumentExtensions
的用法示例。
在下文中一共展示了SVGDocumentExtensions::clearHasPendingResourcesIfPossible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: registerResource
void RenderSVGResourceContainer::registerResource()
{
SVGDocumentExtensions* extensions = svgExtensionsFromNode(node());
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;
SVGResourcesCache::clientStyleChanged(renderer, StyleDifferenceLayout, renderer->style());
renderer->setNeedsLayout(true);
}
}
示例2: buildPendingResourcesIfNeeded
void SVGElement::buildPendingResourcesIfNeeded()
{
Document& document = this->document();
if (!needsPendingResourceHandling() || !inDocument() || isInShadowTree())
return;
SVGDocumentExtensions* extensions = document.accessSVGExtensions();
AtomicString resourceId = getIdAttribute();
if (!extensions->hasPendingResource(resourceId))
return;
// Mark pending resources as pending for removal.
extensions->markPendingResourcesForRemoval(resourceId);
// Rebuild pending resources for each client of a pending resource that is being removed.
while (Element* clientElement = extensions->removeElementFromPendingResourcesForRemoval(resourceId)) {
ASSERT(clientElement->hasPendingResources());
if (clientElement->hasPendingResources()) {
clientElement->buildPendingResource();
extensions->clearHasPendingResourcesIfPossible(clientElement);
}
}
}