Bug 1191539 - DisplayPort should ForceInside frameRect to match compositor DisplayPort. r=kats
This commit is contained in:
@@ -920,6 +920,9 @@ GetDisplayPortFromMarginsData(nsIContent* aContent,
|
||||
ScreenRect screenRect = LayoutDeviceRect::FromAppUnits(base, auPerDevPixel)
|
||||
* parentRes;
|
||||
|
||||
nsRect expandedScrollableRect =
|
||||
nsLayoutUtils::CalculateExpandedScrollableRect(frame);
|
||||
|
||||
if (gfxPrefs::LayersTilesEnabled()) {
|
||||
// Note on the correctness of applying the alignment in Screen space:
|
||||
// The correct space to apply the alignment in would be Layer space, but
|
||||
@@ -955,12 +958,20 @@ GetDisplayPortFromMarginsData(nsIContent* aContent,
|
||||
* res;
|
||||
|
||||
screenRect += scrollPosScreen;
|
||||
// Round-out the display port to the nearest alignment (tiles)
|
||||
float x = alignmentX * floor(screenRect.x / alignmentX);
|
||||
float y = alignmentY * floor(screenRect.y / alignmentY);
|
||||
float w = alignmentX * ceil(screenRect.XMost() / alignmentX) - x;
|
||||
float h = alignmentY * ceil(screenRect.YMost() / alignmentY) - y;
|
||||
float w = alignmentX * ceil(screenRect.width / alignmentX + 1);
|
||||
float h = alignmentY * ceil(screenRect.height / alignmentY + 1);
|
||||
screenRect = ScreenRect(x, y, w, h);
|
||||
screenRect -= scrollPosScreen;
|
||||
|
||||
ScreenRect screenExpScrollableRect =
|
||||
LayoutDeviceRect::FromAppUnits(expandedScrollableRect,
|
||||
auPerDevPixel) * res;
|
||||
|
||||
// Make sure the displayport remains within the scrollable rect.
|
||||
screenRect = screenRect.ForceInside(screenExpScrollableRect - scrollPosScreen);
|
||||
} else {
|
||||
nscoord maxSizeInAppUnits = GetMaxDisplayPortSize(aContent);
|
||||
if (maxSizeInAppUnits == nscoord_MAX) {
|
||||
@@ -1001,7 +1012,6 @@ GetDisplayPortFromMarginsData(nsIContent* aContent,
|
||||
result = ApplyRectMultiplier(result, aMultiplier);
|
||||
|
||||
// Finally, clamp it to the expanded scrollable rect.
|
||||
nsRect expandedScrollableRect = nsLayoutUtils::CalculateExpandedScrollableRect(frame);
|
||||
result = expandedScrollableRect.Intersect(result + scrollPos) - scrollPos;
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user