Move Upload* helpers out of GLContext

RESOLVED FIXED in mozilla28

Status

()

defect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: bjacob, Assigned: bjacob)

Tracking

Trunk
mozilla28
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [qa-])

Attachments

(1 attachment)

This part of GLContext.h:

    SurfaceFormat UploadImageDataToTexture(unsigned char* aData,
                                           int32_t aStride,
                                           gfxImageFormat aFormat,
                                           const nsIntRegion& aDstRegion,
                                           GLuint& aTexture,
                                           bool aOverwrite = false,
                                           bool aPixelBuffer = false,
                                           GLenum aTextureUnit = LOCAL_GL_TEXTURE0,
                                           GLenum aTextureTarget = LOCAL_GL_TEXTURE_2D);

    /**
     * Convenience wrapper around UploadImageDataToTexture for gfxASurfaces. 
     */
    SurfaceFormat UploadSurfaceToTexture(gfxASurface *aSurface,
                                         const nsIntRegion& aDstRegion,
                                         GLuint& aTexture,
                                         bool aOverwrite = false,
                                         const nsIntPoint& aSrcPoint = nsIntPoint(0, 0),
                                         bool aPixelBuffer = false,
                                         GLenum aTextureUnit = LOCAL_GL_TEXTURE0,
                                         GLenum aTextureTarget = LOCAL_GL_TEXTURE_2D);

    /**
     * Same as above, for DataSourceSurfaces.
     */
    SurfaceFormat UploadSurfaceToTexture(gfx::DataSourceSurface *aSurface,
                                         const nsIntRegion& aDstRegion,
                                         GLuint& aTexture,
                                         bool aOverwrite = false,
                                         const nsIntPoint& aSrcPoint = nsIntPoint(0, 0),
                                         bool aPixelBuffer = false,
                                         GLenum aTextureUnit = LOCAL_GL_TEXTURE0,
                                         GLenum aTextureTarget = LOCAL_GL_TEXTURE_2D);
These new files will also receive more code: the TexImage2D() functions and friends, and the CanUpload*() getters.
Assignee: nobody → bjacob
Status: NEW → ASSIGNED
Attachment #8340773 - Flags: review?(jgilbert)
Comment on attachment 8340773 [details] [diff] [review]
Move Upload* functions to new GLUploadHelpers files

Looks like straight up code movement so I will steal this one if Jeff doesn't mind.
Attachment #8340773 - Flags: review?(jgilbert) → review+
This one is indeed quite straightforward. The only question which I'd expect to be raised is how much file proliferation we want to allow; this is what I tried to justify in comment 1 with 

> These new files will also receive more code: the TexImage2D() functions and friends, and the CanUpload*() getters.

So that while this patch introduces more files, it will allow future patches not to.
https://hg.mozilla.org/mozilla-central/rev/3f08f279aec7
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.