mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 952354 - Draw non-premultiplied alpha raster image frames if the frame is opaque. r=jrmuizel
--HG-- extra : rebase_source : 62956f725b3a4765a7617a37bf79b4be2e37c739
This commit is contained in:
parent
05be99d38f
commit
f46941cf7a
@ -2616,8 +2616,16 @@ RasterImage::Draw(gfxContext *aContext,
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aContext);
|
||||
|
||||
// We can only draw with the default decode flags
|
||||
if (mFrameDecodeFlags != DECODE_FLAGS_DEFAULT) {
|
||||
// We can only draw without discarding and redecoding in these cases:
|
||||
// * We have the default decode flags.
|
||||
// * We have exactly FLAG_DECODE_NO_PREMULTIPLY_ALPHA and the current frame
|
||||
// is opaque.
|
||||
bool haveDefaultFlags = (mFrameDecodeFlags == DECODE_FLAGS_DEFAULT);
|
||||
bool haveSafeAlphaFlags =
|
||||
(mFrameDecodeFlags == FLAG_DECODE_NO_PREMULTIPLY_ALPHA) &&
|
||||
FrameIsOpaque(FRAME_CURRENT);
|
||||
|
||||
if (!(haveDefaultFlags || haveSafeAlphaFlags)) {
|
||||
if (!CanForciblyDiscardAndRedecode())
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
ForceDiscard();
|
||||
|
Loading…
Reference in New Issue
Block a user