Closed Bug 942500 Opened 11 years ago Closed 11 years ago

Move GLContext::TexImage2D and friends out of GLContext

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: bjacob, Assigned: bjacob)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

GLContext::TexImage2D is our own helper to upload textures more easily, not to be confused with GLContext::fTexImage2D which is the actual OpenGL entry point. I think that the name similarity alone is a problem; and that is a significant amount of nontrivial code that we could free GLContext.* of.
In the process of doing that, we'd also move CopyAndPadTextureData out of GLContext.cpp, as it's only used by TexImage2D.
Summary: Move GLContext::TexImage2D out of GLContext → Move GLContext::TexImage2D out of GLContext (also: CopyAndPadTextureData)
TexImage2D has friends which should move along with it:

    void TexImage2D(GLenum target, GLint level, GLint internalformat,
                    GLsizei width, GLsizei height, GLsizei stride,
                    GLint pixelsize, GLint border, GLenum format,
                    GLenum type, const GLvoid *pixels);

    void TexSubImage2D(GLenum target, GLint level,
                       GLint xoffset, GLint yoffset,
                       GLsizei width, GLsizei height, GLsizei stride,
                       GLint pixelsize, GLenum format,
                       GLenum type, const GLvoid* pixels);

    /**
     * Uses the Khronos GL_EXT_unpack_subimage extension, working around
     * quirks in the Tegra implementation of this extension.
     */
    void TexSubImage2DWithUnpackSubimageGLES(GLenum target, GLint level,
                                             GLint xoffset, GLint yoffset,
                                             GLsizei width, GLsizei height,
                                             GLsizei stride, GLint pixelsize,
                                             GLenum format, GLenum type,
                                             const GLvoid* pixels);

    void TexSubImage2DWithoutUnpackSubimage(GLenum target, GLint level,
                                            GLint xoffset, GLint yoffset,
                                            GLsizei width, GLsizei height,
                                            GLsizei stride, GLint pixelsize,
                                            GLenum format, GLenum type,
                                            const GLvoid* pixels);
Summary: Move GLContext::TexImage2D out of GLContext (also: CopyAndPadTextureData) → Move GLContext::TexImage2D and friends out of GLContext
I'll do this one next.
Assignee: nobody → bjacob
It turns out that these functions were only used (anymore?) in the Upload* functions that just moved there!
Attachment #8340776 - Flags: review?(jgilbert)
Attachment #8340776 - Flags: review?(jgilbert) → review+
https://hg.mozilla.org/mozilla-central/rev/11d9777debba
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: