Bug 1237827 - Be sure to clear LayerComposite::mLayerComposited between each composite. r=mattwoodrow

This commit is contained in:
Botond Ballo 2016-02-08 20:26:54 -05:00
Родитель 089ecec90a
Коммит 9a2d7d1f30
2 изменённых файлов: 19 добавлений и 2 удалений

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

@ -564,8 +564,8 @@ RenderLayers(ContainerT* aContainer,
if (layerToRender->HasLayerBeenComposited()) {
// Composer2D will compose this layer so skip GPU composition
// this time & reset composition flag for next composition phase
layerToRender->SetLayerComposited(false);
// this time. The flag will be reset for the next composition phase
// at the beginning of LayerManagerComposite::Rener().
gfx::IntRect clearRect = layerToRender->GetClearRect();
if (!clearRect.IsEmpty()) {
// Clear layer's visible rect on FrameBuffer with transparent pixels

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

@ -762,6 +762,21 @@ LayerManagerComposite::PopGroupForLayerEffects(RefPtr<CompositingRenderTarget> a
Matrix4x4());
}
// Used to clear the 'mLayerComposited' flag at the beginning of each Render().
static void
ClearLayerFlags(Layer* aLayer) {
if (!aLayer) {
return;
}
if (aLayer->AsLayerComposite()) {
aLayer->AsLayerComposite()->SetLayerComposited(false);
}
for (Layer* child = aLayer->GetFirstChild(); child;
child = child->GetNextSibling()) {
ClearLayerFlags(child);
}
}
void
LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion)
{
@ -773,6 +788,8 @@ LayerManagerComposite::Render(const nsIntRegion& aInvalidRegion)
return;
}
ClearLayerFlags(mRoot);
// At this time, it doesn't really matter if these preferences change
// during the execution of the function; we should be safe in all
// permutations. However, may as well just get the values onces and