Closed
Bug 989337
Opened 11 years ago
Closed 11 years ago
Convert Canvas2D to typed enums and EnumeratedArray
Categories
(Core :: Graphics: Canvas2D, defect)
Core
Graphics: Canvas2D
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: bjacob, Assigned: bjacob)
References
Details
Attachments
(3 files)
5.93 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
29.09 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
4.44 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8398515 -
Flags: review?(bas)
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8398517 -
Flags: review?(bas)
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8398518 -
Flags: review?(bas)
Assignee | ||
Updated•11 years ago
|
Attachment #8398515 -
Attachment description: 1/3: Initial manual changes → 1/3 - Initial manual changes
Comment 4•11 years ago
|
||
Comment on attachment 8398515 [details] [diff] [review]
1/3 - Initial manual changes
Review of attachment 8398515 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/canvas/src/CanvasGradient.h
@@ +75,5 @@
> Type mType;
> virtual ~CanvasGradient() {}
> };
>
> +MOZ_FINISH_NESTED_ENUM_CLASS(CanvasGradient::Type)
This Macro seems a little oddly named to me :) But it looks correct.
Attachment #8398515 -
Flags: review?(bas) → review+
Updated•11 years ago
|
Attachment #8398517 -
Flags: review?(bas) → review+
Comment 5•11 years ago
|
||
Comment on attachment 8398518 [details] [diff] [review]
3/3 - final manual changes
Review of attachment 8398518 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/canvas/src/CanvasRenderingContext2D.h
@@ +916,5 @@
>
> nsRefPtr<gfxFontGroup> fontGroup;
> + EnumeratedArray<Style, Style::MAX, nsRefPtr<CanvasGradient>> gradientStyles;
> + EnumeratedArray<Style, Style::MAX, nsRefPtr<CanvasPattern>> patternStyles;
> + EnumeratedArray<Style, Style::MAX, nscolor> colorStyles;
I wonder whether all compilers generate optimal code for this EnumeratedArray class, but I guess it doesn't matter too much.
Attachment #8398518 -
Flags: review?(bas) → review+
Assignee | ||
Comment 6•11 years ago
|
||
I wouldn't worry about that at all. I've worked on a array-like container library (matrices really) and went 1000x more crazy than this and compilers these days are good at evaporating this kind of abstraction. Look at EnumeratedArray.h, it's tiny.
Assignee | ||
Comment 7•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/aea9916128c6
https://hg.mozilla.org/integration/mozilla-inbound/rev/f05cc8c8c16d
https://hg.mozilla.org/integration/mozilla-inbound/rev/b00d3a5f4b6f
Assignee: nobody → bjacob
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/aea9916128c6
https://hg.mozilla.org/mozilla-central/rev/f05cc8c8c16d
https://hg.mozilla.org/mozilla-central/rev/b00d3a5f4b6f
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•