Open Bug 1141380 Opened 6 years ago Updated 4 years ago

Simplify image-orientation support in nsImageFrame::ComputeSize

Categories

(Core :: ImageLib, defect)

defect
Not set
normal

Tracking

()

People

(Reporter: seth, Assigned: seth)

References

Details

(Keywords: feature)

Attachments

(1 file)

Bug 870021 added, among other things, code to handle image-orientation in nsImageFrame::ComputeSize. The code is more complex than necessary; it's only necessary to check mImage->GetOrientation().
Andrea, I thought this might be good for you to review because very few people
currently understand image wrappers, even though they're used for a lot of
things in Gecko. This particular code involves an image wrapper, but the author
didn't realize that, so they wrote code that is more complex than necessary.

To get up to speed with how this code uses image wrappers, take a look at the
ImageWrapper and OrientedImage classes (there are comments in the header files),
and then look at nsLayoutUtils::OrientImage and
nsImageFrame::NotifyNewCurrentRequest.  Hopefully it should be clear how
everything fits together - mImage contains an ImageWrapper (an OrientedImage
instance) and so mImage->GetOrientation() always does the right thing.

Let me know if there's anything I can clarify!
Attachment #8574983 - Flags: review?(amarchesini)
Comment on attachment 8574983 [details] [diff] [review]
Simplify image-orientation support in nsImageFrame::ComputeSize

Review of attachment 8574983 [details] [diff] [review]:
-----------------------------------------------------------------

sorry for the delay. I was in PTO.
Attachment #8574983 - Flags: review?(amarchesini) → review+
(In reply to Andrea Marchesini (:baku) from comment #2)
> sorry for the delay. I was in PTO.

No worries! Thanks for the review.
Keywords: feature
You need to log in before you can comment on or make changes to this bug.