Closed Bug 1288649 Opened 4 years ago Closed 4 years ago

Fix non-unified-build errors for dom/canvas

Categories

(Core :: Canvas: WebGL, defect)

50 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: jgilbert, Assigned: jgilbert)

Details

Attachments

(5 files)

It's that time again!
While fixing non-unified-build errors in dom/canvas, I started hitting a
static_assert that we were calling IsPowerOfTwo with a signed type. It
turns out we have at least three copies of IsPowerOfTwo() in the tree.
Let's drop the non-mfbt ones.

Review commit: https://reviewboard.mozilla.org/r/66410/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/66410/
Comment on attachment 8773648 [details]
Bug 1288649 - Use mfbt IsPowerOfTwo funcs in gfx/. -

https://reviewboard.mozilla.org/r/66410/#review63180

::: gfx/thebes/gfxUtils.h:299
(Diff revision 1)
>  /**
> - * Returns the first integer greater than or equal to |aNumber| which is a
> + * Returns the first integer greater than |aNumber| which is a power of two.
> - * power of two. Undefined for |aNumber| < 0.
>   */
> -static inline int
> +static int
>  NextPowerOfTwo(int aNumber)

Although the name for this function is not great. The semantics are the ones that we want. i.e. NextPowerOfTwo(4) == 4.

It would be better to change the existing callers to use RoundUpPow2
Attachment #8773648 - Flags: review?(jmuizelaar) → review-
Comment on attachment 8773647 [details]
Bug 1288649 - Fix non-unified-build errors. -

https://reviewboard.mozilla.org/r/66408/#review63462
Attachment #8773647 - Flags: review?(ethlin) → review+
Comment on attachment 8773972 [details]
Bug 1288649 - Remove NextPowerOfTwo. -

https://reviewboard.mozilla.org/r/66602/#review63634
Attachment #8773972 - Flags: review?(jmuizelaar) → review+
You need to log in before you can comment on or make changes to this bug.