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_RENDEREGLIMAGETEXTUREHOST_H
8 #define MOZILLA_GFX_RENDEREGLIMAGETEXTUREHOST_H
10 #include "mozilla/layers/TextureHostOGL.h"
11 #include "RenderTextureHost.h"
17 // RenderEGLImageTextureHost is created only for SharedSurface_EGLImage that is
18 // created in parent process.
19 class RenderEGLImageTextureHost final
: public RenderTextureHost
{
21 RenderEGLImageTextureHost(EGLImage aImage
, EGLSync aSync
, gfx::IntSize aSize
);
23 wr::WrExternalImage
Lock(uint8_t aChannelIndex
, gl::GLContext
* aGL
) override
;
24 void Unlock() override
;
25 size_t Bytes() override
{
26 // XXX: we don't have a format so we can't get bpp.
27 return mSize
.width
* mSize
.height
;
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_RENDEREGLIMAGETEXTUREHOST_H