Closed Bug 1015780 Opened 10 years ago Closed 10 years ago

Make Moz2D's GetAlignedStride() faster

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32

People

(Reporter: jwatt, Assigned: jwatt)

Details

Attachments

(1 file)

      No description provided.
Attached patch patchSplinter Review
Attachment #8428428 - Flags: review?(bas)
Comment on attachment 8428428 [details] [diff] [review]
patch

Review of attachment 8428428 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/2d/Tools.h
@@ +140,5 @@
>  
>  template<int alignment>
>  int32_t GetAlignedStride(int32_t aStride)
>  {
> +  const int32_t mask = alignment - 1;

I'm sort of okay with this. But I'm not sure the marginal speed benefit is worth the function not working with NPOT alignments. If we do go this way.. make sure to -clearly- document you can only have power of two alignments. I'm not a big fan.
Attachment #8428428 - Flags: review?(bas) → review+
I added a documenting comment _and_ an assertion. :)

https://hg.mozilla.org/integration/mozilla-inbound/rev/ac5e2c6f4ec0
https://hg.mozilla.org/mozilla-central/rev/ff5926ce296d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: