Closed
Bug 871094
Opened 11 years ago
Closed 11 years ago
Add warning for gl.clear(0)
Categories
(Core :: Graphics: CanvasWebGL, defect)
Core
Graphics: CanvasWebGL
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: jgilbert, Assigned: guillaume.abadie)
Details
Attachments
(1 file, 2 obsolete files)
1.05 KB,
patch
|
guillaume.abadie
:
review+
|
Details | Diff | Splinter Review |
Calling `gl.clear(0)` is never cheaper than not calling it at all. The real danger is that `gl.clear(gl.GARBAGE)` is coerced to `gl.clear(0)`, which is an otherwise valid call. We should warn about this, so (totally hypothetically) someone doesn't waste time trying to figure out why `gl.clear(gl.CLEAR_BUFFER_BIT)` doesn't work, when they mean `gl.clear(gl.COLOR_BUFFER_BIT)`.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → gabadie
Assignee | ||
Comment 1•11 years ago
|
||
patch adding a warning message when calling gl.clear(0)
Attachment #766061 -
Flags: review?(bjacob)
Reporter | ||
Comment 2•11 years ago
|
||
Comment on attachment 766061 [details] [diff] [review] patch for landing Review of attachment 766061 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/canvas/src/WebGLContextGL.cpp @@ +592,5 @@ > if (mask != m) > return ErrorInvalidValue("clear: invalid mask bits"); > > + if (mask == 0) { > + GenerateWarning("useless call gl.clear(0)"); I would reword this to something like 'Calling gl.clear(0) has no effect.'.
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #766061 -
Attachment is obsolete: true
Attachment #766061 -
Flags: review?(bjacob)
Attachment #766114 -
Flags: review?(jgilbert)
Reporter | ||
Comment 4•11 years ago
|
||
Comment on attachment 766114 [details] [diff] [review] patch revision 1 Review of attachment 766114 [details] [diff] [review]: ----------------------------------------------------------------- That should be good enough. It should at least make people ask themselves if they really meant to call it with 0.
Attachment #766114 -
Flags: review?(jgilbert) → review+
Reporter | ||
Updated•11 years ago
|
Keywords: checkin-needed
Reporter | ||
Comment 6•11 years ago
|
||
Actually we shouldn't bail at this warning. Clear() should still trigger any GL errors it's supposed to, even if won't be doing anything.
Attachment #766114 -
Attachment is obsolete: true
Attachment #786054 -
Flags: review?(gabadie)
Assignee | ||
Updated•11 years ago
|
Attachment #786054 -
Flags: review?(gabadie) → review+
Reporter | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 7•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/4a638ac362cb
Keywords: checkin-needed
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4a638ac362cb
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•