mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 995216 - Compensate for rounding error in DrawSurfaceWithTextureCoords. r=bas
Calculating the source rect in DrawSurfaceWithTextureCoords can introduce small floating point errors that result in detectable blending errors. Round to pixels because we know the original values (the visible region) are pixel-aligned. This is also what CompositorOGL does.
This commit is contained in:
parent
3b52ee43ad
commit
3d407681ab
@ -144,6 +144,11 @@ DrawSurfaceWithTextureCoords(DrawTarget *aDest,
|
||||
aTextureCoords.y * aSource->GetSize().height,
|
||||
aTextureCoords.width * aSource->GetSize().width,
|
||||
aTextureCoords.height * aSource->GetSize().height);
|
||||
|
||||
// Floating point error can accumulate above and we know our visible region
|
||||
// is integer-aligned, so round it out.
|
||||
sourceRect.Round();
|
||||
|
||||
// Compute a transform that maps sourceRect to aDestRect.
|
||||
gfxMatrix transform =
|
||||
gfxUtils::TransformRectToRect(sourceRect,
|
||||
|
Loading…
Reference in New Issue
Block a user