Bug 1557368 [wpt PR 16856] - Update error type test for attachInternals(), a=testonly
[gecko.git] / gfx / webrender_bindings / RenderEGLImageTextureHost.h
blobdf2feebb3044a934ed33306641b59fc6afa97605
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"
13 namespace mozilla {
15 namespace wr {
17 // RenderEGLImageTextureHost is created only for SharedSurface_EGLImage that is
18 // created in parent process.
19 class RenderEGLImageTextureHost final : public RenderTextureHostOGL {
20 public:
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;
30 private:
31 virtual ~RenderEGLImageTextureHost();
32 void DeleteTextureHandle();
34 const EGLImage mImage;
35 EGLSync mSync;
36 const gfx::IntSize mSize;
38 RefPtr<gl::GLContext> mGL;
39 GLenum mTextureTarget;
40 GLuint mTextureHandle;
43 } // namespace wr
44 } // namespace mozilla
46 #endif // MOZILLA_GFX_RENDEREGLIMAGETEXTUREHOSTOGL_H