mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 987005 - Add comments to a condition in PopThebesLayerData(). r=roc
This commit is contained in:
parent
06f24a9d75
commit
5c83daaf1f
@ -1843,6 +1843,29 @@ AddTransformedBoundsToRegion(const nsIntRegion& aRegion,
|
||||
aDest->Or(*aDest, intRect);
|
||||
}
|
||||
|
||||
static bool
|
||||
CanOptimizeAwayThebesLayer(ThebesLayerData* aData,
|
||||
FrameLayerBuilder* aLayerBuilder)
|
||||
{
|
||||
bool isRetained = aData->mLayer->Manager()->IsWidgetLayerManager();
|
||||
if (!isRetained) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there's no thebes layer with valid content in it that we can reuse,
|
||||
// always create a color or image layer (and potentially throw away an
|
||||
// existing completely invalid thebes layer).
|
||||
if (aData->mLayer->GetValidRegion().IsEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// There is an existing thebes layer we can reuse. Throwing it away can make
|
||||
// compositing cheaper (see bug 946952), but it might cause us to re-allocate
|
||||
// the thebes layer frequently due to an animation. So we only discard it if
|
||||
// we're in tree compression mode, which is triggered at a low frequency.
|
||||
return aLayerBuilder->CheckInLayerTreeCompressionMode();
|
||||
}
|
||||
|
||||
void
|
||||
ContainerState::PopThebesLayerData()
|
||||
{
|
||||
@ -1858,9 +1881,8 @@ ContainerState::PopThebesLayerData()
|
||||
nsRefPtr<Layer> layer;
|
||||
nsRefPtr<ImageContainer> imageContainer = data->CanOptimizeImageLayer(mBuilder);
|
||||
|
||||
bool isRetained = data->mLayer->Manager()->IsWidgetLayerManager();
|
||||
if (isRetained && (data->mIsSolidColorInVisibleRegion || imageContainer) &&
|
||||
(data->mLayer->GetValidRegion().IsEmpty() || mLayerBuilder->CheckInLayerTreeCompressionMode())) {
|
||||
if ((data->mIsSolidColorInVisibleRegion || imageContainer) &&
|
||||
CanOptimizeAwayThebesLayer(data, mLayerBuilder)) {
|
||||
NS_ASSERTION(!(data->mIsSolidColorInVisibleRegion && imageContainer),
|
||||
"Can't be a solid color as well as an image!");
|
||||
if (imageContainer) {
|
||||
|
Loading…
Reference in New Issue
Block a user