Bug 1769774 - Stop tracking painted PresShells. r=mstange

After bug 1730284 we don't use it for throttling iframes, so the only
remaining use the test-only nsIDOMWindowUtils.paintCount. None of the
tests using it rely on the empty transaction case, so we should be able
to just remove this.

Differential Revision: https://phabricator.services.mozilla.com/D146589
This commit is contained in:
Emilio Cobos Álvarez 2022-05-27 11:12:19 +00:00
Родитель 0dd4ed02ef
Коммит c8ac345ec7
4 изменённых файлов: 1 добавлений и 72 удалений

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

@ -6411,15 +6411,11 @@ void PresShell::PaintInternal(nsView* aViewToPaint, PaintInternalFlags aFlags) {
(aFlags & PaintInternalFlags::PaintComposite)
? WindowRenderer::END_DEFAULT
: WindowRenderer::END_NO_COMPOSITE)) {
frame->UpdatePaintCountForPaintedPresShells();
return;
}
}
frame->RemoveStateBits(NS_FRAME_UPDATE_LAYER_TREE);
}
if (frame) {
frame->ClearPresShellsFromLastPaint();
}
nscolor bgcolor = ComputeBackstopColor(aViewToPaint);
PaintFrameFlags flags =

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

@ -11696,28 +11696,6 @@ nsIFrame::PhysicalAxes nsIFrame::ShouldApplyOverflowClipping(
return clip ? PhysicalAxes::Both : PhysicalAxes::None;
}
bool nsIFrame::DidPaintPresShell(mozilla::PresShell* aPresShell) {
for (nsWeakPtr& item : *PaintedPresShellList()) {
RefPtr<mozilla::PresShell> presShell = do_QueryReferent(item);
if (presShell == aPresShell) {
return true;
}
}
return false;
}
void nsIFrame::AddPaintedPresShell(mozilla::PresShell* aPresShell) {
PaintedPresShellList()->AppendElement(do_GetWeakReference(aPresShell));
}
void nsIFrame::UpdatePaintCountForPaintedPresShells() {
for (nsWeakPtr& item : *PaintedPresShellList()) {
if (RefPtr<mozilla::PresShell> presShell = do_QueryReferent(item)) {
presShell->IncrementPaintCount();
}
}
}
#ifdef DEBUG
static void GetTagName(nsIFrame* aFrame, nsIContent* aContent, int aResultSize,
char* aResult) {

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

@ -4441,29 +4441,6 @@ class nsIFrame : public nsQueryFrame {
*/
virtual void PullOverflowsFromPrevInFlow() {}
/**
* @return true if we painted @aPresShell during the last repaint.
*/
bool DidPaintPresShell(mozilla::PresShell* aPresShell);
/**
* Clear the list of child PresShells generated during the last paint
* so that we can begin generating a new one.
*/
void ClearPresShellsFromLastPaint() { PaintedPresShellList()->Clear(); }
/**
* Flag a child PresShell as painted so that it will get its paint count
* incremented during empty transactions.
*/
void AddPaintedPresShell(mozilla::PresShell* aPresShell);
/**
* Increment the paint count of all child PresShells that were painted during
* the last repaint.
*/
void UpdatePaintCountForPaintedPresShells();
/**
* Accessors for the absolute containing block.
*/
@ -4480,7 +4457,7 @@ class nsIFrame : public nsQueryFrame {
return kAbsoluteList;
}
// Checks if we (or any of our descendents) have NS_FRAME_PAINTED_THEBES set,
// Checks if we (or any of our descendants) have NS_FRAME_PAINTED_THEBES set,
// and clears this bit if so.
bool CheckAndClearPaintedState();
@ -5015,27 +4992,6 @@ class nsIFrame : public nsQueryFrame {
void MarkAbsoluteFramesForDisplayList(nsDisplayListBuilder* aBuilder);
// Stores weak references to all the PresShells that were painted during
// the last paint event so that we can increment their paint count during
// empty transactions
NS_DECLARE_FRAME_PROPERTY_DELETABLE(PaintedPresShellsProperty,
nsTArray<nsWeakPtr>)
nsTArray<nsWeakPtr>* PaintedPresShellList() {
bool found;
nsTArray<nsWeakPtr>* list =
GetProperty(PaintedPresShellsProperty(), &found);
if (!found) {
list = new nsTArray<nsWeakPtr>();
AddProperty(PaintedPresShellsProperty(), list);
} else {
MOZ_ASSERT(list, "this property should only store non-null values");
}
return list;
}
protected:
void MarkInReflow() {
#ifdef DEBUG_dbaron_off

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

@ -1056,7 +1056,6 @@ nsCaret* nsDisplayListBuilder::GetCaret() {
void nsDisplayListBuilder::IncrementPresShellPaintCount(PresShell* aPresShell) {
if (mIsPaintingToWindow) {
mReferenceFrame->AddPaintedPresShell(aPresShell);
aPresShell->IncrementPaintCount();
}
}