Followon for 325906 and some more improvements for JPEG in Cairo

VERIFIED FIXED

Status

()

Core
ImageLib
VERIFIED FIXED
11 years ago
9 years ago

People

(Reporter: Alfred Kayser, Assigned: Alfred Kayser)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

11 years ago
Created attachment 250745 [details] [diff] [review]
Patch to remove warnings and some optimize Jpg in Cairo
Attachment #250745 - Flags: review?(pavlov)
(Assignee)

Updated

11 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 1

11 years ago
Patch description:

1. Use row_stride and bpr only in non-Cairo builds (for the RGBRow buffer)
   (as jpg scanlines are always 3 bytes (in current config anyway)
2. Use 'client_data' to keep the pointer to the decoder instead of the offsetof hack
3. Call 'img->ImageUpdated' not for every scanline, but for every batch of scanlines received (just like OnDataAvailable).

Ad 1: Allows for better Cairo and non-Cairo separation
Ad 2: Removes the need for the offsetof hack
Ad 3: Makes image decoding for JPG in Cairo a lot faster (at least it feels faster)
(Betting you didn't mean to assign to nobody@mozilla.org)
Assignee: nobody → alfredkayser
Status: ASSIGNED → NEW

Comment 3

11 years ago
Comment on attachment 250745 [details] [diff] [review]
Patch to remove warnings and some optimize Jpg in Cairo

this looks good.  the non-cairo code can also be removed at this point but may want to do that in a separate patch.
Attachment #250745 - Flags: review?(pavlov) → review+
(Assignee)

Updated

11 years ago
Attachment #250745 - Flags: superreview?(tor)

Comment 4

11 years ago
Comment on attachment 250745 [details] [diff] [review]
Patch to remove warnings and some optimize Jpg in Cairo

> nsJPEGDecoder::OutputScanlines()
> {
...
> #if defined(MOZ_CAIRO_GFX)
...
>+#else
>+  // Note! row_stride here must match the row_stride in
>+  // nsJPEGDecoder::WriteFrom
>+#if defined(MOZ_CAIRO_GFX) || defined(XP_MAC) || defined(XP_MACOSX)

This test is inside a !defined(MOZ_CAIRO_GFX) chunk, so remove the first condition.  With that, sr=tor.
Attachment #250745 - Flags: superreview?(tor) → superreview+
(Assignee)

Comment 5

11 years ago
Who can do the checkin for me?
Whiteboard: [checkin needed]

Comment 6

11 years ago
Created attachment 253479 [details] [diff] [review]
what was checked in

Please diff from mozilla/ so it's easier to apply your patches. Also attaching the diff with comments addressed would be appreciated.

Checked in with tor's comment fixed.

modules/libpr0n/decoders/jpeg/nsJPEGDecoder.cpp  1.69
modules/libpr0n/decoders/jpeg/nsJPEGDecoder.h    1.24
Attachment #250745 - Attachment is obsolete: true

Updated

11 years ago
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
(Assignee)

Updated

9 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.