зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1169879 - Use only the critical displayport when computing image visibility. r=tn
This commit is contained in:
Родитель
29ba8d4eb1
Коммит
900c174944
|
@ -1065,6 +1065,13 @@ nsLayoutUtils::GetDisplayPort(nsIContent* aContent, nsRect *aResult)
|
|||
return GetDisplayPortImpl(aContent, aResult, 1.0f);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsLayoutUtils::GetDisplayPortForVisibilityTesting(nsIContent* aContent,
|
||||
nsRect* aResult)
|
||||
{
|
||||
return GetDisplayPortImpl(aContent, aResult, 1.0f);
|
||||
}
|
||||
|
||||
bool
|
||||
nsLayoutUtils::SetDisplayPortMargins(nsIContent* aContent,
|
||||
nsIPresShell* aPresShell,
|
||||
|
|
|
@ -165,6 +165,16 @@ public:
|
|||
*/
|
||||
static bool GetDisplayPort(nsIContent* aContent, nsRect *aResult = nullptr);
|
||||
|
||||
/**
|
||||
* @return the display port for the given element which should be used for
|
||||
* visibility testing purposes.
|
||||
*
|
||||
* 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 = nullptr);
|
||||
|
||||
enum class RepaintMode : uint8_t {
|
||||
Repaint,
|
||||
DoNotRepaint
|
||||
|
|
|
@ -5940,7 +5940,9 @@ PresShell::MarkImagesInSubtreeVisible(nsIFrame* aFrame, const nsRect& aRect)
|
|||
nsIScrollableFrame* scrollFrame = do_QueryFrame(aFrame);
|
||||
if (scrollFrame) {
|
||||
nsRect displayPort;
|
||||
bool usingDisplayport = nsLayoutUtils::GetDisplayPort(aFrame->GetContent(), &displayPort);
|
||||
bool usingDisplayport =
|
||||
nsLayoutUtils::GetDisplayPortForVisibilityTesting(aFrame->GetContent(),
|
||||
&displayPort);
|
||||
if (usingDisplayport) {
|
||||
rect = displayPort;
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче