Bug 1667475 - Drop the 'aRelativeTo' parameter of GetDisplayPortForVisibilityTesting(). r=kats

The only caller passed in DisplayRelativeTo::ScrollFrame.

Removing this makes it easier to consolidate display port options
in a subsequent patch.

Differential Revision: https://phabricator.services.mozilla.com/D92014
This commit is contained in:
Botond Ballo 2020-10-03 21:07:54 +00:00
Родитель 3665360cf1
Коммит ae40fb66f3
3 изменённых файлов: 7 добавлений и 11 удалений

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

@ -486,10 +486,8 @@ void DisplayPortUtils::MarkDisplayPortAsPainted(nsIContent* aContent) {
}
/* static */
bool DisplayPortUtils::GetDisplayPortForVisibilityTesting(
nsIContent* aContent, nsRect* aResult,
DisplayportRelativeTo
aRelativeTo /* = DisplayportRelativeTo::ScrollPort */) {
bool DisplayPortUtils::GetDisplayPortForVisibilityTesting(nsIContent* aContent,
nsRect* aResult) {
MOZ_ASSERT(aResult);
// Since the base rect might not have been updated very recently, it's
// possible to end up with an extra-large displayport at this point, if the
@ -498,7 +496,7 @@ bool DisplayPortUtils::GetDisplayPortForVisibilityTesting(
// call site is best-effort.
bool usingDisplayPort = GetDisplayPortImpl(aContent, aResult, 1.0f,
MaxSizeExceededBehaviour::Drop);
if (usingDisplayPort && aRelativeTo == DisplayportRelativeTo::ScrollFrame) {
if (usingDisplayPort) {
TranslateFromScrollPortToScrollFrame(aContent, aResult);
}
return usingDisplayPort;

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

@ -96,14 +96,13 @@ class DisplayPortUtils {
/**
* @return the display port for the given element which should be used for
* visibility testing purposes.
* visibility testing purposes, relative to the scroll frame.
*
* If low-precision buffers are enabled, this is the critical display port;
* otherwise, it's the same display port returned by GetDisplayPort().
*/
static bool GetDisplayPortForVisibilityTesting(
nsIContent* aContent, nsRect* aResult,
DisplayportRelativeTo aRelativeTo = DisplayportRelativeTo::ScrollPort);
static bool GetDisplayPortForVisibilityTesting(nsIContent* aContent,
nsRect* aResult);
enum class RepaintMode : uint8_t { Repaint, DoNotRepaint };

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

@ -5892,8 +5892,7 @@ void PresShell::MarkFramesInSubtreeApproximatelyVisible(
bool usingDisplayport =
!ignoreDisplayPort &&
DisplayPortUtils::GetDisplayPortForVisibilityTesting(
aFrame->GetContent(), &displayPort,
DisplayportRelativeTo::ScrollFrame);
aFrame->GetContent(), &displayPort);
scrollFrame->NotifyApproximateFrameVisibilityUpdate(!usingDisplayport);