Issue #2364 - use DrawTarget::DrawSurfaceWithShadow to render box shadows on platforms that accelerate it.

This commit is contained in:
Moonchild 2023-10-30 13:03:32 +01:00 committed by roytam1
commit 4beb3b947c
13 changed files with 228 additions and 150 deletions

View file

@ -713,9 +713,11 @@ DrawTargetSkia::DrawSurfaceWithShadow(SourceSurface *aSurface,
mCanvas->drawImage(image, shadowDest.x, shadowDest.y, &shadowPaint);
}
// Composite the original image after the shadow
auto dest = IntPoint::Round(aDest);
mCanvas->drawImage(image, dest.x, dest.y, &paint);
if (aSurface->GetFormat() != SurfaceFormat::A8) {
// Composite the original image after the shadow
auto dest = IntPoint::Round(aDest);
mCanvas->drawImage(image, dest.x, dest.y, &paint);
}
mCanvas->restore();
}