Closed Bug 816168 Opened 13 years ago Closed 13 years ago

Split out WebGLRenderbuffer into separate files

Categories

(Core :: Graphics: CanvasWebGL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: bjacob, Assigned: sawrubh)

References

Details

(Whiteboard: [mentor=bjacob][lang=c++] webgl-next)

Attachments

(1 file, 1 obsolete file)

This is a class living almost entirely inside WebGLContext.h. Split it into a new separate header, WebGLRenderbuffer.h, and try to move most (or all) of its actual code in WebGLRenderbuffer.cpp. Typically WebGLRenderbuffer.h would only include WebGLObjectModel.h and not WebGLContext.h. The point is to make it so that we can #include WebGLRenderbuffer.h without dragging in too many dependencies, and to bring WebGLContext.h down to a reasonable size. See bug 801499 for the work on splitting WebGLBuffer out (which had to do lots of extra work as WebGLObjectModel.h didn't exist yet). When moving its code into WebGLRenderbuffer.cpp, use discretion to decide where to stop. If a method is very small, does not require dragging in any dependency, is performance-critical so that the cost of the function call matters, and is used outside of WebGLRenderbuffer.cpp, then it can make sense for it to stay in WebGLRenderbuffer.h so that the compiler can still inline it without relying on link-time optimization. If you get something that builds and passes 1.0.1 conformance tests, https://www.khronos.org/registry/webgl/conformance-suites/1.0.1/webgl-conformance-tests.html you'll know that you're on the right track.
Blocks: 816173
Attached patch Patch v1 (obsolete) — Splinter Review
Assignee: nobody → saurabhanandiit
Status: NEW → ASSIGNED
Attachment #687783 - Flags: review?(bjacob)
Comment on attachment 687783 [details] [diff] [review] Patch v1 Review of attachment 687783 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! ::: content/canvas/src/WebGLObjectModel.cpp @@ +32,5 @@ > + } else { > + mWidth = 0; > + mHeight = 0; > + } > +} I think I'd rather keep these two methods in the header. They are very small, don't require any dependency, and there could conceivably be cases where the performance impact might matter.
Attachment #687783 - Flags: review?(bjacob) → review+
Attached patch Patch v2Splinter Review
Fixed nit.
Attachment #687783 - Attachment is obsolete: true
Attachment #687851 - Flags: checkin?(bjacob)
Blocks: 815921
Comment on attachment 687851 [details] [diff] [review] Patch v2 By the way, don't clear the review+ flag (or don't obsolete the patch with a review+ flag). Thanks.
Attachment #687851 - Flags: review+
Attachment #687851 - Flags: checkin?(bjacob)
Attachment #687851 - Flags: checkin+
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: