DMABUFTextureClientOGL.h (1595B)
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/. */ 6 7 #ifndef MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H 8 #define MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H 9 10 #include "mozilla/layers/TextureClientOGL.h" 11 12 class DMABufSurface; 13 14 namespace mozilla { 15 namespace layers { 16 17 class DMABUFTextureData : public TextureData { 18 public: 19 static DMABUFTextureData* Create(DMABufSurface* aSurface, 20 gfx::BackendType aBackend) { 21 return new DMABUFTextureData(aSurface, aBackend); 22 } 23 24 ~DMABUFTextureData(); 25 26 TextureType GetTextureType() const override { return TextureType::DMABUF; } 27 28 void FillInfo(TextureData::Info& aInfo) const override; 29 30 bool Lock(OpenMode) override; 31 32 void Unlock() override; 33 34 bool Serialize(SurfaceDescriptor& aOutDescriptor) override; 35 36 void GetSubDescriptor( 37 RemoteDecoderVideoSubDescriptor* const aOutDesc) override; 38 39 void Deallocate(LayersIPCChannel*) override; 40 41 void Forget(LayersIPCChannel*) override; 42 43 // For debugging purposes only. 44 already_AddRefed<gfx::DataSourceSurface> GetAsSurface(); 45 46 protected: 47 DMABUFTextureData(DMABufSurface* aSurface, gfx::BackendType aBackend); 48 49 RefPtr<DMABufSurface> mSurface; 50 gfx::BackendType mBackend; 51 }; 52 53 } // namespace layers 54 } // namespace mozilla 55 56 #endif // MOZILLA_GFX_MACIOSURFACETEXTURECLIENTOGL_H