Closed Bug 942502 Opened 11 years ago Closed 11 years ago

Move EGLImage/GraphicBuffer-specific helpers out of GLContext

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: bjacob, Assigned: u480271)

References

Details

(Whiteboard: [qa-])

Attachments

(2 files, 1 obsolete file)

Talking about this bit of GLContext.h:

    virtual bool BindExternalBuffer(GLuint texture, void* buffer) { return false; }
    virtual bool UnbindExternalBuffer(GLuint texture) { return false; }

#ifdef MOZ_WIDGET_GONK
    virtual EGLImage CreateEGLImageForNativeBuffer(void* buffer) = 0;
    virtual void DestroyEGLImage(EGLImage image) = 0;
#endif

    virtual already_AddRefed<TextureImage>
    CreateDirectTextureImage(::android::GraphicBuffer* aBuffer, GLenum aWrapMode)
    { return nullptr; }
Expected difficulty: intermediate.

Nontrivial as custom choices will have to be made for each place in Gecko that was relying on that, but I expect that there won't be too many (DXR to the rescue).
In preparation, BindExternalBuffer/UnbindExternalBuffer appear to be dead code.

Try run to check: https://tbpl.mozilla.org/?tree=Try&rev=0ebf5416840f
Assignee: nobody → dglastonbury
Status: NEW → ASSIGNED
Extracted methods CreateEGLImageForNativeBuffer and DestroyEGLImage from
GLContext and moved to EGLImageHelpers.[h|cpp]. Renamed to
EGLImageCreateFromNativeBuffer and EGLImageDestroy.
Attachment #8344469 - Flags: review?(bjacob)
Attachment #8343521 - Flags: review?(bjacob)
Comment on attachment 8344469 [details] [diff] [review]
Move EGLImage/GraphicBuffer-specific helpers out of GLContext

Review of attachment 8344469 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with this:

::: gfx/layers/moz.build
@@ +183,5 @@
>  # has full system permissions there.
>  if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
>      EXPORTS.mozilla.layers += [
>          'ipc/ShadowLayerUtilsGralloc.h',
> +        'opengl/EGLImageHelpers.h'

If I am not mistaken, this header is only #included by source files in the same directory, so you don't need to export it. Better not export headers until we need to.
Attachment #8344469 - Flags: review?(bjacob) → review+
Attachment #8343521 - Flags: review?(bjacob) → review+
Attachment #8344469 - Attachment is obsolete: true
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: