Closed Bug 955854 Opened 12 years ago Closed 12 years ago

Remove unused colour space mapping code and move the rest to nsSVGMaskFrame

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: longsonr, Assigned: longsonr)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Since we converted filters to Moz2d, masks are the only callers of the colour space mapping code in nsSVGUtils. This patch removes everything that masks don't use and moves that which it does into the nsSVGMaskFrame itself.
Attachment #8355003 - Attachment is patch: true
Attachment #8355003 - Flags: review?(dholbert)
Summary: Remove unused colour space mapping code and move the rest to nsSVGFilterFrame → Remove unused colour space mapping code and move the rest to nsSVGMaskFrame
OS: Windows Vista → All
Hardware: x86 → All
Assignee: nobody → longsonr
Attachment #8355003 - Attachment is obsolete: true
Attachment #8355003 - Flags: review?(dholbert)
Attachment #8355012 - Flags: review?(dholbert)
Comment on attachment 8355012 [details] [diff] [review] move more code to nsSVGMaskFrame Looks good! Just one nit: > if (StyleSVGReset()->mMaskType == NS_STYLE_MASK_TYPE_LUMINANCE) { > if (StyleSVG()->mColorInterpolation == > NS_STYLE_COLOR_INTERPOLATION_LINEARRGB) { >- nsSVGUtils::ComputeLinearRGBLuminanceMask(data, stride, rect, aOpacity); >+ ComputeLinearRGBLuminance(data, stride, rect, aOpacity); > } else { >- nsSVGUtils::ComputesRGBLuminanceMask(data, stride, rect, aOpacity); >+ ComputesRGBLuminance(data, stride, rect, aOpacity); > } > } else { >- nsSVGUtils::ComputeAlphaMask(data, stride, rect, aOpacity); >+ ComputeAlpha(data, stride, rect, aOpacity); > } Looks like you're renaming these functions to drop the "Mask" suffix -- why? That suffix seems useful from a clarity perspective. The new name "ComputeAlpha" sounds like a function that computes an *actual* alpha value across a grid of pixels, and similarly Compute*Luminance sounds like it's computing an actual luminance value. But these methods aren't computing alpha or luminance values; they're computing masks which are then used for determining those things (IIUC). r=me regardless (but I lean a bit towards keeping the Mask suffixes)
Attachment #8355012 - Flags: review?(dholbert) → review+
I don't mind adding it back. It just seemed superfluous given that they are private to a file named mask now.
Understood. I still think they add clarity, per e.g. the easy misunderstanding of what "ComputeAlpha" might do (even in a file with Mask in the name), as noted above.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: