mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 951268 - Use MaskSurface when drawing A8 filter results. r=Bas
This commit is contained in:
parent
202cc29467
commit
13cd1908f5
@ -591,9 +591,19 @@ FilterNodeSoftware::Draw(DrawTarget* aDrawTarget,
|
||||
Point sourceToDestOffset = aDestPoint - aSourceRect.TopLeft();
|
||||
Rect renderedSourceRect = Rect(outputRect).Intersect(aSourceRect);
|
||||
Rect renderedDestRect = renderedSourceRect + sourceToDestOffset;
|
||||
aDrawTarget->DrawSurface(result, renderedDestRect,
|
||||
renderedSourceRect - Point(outputRect.TopLeft()),
|
||||
DrawSurfaceOptions(), aOptions);
|
||||
if (result->GetFormat() == SurfaceFormat::A8) {
|
||||
// Interpret the result as having implicitly black color channels.
|
||||
aDrawTarget->PushClipRect(renderedDestRect);
|
||||
aDrawTarget->MaskSurface(ColorPattern(Color(0.0, 0.0, 0.0, 1.0)),
|
||||
result,
|
||||
Point(outputRect.TopLeft()) + sourceToDestOffset,
|
||||
aOptions);
|
||||
aDrawTarget->PopClip();
|
||||
} else {
|
||||
aDrawTarget->DrawSurface(result, renderedDestRect,
|
||||
renderedSourceRect - Point(outputRect.TopLeft()),
|
||||
DrawSurfaceOptions(), aOptions);
|
||||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
|
Loading…
Reference in New Issue
Block a user