mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1148418 - Make nsDisplayBackgroundColor::Paint use a higher precision floating point type to avoid scrolling artifacts. r=mattwoodrow
This commit is contained in:
parent
0c5ccc4f47
commit
798a360c0e
@ -2938,11 +2938,28 @@ nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
|
||||
|
||||
nsRect borderBox = nsRect(ToReferenceFrame(), mFrame->GetSize());
|
||||
|
||||
#if 0
|
||||
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1148418#c21 for why this
|
||||
// results in a precision induced rounding issue that makes the rect one
|
||||
// pixel shorter in rare cases. Disabled in favor of the old code for now.
|
||||
// Note that the pref layout.css.devPixelsPerPx needs to be set to 1 to
|
||||
// reproduce the bug.
|
||||
Rect rect = NSRectToSnappedRect(borderBox,
|
||||
mFrame->PresContext()->AppUnitsPerDevPixel(),
|
||||
aDrawTarget);
|
||||
ColorPattern color(ToDeviceColor(mColor));
|
||||
aDrawTarget.FillRect(rect, color);
|
||||
#else
|
||||
gfxContext* ctx = aCtx->ThebesContext();
|
||||
|
||||
gfxRect bounds =
|
||||
nsLayoutUtils::RectToGfxRect(borderBox, mFrame->PresContext()->AppUnitsPerDevPixel());
|
||||
|
||||
ctx->SetColor(mColor);
|
||||
ctx->NewPath();
|
||||
ctx->Rectangle(bounds, true);
|
||||
ctx->Fill();
|
||||
#endif
|
||||
}
|
||||
|
||||
nsRegion
|
||||
|
Loading…
Reference in New Issue
Block a user