Move GLContext::TexImage2D and friends out of GLContext

RESOLVED FIXED in mozilla28

Status

()

Core
Graphics
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bjacob, Assigned: bjacob)

Tracking

Trunk
mozilla28
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

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.
(Assignee)

Comment 1

4 years ago
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)
(Assignee)

Comment 2

4 years ago
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
(Assignee)

Comment 3

4 years ago
I'll do this one next.
Assignee: nobody → bjacob
(Assignee)

Comment 4

4 years ago
Created attachment 8340776 [details] [diff] [review]
Move GLContext::TexImage2D and friends to be static functions in GLUploadHelpers.cpp

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
Last Resolved: 4 years ago
Resolution: --- → FIXED

Updated

4 years ago
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.