Closed Bug 844511 Opened 11 years ago Closed 11 years ago

Only luminance masks need unpremultiplying and conversion to linear RGB

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: osk, Assigned: osk)

Details

(Keywords: perf)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0
Build ID: 20130218103317

Steps to reproduce:

Studied nsSVGMaskFrame.cpp.


Actual results:

nsSVGUtils::UnPremultiplyImageDataAlpha and nsSVGUtils::ConvertImageDataToLinearRGB are called before checking what  StyleSVGReset()->mMaskType == NS_STYLE_MASK_TYPE_LUMINANCE returns.


Expected results:

They should only be called when it returns true.
Comment on attachment 717549 [details] [diff] [review]
svg_UnPreMultiplyImageDataAlpha_only_for_relevant_masktype.patch

Moved the calls to nsSVGUtils::UnPremultiplyImageDataAlpha and nsSVGUtils::ConvertImageDataToLinearRGB to the block corresponding to StyleSVG()->mColorInterpolation == NS_STYLE_COLOR_INTERPOLATION_LINEARRGB being true
Attachment #717549 - Flags: review?(longsonr)
It would be very nice if someone could point me to some any existing test cases for the masking related code in SVG.
layout/reftests/svg/mask-type-01.svg layout/reftests/svg/mask-type-02.svg layout/reftests/svg/mask-type-03.svg all test alpha masks. The other files in layout/reftests/svg with mask in their titles test luminance masks.
Summary: nsSVGUtils::UnPremultiplyImageDataAlpha and nsSVGUtils::ConvertImageDataToLinearRGB need only be called when StyleSVGReset()->mMaskType == NS_STYLE_MASK_TYPE_LUMINANCE → Only luminance masks need unpremnsSVGUtils::UnPremultiplyImageDataAlpha and nsSVGUtils::ConvertImageDataToLinearRGB need only be called when StyleSVGReset()->mMaskType == NS_STYLE_MASK_TYPE_LUMINANCE
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Only luminance masks need unpremnsSVGUtils::UnPremultiplyImageDataAlpha and nsSVGUtils::ConvertImageDataToLinearRGB need only be called when StyleSVGReset()->mMaskType == NS_STYLE_MASK_TYPE_LUMINANCE → Only luminance masks need unpremultiplying and conversion to linear RGB
Attachment #717549 - Flags: review?(longsonr) → review+
Flags: in-testsuite-
Keywords: perf
OS: Linux → All
Hardware: x86_64 → All
I can probably land this for you tomorrow.
Forgive me, but I don't understand what you mean by "land this". Are you offering to commit this patch into trunk?
Assignee: nobody → osk
Thank you! So, is it now safe to assume this means I need not add the "checkin-needed" keyword mentioned on this page: https://developer.mozilla.org/en-US/docs/Developer_Guide/How_to_Submit_a_Patch ?
(In reply to O S K Chaitanya from comment #7)
> Thank you! So, is it now safe to assume this means I need not add the
> "checkin-needed" keyword mentioned on this page:
> https://developer.mozilla.org/en-US/docs/Developer_Guide/
> How_to_Submit_a_Patch ?

If you want to add checkin-needed your patch ought to follow these rules: https://developer.mozilla.org/en-US/docs/Creating_a_patch_that_can_be_checked_in

As it's your first time I let you off jumping through those hoops ;-)

Your patch is on the mozilla-inbound trunk tree now and should make it to mozilla-central within the next 24 hours.
Oh and thanks for the patch.
https://hg.mozilla.org/mozilla-central/rev/0ebe5600711d
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: