Closed Bug 1732115 Opened 3 years ago Closed 3 years ago

Reorient images during decoding

Categories

(Core :: Graphics: ImageLib, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

Details

Attachments

(6 files)

Right now all JPEG and AVIF images that have an EXIF non-identity orientation are reoriented on the main thread. This is done by redrawing into a new surface, which is not a SourceSurfaceSharedData surface, which means we do extra copies (and hold onto extra memory) for every oriented image. In order to get rid of ImageContainers, which is the only level of caching saving us from even more copies, we need to resolve this. In this bug we will move the default reorientation into the decoder pipeline and hide that detail from the consumers of imagelib.

This is a new swizzle operation which allows us process a reorientation
row by row into its new orientation. This will be used in a later part
in the series in the image decoding pipeline.

Rather than change every use of IntSize/Rect/Point in image/, this patch
attempts to draw the line at the relevant parts of the decoding pipeline
to prevent confusion about which size and orientation we are working
with.

This part hooks up the swizzling code from earlier to the AVIF and JPEG
decoder pipelines.

This is now all handled in the layers below.

Pushed by aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b59e36f7d5db
Part 1. Add swizzling support for reorienting by row. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/a70457bd2f8b
Part 2. Move OrientedPixel and related to image/Orientation.h. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/f1e959fe505b
Part 3. Refactor decoder pipeline to partially use Unoriented/OrientedPixel. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/b3d0a986a16b
Part 4. Add/use reorienting decoding pipeline. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/3f78ef2ad9a9
Part 5. Remove reorientation code from RasterImage. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/2278746d5589
Part 6. Update test annotations. r=tnikkel
Blocks: 1752280
Regressions: 1765871
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: