1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MOZILLA_GFX_RENDEREGLIMAGETEXTUREHOSTOGL_H
8 #define MOZILLA_GFX_RENDEREGLIMAGETEXTUREHOSTOGL_H
10 #include "mozilla/layers/TextureHostOGL.h"
11 #include "RenderTextureHostOGL.h"
17 // RenderEGLImageTextureHost is created only for SharedSurface_EGLImage that is
18 // created in parent process.
19 class RenderEGLImageTextureHost final
: public RenderTextureHostOGL
{
21 RenderEGLImageTextureHost(EGLImage aImage
, EGLSync aSync
, gfx::IntSize aSize
);
23 wr::WrExternalImage
Lock(uint8_t aChannelIndex
, gl::GLContext
* aGL
,
24 wr::ImageRendering aRendering
) override
;
25 void Unlock() override
;
27 gfx::IntSize
GetSize(uint8_t aChannelIndex
) const override
;
28 GLuint
GetGLHandle(uint8_t aChannelIndex
) const override
;
31 virtual ~RenderEGLImageTextureHost();
32 void DeleteTextureHandle();
34 const EGLImage mImage
;
36 const gfx::IntSize mSize
;
38 RefPtr
<gl::GLContext
> mGL
;
39 GLenum mTextureTarget
;
40 GLuint mTextureHandle
;
44 } // namespace mozilla
46 #endif // MOZILLA_GFX_RENDEREGLIMAGETEXTUREHOSTOGL_H