Esempio n. 1
0
void
nsHtml5TreeOpStage::MoveOpsAndSpeculativeLoadsTo(nsTArray<nsHtml5TreeOperation>& aOpQueue,
        nsTArray<nsHtml5SpeculativeLoad>& aSpeculativeLoadQueue)
{
    mozilla::MutexAutoLock autoLock(mMutex);
    if (aOpQueue.IsEmpty()) {
        mOpQueue.SwapElements(aOpQueue);
    } else {
        aOpQueue.MoveElementsFrom(mOpQueue);
    }
    if (aSpeculativeLoadQueue.IsEmpty()) {
        mSpeculativeLoadQueue.SwapElements(aSpeculativeLoadQueue);
    } else {
        aSpeculativeLoadQueue.MoveElementsFrom(mSpeculativeLoadQueue);
    }
}
Esempio n. 2
0
void
ContainerLayer::SortChildrenBy3DZOrder(nsTArray<Layer*>& aArray)
{
  nsAutoTArray<Layer*, 10> toSort;

  for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) {
    ContainerLayer* container = l->AsContainerLayer();
    if (container && container->GetContentFlags() & CONTENT_PRESERVE_3D) {
      toSort.AppendElement(l);
    } else {
      if (toSort.Length() > 0) {
        SortLayersBy3DZOrder(toSort);
        aArray.MoveElementsFrom(toSort);
      }
      aArray.AppendElement(l);
    }
  }
  if (toSort.Length() > 0) {
    SortLayersBy3DZOrder(toSort);
    aArray.MoveElementsFrom(toSort);
  }
}