Closed Bug 1288649 Opened 4 years ago Closed 4 years ago

Fix non-unified-build errors for dom/canvas


(Core :: Canvas: WebGL, defect)

50 Branch
Not set



Tracking Status
firefox50 --- fixed


(Reporter: jgilbert, Assigned: jgilbert)



(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:
See other reviews:
Comment on attachment 8773648 [details]
Bug 1288649 - Use mfbt IsPowerOfTwo funcs in gfx/. -

::: 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. -
Attachment #8773647 - Flags: review?(ethlin) → review+
Comment on attachment 8773972 [details]
Bug 1288649 - Remove NextPowerOfTwo. -
Attachment #8773972 - Flags: review?(jmuizelaar) → review+
You need to log in before you can comment on or make changes to this bug.