Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release
[gecko.git] / gfx / webrender_bindings / RenderDMABUFTextureHost.h
bloba38eeaf596c2743384e40d774cbf52f5cc9ce588
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_RENDERDMABUFTEXTUREHOST_H
8 #define MOZILLA_GFX_RENDERDMABUFTEXTUREHOST_H
10 #include "mozilla/layers/TextureHostOGL.h"
11 #include "RenderTextureHost.h"
12 #include "mozilla/widget/DMABufSurface.h"
14 namespace mozilla {
16 namespace layers {
17 class SurfaceDescriptorDMABuf;
20 namespace wr {
22 class RenderDMABUFTextureHost final : public RenderTextureHost {
23 public:
24 explicit RenderDMABUFTextureHost(DMABufSurface* aSurface);
26 wr::WrExternalImage Lock(uint8_t aChannelIndex, gl::GLContext* aGL) override;
27 void Unlock() override;
28 void ClearCachedResources() override;
30 size_t Bytes() override {
31 return mSurface->GetWidth() * mSurface->GetHeight() *
32 BytesPerPixel(mSurface->GetFormat());
35 private:
36 virtual ~RenderDMABUFTextureHost();
37 void DeleteTextureHandle();
39 RefPtr<DMABufSurface> mSurface;
40 RefPtr<gl::GLContext> mGL;
43 } // namespace wr
44 } // namespace mozilla
46 #endif // MOZILLA_GFX_RENDERDMABUFTEXTUREHOST_H