Bug 866232 - Reserve a layer tree id for the root layer tree. r=BenWa

This commit is contained in:
Kartikaya Gupta 2013-07-30 14:03:38 -04:00
Родитель d7cb73e242
Коммит d8a4ad4023
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -697,12 +697,17 @@ CompositorParent::NotifyChildCreated(uint64_t aChild)
sIndirectLayerTrees[aChild].mParent = this;
}
// Ensure all layer tree IDs are greater than zero, so if we
// ever see a zero-valued layer tree id we know it's actually
// uninitialized and/or garbage.
uint64_t CompositorParent::ROOT_LAYER_TREE_ID = 1;
/*static*/ uint64_t
CompositorParent::AllocateLayerTreeId()
{
MOZ_ASSERT(CompositorLoop());
MOZ_ASSERT(NS_IsMainThread());
static uint64_t ids;
static uint64_t ids = ROOT_LAYER_TREE_ID;
return ++ids;
}

Просмотреть файл

@ -113,6 +113,11 @@ public:
*/
static void ShutDown();
/**
* The reserved layer tree ID for the root of the layer tree.
*/
static uint64_t ROOT_LAYER_TREE_ID;
/**
* Allocate an ID that can be used to refer to a layer tree and
* associated resources that live only on the compositor thread.