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)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla29
People
(Reporter: longsonr, Assigned: longsonr)
Details
Attachments
(1 file, 1 obsolete file)
19.19 KB,
patch
|
dholbert
:
review+
|
Details | Diff | 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.
Assignee | ||
Updated•12 years ago
|
Attachment #8355003 -
Attachment is patch: true
Attachment #8355003 -
Flags: review?(dholbert)
Assignee | ||
Updated•12 years ago
|
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
Assignee | ||
Updated•12 years ago
|
OS: Windows Vista → All
Hardware: x86 → All
Assignee | ||
Comment 1•12 years ago
|
||
Assignee: nobody → longsonr
Attachment #8355003 -
Attachment is obsolete: true
Attachment #8355003 -
Flags: review?(dholbert)
Attachment #8355012 -
Flags: review?(dholbert)
Comment 2•12 years ago
|
||
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+
Assignee | ||
Comment 3•12 years ago
|
||
I don't mind adding it back. It just seemed superfluous given that they are private to a file named mask now.
Comment 4•12 years ago
|
||
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.
Assignee | ||
Comment 5•12 years ago
|
||
Flags: in-testsuite-
Comment 6•12 years ago
|
||
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.
Description
•