1 // 2 // Copyright 2021 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // DmaBufImageSiblingVkLinux.h: Defines the DmaBufImageSiblingVkLinux to wrap 8 // EGL images created from Linux dma-buf objects 9 10 #ifndef LIBANGLE_RENDERER_VULKAN_LINUX_DMABUFIMAGESIBLINGVKLINUX_H_ 11 #define LIBANGLE_RENDERER_VULKAN_LINUX_DMABUFIMAGESIBLINGVKLINUX_H_ 12 13 #include "libANGLE/renderer/vulkan/ImageVk.h" 14 15 namespace rx 16 { 17 18 class DmaBufImageSiblingVkLinux : public ExternalImageSiblingVk 19 { 20 public: 21 DmaBufImageSiblingVkLinux(const egl::AttributeMap &attribs); 22 ~DmaBufImageSiblingVkLinux() override; 23 24 egl::Error initialize(const egl::Display *display) override; 25 void onDestroy(const egl::Display *display) override; 26 27 // ExternalImageSiblingImpl interface 28 gl::Format getFormat() const override; 29 bool isRenderable(const gl::Context *context) const override; 30 bool isTexturable(const gl::Context *context) const override; 31 bool isYUV() const override; 32 bool hasProtectedContent() const override; 33 gl::Extents getSize() const override; 34 size_t getSamples() const override; 35 36 // ExternalImageSiblingVk interface 37 vk::ImageHelper *getImage() const override; 38 39 void release(RendererVk *renderer) override; 40 41 private: 42 angle::Result initImpl(DisplayVk *displayVk); 43 44 egl::AttributeMap mAttribs; 45 gl::Extents mSize; 46 gl::Format mFormat; 47 48 bool mRenderable; 49 bool mTextureable; 50 bool mYUV; 51 bool mHasProtectedContent; 52 size_t mSamples; 53 54 vk::ImageHelper *mImage; 55 }; 56 57 } // namespace rx 58 59 #endif // LIBANGLE_RENDERER_VULKAN_LINUX_DMABUFIMAGESIBLINGVKLINUX_H_ 60