1 // 2 // Copyright 2019 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 #ifndef LIBANGLE_RENDERER_D3D_D3D11_EXTERNALIMAGESIBLINGIMPL11_H_ 8 #define LIBANGLE_RENDERER_D3D_D3D11_EXTERNALIMAGESIBLINGIMPL11_H_ 9 10 #include "libANGLE/renderer/ImageImpl.h" 11 #include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h" 12 13 namespace rx 14 { 15 16 class Renderer11; 17 class RenderTargetD3D; 18 19 class ExternalImageSiblingImpl11 : public ExternalImageSiblingImpl 20 { 21 public: 22 ExternalImageSiblingImpl11(Renderer11 *renderer, 23 EGLClientBuffer clientBuffer, 24 const egl::AttributeMap &attribs); 25 ~ExternalImageSiblingImpl11() override; 26 27 // ExternalImageSiblingImpl interface 28 egl::Error initialize(const egl::Display *display) override; 29 gl::Format getFormat() const override; 30 bool isRenderable(const gl::Context *context) const override; 31 bool isTexturable(const gl::Context *context) const override; 32 bool isYUV() const override; 33 gl::Extents getSize() const override; 34 size_t getSamples() const override; 35 36 // FramebufferAttachmentObjectImpl interface 37 angle::Result getAttachmentRenderTarget(const gl::Context *context, 38 GLenum binding, 39 const gl::ImageIndex &imageIndex, 40 GLsizei samples, 41 FramebufferAttachmentRenderTarget **rtOut) override; 42 angle::Result initializeContents(const gl::Context *context, 43 const gl::ImageIndex &imageIndex) override; 44 45 private: 46 angle::Result createRenderTarget(const gl::Context *context); 47 48 Renderer11 *mRenderer; 49 EGLClientBuffer mBuffer; 50 egl::AttributeMap mAttribs; 51 52 TextureHelper11 mTexture; 53 54 gl::Format mFormat = gl::Format::Invalid(); 55 bool mIsRenderable = false; 56 bool mIsTexturable = false; 57 bool mIsTextureArray = false; 58 bool mYUV = false; 59 EGLint mWidth = 0; 60 EGLint mHeight = 0; 61 GLsizei mSamples = 0; 62 UINT mArraySlice = 0; 63 64 std::unique_ptr<RenderTargetD3D> mRenderTarget; 65 }; 66 67 } // namespace rx 68 69 #endif // LIBANGLE_RENDERER_D3D_D3D11_EXTERNALIMAGESIBLINGIMPL11_H_ 70