本文整理汇总了C++中SVGPendingElements类的典型用法代码示例。如果您正苦于以下问题:C++ SVGPendingElements类的具体用法?C++ SVGPendingElements怎么用?C++ SVGPendingElements使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SVGPendingElements类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
void SVGDocumentExtensions::markPendingResourcesForRemoval(const AtomicString& id)
{
if (id.isEmpty())
return;
ASSERT(!m_pendingResourcesForRemoval.contains(id));
SVGPendingElements* existing = m_pendingResources.take(id);
if (existing && !existing->isEmpty())
m_pendingResourcesForRemoval.add(id, existing);
}
示例2: ASSERT
void SVGDocumentExtensions::addPendingResource(const AtomicString& id, PassRefPtr<SVGStyledElement> obj)
{
ASSERT(obj);
if (id.isEmpty())
return;
if (m_pendingResources.contains(id))
m_pendingResources.get(id)->add(obj);
else {
SVGPendingElements* set = new SVGPendingElements;
set->add(obj);
m_pendingResources.add(id, set);
}
}
示例3: ASSERT
bool SVGDocumentExtensions::isElementPendingResources(Element* element) const
{
// This algorithm takes time proportional to the number of pending resources and need not.
// If performance becomes an issue we can keep a counted set of elements and answer the question efficiently.
ASSERT(element);
for (const auto& entry : m_pendingResources) {
SVGPendingElements* elements = entry.value.get();
ASSERT(elements);
if (elements->contains(element))
return true;
}
return false;
}
示例4: removeElementFromPendingResourcesForRemoval
SVGStyledElement* SVGDocumentExtensions::removeElementFromPendingResourcesForRemoval(const AtomicString& id)
{
if (id.isEmpty())
return 0;
SVGPendingElements* resourceSet = m_pendingResourcesForRemoval.get(id);
if (!resourceSet || resourceSet->isEmpty())
return 0;
SVGPendingElements::iterator firstElement = resourceSet->begin();
SVGStyledElement* element = *firstElement;
resourceSet->remove(firstElement);
if (resourceSet->isEmpty())
removePendingResourceForRemoval(id);
return element;
}