Bug 1571837. Don't call FlushItem for hit test items. r=mstange

We already skip painting hit test items. We can do even better
by not including them in the recording at all.

Differential Revision: https://phabricator.services.mozilla.com/D40859

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jeff Muizelaar 2019-08-06 19:05:20 +00:00
Родитель ed26ad726a
Коммит bc8f976c10
1 изменённых файлов: 24 добавлений и 22 удалений

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

@ -836,36 +836,38 @@ struct DIGroup {
aResources);
} else {
nsPaintedDisplayItem* paintedItem = item->AsPaintedDisplayItem();
if (dirty && paintedItem &&
if (paintedItem &&
// Hit test items don't have anything to paint so skip them.
// Ideally we would drop these items earlier...
item->GetType() != DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO) {
// What should the clip settting strategy be? We can set the full clip
// everytime. this is probably easiest for now. An alternative would
// be to put the push and the pop into separate items and let
// invalidation handle it that way.
DisplayItemClip currentClip = paintedItem->GetClip();
if (dirty) {
// What should the clip settting strategy be? We can set the full clip
// everytime. this is probably easiest for now. An alternative would
// be to put the push and the pop into separate items and let
// invalidation handle it that way.
DisplayItemClip currentClip = paintedItem->GetClip();
if (currentClip.HasClip()) {
aContext->Save();
currentClip.ApplyTo(aContext, aGrouper->mAppUnitsPerDevPixel);
}
aContext->NewPath();
GP("painting %s %p-%d\n", paintedItem->Name(), paintedItem->Frame(),
paintedItem->GetPerFrameKey());
if (aGrouper->mDisplayListBuilder->IsPaintingToWindow()) {
paintedItem->Frame()->AddStateBits(NS_FRAME_PAINTED_THEBES);
}
if (currentClip.HasClip()) {
aContext->Save();
currentClip.ApplyTo(aContext, aGrouper->mAppUnitsPerDevPixel);
}
aContext->NewPath();
GP("painting %s %p-%d\n", paintedItem->Name(), paintedItem->Frame(),
paintedItem->GetPerFrameKey());
if (aGrouper->mDisplayListBuilder->IsPaintingToWindow()) {
paintedItem->Frame()->AddStateBits(NS_FRAME_PAINTED_THEBES);
}
paintedItem->Paint(aGrouper->mDisplayListBuilder, aContext);
TakeExternalSurfaces(aRecorder, data->mExternalSurfaces, aRootManager,
aResources);
paintedItem->Paint(aGrouper->mDisplayListBuilder, aContext);
TakeExternalSurfaces(aRecorder, data->mExternalSurfaces, aRootManager,
aResources);
if (currentClip.HasClip()) {
aContext->Restore();
if (currentClip.HasClip()) {
aContext->Restore();
}
}
aContext->GetDrawTarget()->FlushItem(bounds);
}
aContext->GetDrawTarget()->FlushItem(bounds);
}
}
}