修訂 | 3c049d2aded213c7bcc49cdb7283cf0fcb509644 (tree) |
---|---|
時間 | 2012-01-13 10:29:34 |
作者 | Nicolas Roard <nicolasroard@goog...> |
Commiter | Nicolas Roard |
Prevent infinite loop when turning on then off composited mode
bug:5820635
Change-Id: I24b6eae6c76c29e44106b4ec87e74d945aad7b1b
@@ -1366,7 +1366,21 @@ bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const | ||
1366 | 1366 | return false; |
1367 | 1367 | |
1368 | 1368 | // The root layer always has a compositing layer, but it may not have backing. |
1369 | +#if PLATFORM(ANDROID) | |
1370 | + // If we do not have a root platform layer, don't use the | |
1371 | + // mustOverlapCompositedLayers() as a cue that this layer needs to be | |
1372 | + // composited -- the layers tree has been detached. | |
1373 | + // Otherwise we can end up in a cycle where updateBacking() switches composited | |
1374 | + // mode on because a layer has mustOverlapCompositedLayers() (by calling | |
1375 | + // enableCompositingMode()), while computeCompositingRequirements() will | |
1376 | + // (correctly) say that we do not need to be in composited mode and turns it | |
1377 | + // off, rince and repeat... | |
1378 | + return requiresCompositingLayer(layer) | |
1379 | + || (m_rootPlatformLayer && layer->mustOverlapCompositedLayers()) | |
1380 | + || (inCompositingMode() && layer->isRootLayer()); | |
1381 | +#else | |
1369 | 1382 | return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers() || (inCompositingMode() && layer->isRootLayer()); |
1383 | +#endif | |
1370 | 1384 | } |
1371 | 1385 | |
1372 | 1386 | #if PLATFORM(ANDROID) |