mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Bug 1535585 - Make sure empty app unit rectangles get converted to empty pixel rectangles. r=jnicol
Differential Revision: https://phabricator.services.mozilla.com/D24800 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d443a85cfe
commit
2497edd2ee
@ -1240,26 +1240,17 @@ class ContainerState {
|
||||
return aRect.ScaleToNearestPixels(mParameters.mXScale, mParameters.mYScale,
|
||||
mAppUnitsPerDevPixel);
|
||||
}
|
||||
nsIntRegion ScaleRegionToNearestPixels(const nsRegion& aRegion) const {
|
||||
return aRegion.ScaleToNearestPixels(
|
||||
mParameters.mXScale, mParameters.mYScale, mAppUnitsPerDevPixel);
|
||||
}
|
||||
nsIntRect ScaleToOutsidePixels(const nsRect& aRect,
|
||||
bool aSnap = false) const {
|
||||
if (aRect.IsEmpty()) {
|
||||
return nsIntRect();
|
||||
}
|
||||
if (aSnap && mSnappingEnabled) {
|
||||
return ScaleToNearestPixels(aRect);
|
||||
}
|
||||
return aRect.ScaleToOutsidePixels(mParameters.mXScale, mParameters.mYScale,
|
||||
mAppUnitsPerDevPixel);
|
||||
}
|
||||
nsIntRegion ScaleToOutsidePixels(const nsRegion& aRegion,
|
||||
bool aSnap = false) const {
|
||||
if (aSnap && mSnappingEnabled) {
|
||||
return ScaleRegionToNearestPixels(aRegion);
|
||||
}
|
||||
return aRegion.ScaleToOutsidePixels(
|
||||
mParameters.mXScale, mParameters.mYScale, mAppUnitsPerDevPixel);
|
||||
}
|
||||
nsIntRect ScaleToInsidePixels(const nsRect& aRect, bool aSnap = false) const {
|
||||
if (aSnap && mSnappingEnabled) {
|
||||
return ScaleToNearestPixels(aRect);
|
||||
@ -1267,7 +1258,10 @@ class ContainerState {
|
||||
return aRect.ScaleToInsidePixels(mParameters.mXScale, mParameters.mYScale,
|
||||
mAppUnitsPerDevPixel);
|
||||
}
|
||||
|
||||
nsIntRegion ScaleRegionToNearestPixels(const nsRegion& aRegion) const {
|
||||
return aRegion.ScaleToNearestPixels(
|
||||
mParameters.mXScale, mParameters.mYScale, mAppUnitsPerDevPixel);
|
||||
}
|
||||
nsIntRegion ScaleRegionToInsidePixels(const nsRegion& aRegion,
|
||||
bool aSnap = false) const {
|
||||
if (aSnap && mSnappingEnabled) {
|
||||
@ -1279,6 +1273,9 @@ class ContainerState {
|
||||
|
||||
nsIntRegion ScaleRegionToOutsidePixels(const nsRegion& aRegion,
|
||||
bool aSnap = false) const {
|
||||
if (aRegion.IsEmpty()) {
|
||||
return nsIntRegion();
|
||||
}
|
||||
if (aSnap && mSnappingEnabled) {
|
||||
return ScaleRegionToNearestPixels(aRegion);
|
||||
}
|
||||
@ -4877,7 +4874,7 @@ void ContainerState::ProcessDisplayItems(nsDisplayList* aList) {
|
||||
nsIntRegion itemVisibleRegion = itemVisibleRect;
|
||||
nsRegion tightBounds = item->GetTightBounds(mBuilder, &snap);
|
||||
if (!tightBounds.IsEmpty()) {
|
||||
itemVisibleRegion.AndWith(ScaleToOutsidePixels(tightBounds, snap));
|
||||
itemVisibleRegion.AndWith(ScaleRegionToOutsidePixels(tightBounds, snap));
|
||||
}
|
||||
|
||||
ContainerLayer* oldContainer = ownLayer->GetParent();
|
||||
|
Loading…
x
Reference in New Issue
Block a user