1 // 2 // Copyright 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 // DmaBufImageSiblingEGL.h: Defines the DmaBufImageSiblingEGL to wrap EGL images 8 // created from dma_buf objects 9 10 #ifndef LIBANGLE_RENDERER_GL_EGL_DMABUFIMAGESIBLINGEGL_H_ 11 #define LIBANGLE_RENDERER_GL_EGL_DMABUFIMAGESIBLINGEGL_H_ 12 13 #include "libANGLE/renderer/gl/egl/ExternalImageSiblingEGL.h" 14 15 namespace rx 16 { 17 18 class DmaBufImageSiblingEGL : public ExternalImageSiblingEGL 19 { 20 public: 21 DmaBufImageSiblingEGL(const egl::AttributeMap &attribs); 22 ~DmaBufImageSiblingEGL() override; 23 24 egl::Error initialize(const egl::Display *display) override; 25 26 // ExternalImageSiblingImpl interface 27 gl::Format getFormat() const override; 28 bool isRenderable(const gl::Context *context) const override; 29 bool isTexturable(const gl::Context *context) const override; 30 bool isYUV() const override; 31 bool hasProtectedContent() const override; 32 gl::Extents getSize() const override; 33 size_t getSamples() const override; 34 35 // ExternalImageSiblingEGL interface 36 EGLClientBuffer getBuffer() const override; 37 void getImageCreationAttributes(std::vector<EGLint> *outAttributes) const override; 38 39 private: 40 egl::AttributeMap mAttribs; 41 gl::Extents mSize; 42 gl::Format mFormat; 43 bool mYUV; 44 bool mHasProtectedContent; 45 }; 46 47 } // namespace rx 48 49 #endif // LIBANGLE_RENDERER_GL_EGL_DMABUFIMAGESIBLINGEGL_H_ 50