mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
Issue #2364 - use DrawTarget::DrawSurfaceWithShadow to render box shadows on platforms that accelerate it.
This commit is contained in:
parent
8d30faf95f
commit
4beb3b947c
13 changed files with 228 additions and 150 deletions
|
|
@ -595,6 +595,8 @@ CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestin
|
|||
//
|
||||
//
|
||||
|
||||
int Bpp = BytesPerPixel(aSurface->GetFormat());
|
||||
|
||||
if (uploadRect.Contains(rect)) {
|
||||
// Extend mode is irrelevant, the displayed rect is completely contained
|
||||
// by the source bitmap.
|
||||
|
|
@ -631,7 +633,7 @@ CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestin
|
|||
|
||||
// A partial upload will suffice.
|
||||
aRT->CreateBitmap(D2D1::SizeU(uint32_t(uploadRect.width), uint32_t(uploadRect.height)),
|
||||
mapping.GetData() + int(uploadRect.x) * 4 + int(uploadRect.y) * mapping.GetStride(),
|
||||
mapping.GetData() + int(uploadRect.x) * Bpp + int(uploadRect.y) * mapping.GetStride(),
|
||||
mapping.GetStride(),
|
||||
D2D1::BitmapProperties(D2DPixelFormat(aSurface->GetFormat())),
|
||||
getter_AddRefs(bitmap));
|
||||
|
|
@ -641,8 +643,6 @@ CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestin
|
|||
|
||||
return bitmap.forget();
|
||||
} else {
|
||||
int Bpp = BytesPerPixel(aSurface->GetFormat());
|
||||
|
||||
if (Bpp != 4) {
|
||||
// This shouldn't actually happen in practice!
|
||||
MOZ_ASSERT(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue