Closed Bug 1628532 Opened 5 years ago Closed 5 years ago

OrientedImage use of WillDrawOpaqueNow isn't great

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: tnikkel, Assigned: tnikkel)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

WillDrawOpaqueNow tries to answer the question "if Draw is called on this image 'pretty soon' from now will it draw something opaque (so I know if I can cull stuff behind it for painting)".

But OrientedImage wants "is the frame I have right now opaque (so I can choose the right format for a surface I'm trying the flipped image into)".

WillDrawOpaqueNow checks the lock count, which is irrelevant for OrientedImage use case (we already have the surface) and it calls LookupBestMatch, which means it could be returning a difference surface than the one OrientedImage got, so whether or not the surface is finished decoding could differ between these two surfaces.

Regressed by: 1260324
Has Regression Range: --- → yes
Keywords: regression

WillDrawOpaqueNow tries to answer the question "if Draw is called on this image 'pretty soon' from now will it draw something opaque (so I know if I can cull stuff behind it for painting)".

But OrientedImage wants "is the frame I have right now opaque (so I can choose the right format for a surface I'm trying to draw the flipped image into)".

Bug 1260324 replaces imgIContainer::IsOpaque with WillDrawOpaquaNow, but it should have considered this case a bit more.

RasterImage::GetFrame already checks if the surface is finished before returning, and we have the format on the returned frame, so we don't need anything complicated here.

Assignee: nobody → tnikkel
Status: NEW → ASSIGNED

Bugbug thinks this bug is a defect, but please change it back in case of error.

Type: enhancement → defect
Pushed by tnikkel@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/92d08b0cf559 Don't use WillDrawOpaqueNow in OrientedImage::GetFrame. r=aosmond
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: