Bug 1309081 - Initialize image layer as part of Gecko_EnsureImageLayersLength. r=manishearth

MozReview-Commit-ID: 4MszPafvcKs
This commit is contained in:
Cameron McCormack 2016-10-11 17:55:15 +08:00
Родитель e87b4eacab
Коммит e05a781a4f
2 изменённых файлов: 10 добавлений и 12 удалений

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

@ -802,16 +802,16 @@ Gecko_CopyStyleContentsFrom(nsStyleContent* aContent, const nsStyleContent* aOth
}
void
Gecko_EnsureImageLayersLength(nsStyleImageLayers* aLayers, size_t aLen)
Gecko_EnsureImageLayersLength(nsStyleImageLayers* aLayers, size_t aLen,
nsStyleImageLayers::LayerType aLayerType)
{
aLayers->mLayers.EnsureLengthAtLeast(aLen);
}
size_t oldLength = aLayers->mLayers.Length();
void
Gecko_InitializeImageLayer(nsStyleImageLayers::Layer* aLayer,
nsStyleImageLayers::LayerType aLayerType)
{
aLayer->Initialize(aLayerType);
aLayers->mLayers.EnsureLengthAtLeast(aLen);
for (size_t i = oldLength; i < aLen; ++i) {
aLayers->mLayers[i].Initialize(aLayerType);
}
}
void

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

@ -300,10 +300,8 @@ void Gecko_ClearPODTArray(void* array, size_t elem_size, size_t elem_align);
void Gecko_ClearStyleContents(nsStyleContent* content);
void Gecko_CopyStyleContentsFrom(nsStyleContent* content, const nsStyleContent* other);
void Gecko_EnsureImageLayersLength(nsStyleImageLayers* layers, size_t len);
void Gecko_InitializeImageLayer(nsStyleImageLayers::Layer* layer,
nsStyleImageLayers::LayerType layer_type);
void Gecko_EnsureImageLayersLength(nsStyleImageLayers* layers, size_t len,
nsStyleImageLayers::LayerType layer_type);
// Clean up pointer-based coordinates
void Gecko_ResetStyleCoord(nsStyleUnit* unit, nsStyleUnion* value);