Closed Bug 1071339 Opened 10 years ago Closed 10 years ago

Improvements to STRONG_GLENUM's

Categories

(Core :: Graphics: CanvasWebGL, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: bjacob, Assigned: bjacob)

References

Details

Attachments

(1 file)

This builds on the work from bug 1063053 and hopefully stays true to its original spirit while bringing some improvements to STRONG_GLENUM's:
 * minimize the size of macros.
 * wrap enum values in a STRONG_GLENUM_VALUE(X) macro so we could extend this easily (e.g. stringifying or static-checking things).
 * assert that enum values are listed in order, which allows for binary search, which might be appreciable even as it's only used in debug builds at the moment, as the TexInternalFormat enum is going to have 80 values...!
 * in debug builds, initialize with a dummy bad value and assert that it isn't the current value anymore by the time we read it.
 * allow GLenums on either side of == and !=  (ran into that problem while using this for TexInternalFormat).
Attachment #8493449 - Flags: review?(dglastonbury)
Blocks: 1071335
Blocks: 1071340
Comment on attachment 8493449 [details] [diff] [review]
Improve STRONG_GLENUM

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

r+ with Inexistant changed to Nonexistant.

::: dom/canvas/WebGLStrongTypes.h
@@ +97,5 @@
> +template<typename Details>
> +class StrongGLenum MOZ_FINAL
> +{
> +private:
> +    static const GLenum InexistantGLenum = 0xdeaddead;

English would say "NonexistantGLenum"
Attachment #8493449 - Flags: review?(dglastonbury) → review+
https://hg.mozilla.org/mozilla-central/rev/f7dcea476fca
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: