Bug 946952 - Run a 'compressed' paint up to 1 second after skipping the ColorLayer optimization. r=roc

This commit is contained in:
Matt Woodrow
2014-01-30 18:41:17 +13:00
parent b5340e766e
commit 63c5bce3f8
11 changed files with 117 additions and 15 deletions

View File

@@ -1759,7 +1759,7 @@ ContainerState::PopThebesLayerData()
nsRefPtr<ImageContainer> imageContainer = data->CanOptimizeImageLayer(mBuilder);
if ((data->mIsSolidColorInVisibleRegion || imageContainer) &&
data->mLayer->GetValidRegion().IsEmpty()) {
(data->mLayer->GetValidRegion().IsEmpty() || mLayerBuilder->CheckInLayerTreeCompressionMode())) {
NS_ASSERTION(!(data->mIsSolidColorInVisibleRegion && imageContainer),
"Can't be a solid color as well as an image!");
if (imageContainer) {
@@ -2817,6 +2817,20 @@ FrameLayerBuilder::SaveLastPaintOffset(ThebesLayer* aLayer)
}
}
bool
FrameLayerBuilder::CheckInLayerTreeCompressionMode()
{
if (mInLayerTreeCompressionMode) {
return true;
}
// If we wanted to be in layer tree compression mode, but weren't, then scheduled
// a delayed repaint where we will be.
mRootPresContext->PresShell()->GetRootFrame()->SchedulePaint(nsIFrame::PAINT_DELAYED_COMPRESS);
return false;
}
void
ContainerState::CollectOldLayers()
{