resized images have a blue tint on big endian machines

RESOLVED FIXED in mozilla20



6 years ago
6 years ago


(Reporter: stevensn, Assigned: stevensn)


19 Branch

Firefox Tracking Flags

(Not tracked)



(3 attachments, 1 obsolete attachment)



6 years ago
Bug 486918 added new image resizers from SKIA.  Since this was enabled resized images on my ppc32 machine show up with a blue tint.

The convolver code extracts the RGBA bits from each 32 bit pixel but doesn't take the endian order into account.

Comment 1

6 years ago
Created attachment 687479 [details] [diff] [review]
proposed fix.  Detect that this is a PPC and set the BENDIAN then use that when extracting the bits
Component: File Handling → ImageLib
Ever confirmed: true
Product: Firefox → Core
Attachment #687479 - Flags: review?(joe)
Comment on attachment 687479 [details] [diff] [review]
proposed fix.  Detect that this is a PPC and set the BENDIAN then use that when extracting the bits

Review of attachment 687479 [details] [diff] [review]:

::: gfx/2d/convolver.cpp
@@ +206,3 @@
>        if (has_alpha)
> +        accum[3] += cur_filter * source_data_rows[filter_y][byte_offset + 
> +							    A_OFFSET_IDX];

Can you just leave these all on the same line?

@@ +231,5 @@
>        //
>        // We only need to do this when generating the final output row (here).
> +      int max_color_channel = NS_MAX(out_row[byte_offset + R_OFFSET_IDX],
> +          NS_MAX(out_row[byte_offset + G_OFFSET_IDX], out_row[byte_offset 
> +							      + B_OFFSET_IDX]));

Same line here too
Attachment #687479 - Flags: review?(joe) → review+

Comment 3

6 years ago
Created attachment 688092 [details] [diff] [review]
v2 of the patch, all one one line but this exceeds 80 characters

Comment 4

6 years ago
Created attachment 688094 [details] [diff] [review]
v3 has the line break but in a better spot
Attachment #687479 - Attachment is obsolete: true
I would strongly recommend that the change to SkPreConfig.h gets a patch file added to gfx/skia/patches, or that this change be upstreamed to google's skia repo (or both!).

Otherwise this change is at risk of being overwritten when we next update skia.

Comment 7

6 years ago
submitted for review upstream

Comment 8

6 years ago
Created attachment 690255 [details] [diff] [review]
adds the changes to SkPreConfig.h as a patch listed in  gfx/skia/patches

This patch will add a patch file in gfx/skia/patches to alter SkPreConfig.h the next time we import upstream sources
Sorry! I was confusing SkPreConfig.h with SkUserConfig.h, and incorrectly figured it didn't need to have a separate patch.
Assignee: nobody → steve
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Apparently attachment #690255 [details] [diff] [review] never went through review in m-c nor commited, and neither upstream who didnt reply on codereview. Should it be unbitrotten and r?'ed ?

Stumbled upon this while investigating why skia got broken on ppc again (see #849253)...


6 years ago
Attachment #690255 - Flags: review?(joe)
Attachment #690255 - Flags: review?(joe) → review?(gwright)
Attachment #690255 - Flags: review?(gwright) → review+


6 years ago
Attachment #690255 - Flags: checkin?
Attachment #690255 - Flags: checkin?


6 years ago
Duplicate of this bug: 844436
You need to log in before you can comment on or make changes to this bug.