mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1169879 - Use only the critical displayport when computing image visibility. r=tn
This commit is contained in:
parent
f265a24409
commit
7257d4441a
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user